[elm_object_item] - Added elm_object_item_style_set/elm_object_item_style_get().
Reviewers: seoz, raster CC: aryarockstar, nirajkr, chinmaya061 Differential Revision: https://phab.enlightenment.org/D373
This commit is contained in:
parent
1bfaa16b35
commit
afa4398ce2
|
@ -214,6 +214,22 @@ _item_signal_emit_hook(Elm_Object_Item *it,
|
|||
elm_object_signal_emit(VIEW(it), emission, source);
|
||||
}
|
||||
|
||||
static void
|
||||
_item_style_set_hook(Elm_Object_Item *it,
|
||||
const char *style)
|
||||
{
|
||||
if (VIEW(it))
|
||||
elm_object_style_set(VIEW(it), style);
|
||||
}
|
||||
|
||||
static const char *
|
||||
_item_style_get_hook(Elm_Object_Item *it)
|
||||
{
|
||||
if (VIEW(it))
|
||||
return elm_object_style_get(VIEW(it));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_item_del_pre_hook(Elm_Object_Item *it)
|
||||
{
|
||||
|
@ -525,6 +541,8 @@ _item_add(Eo *obj, void *_pd, va_list *list)
|
|||
elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
|
||||
elm_widget_item_text_get_hook_set(item, _item_text_get_hook);
|
||||
elm_widget_item_signal_emit_hook_set(item, _item_signal_emit_hook);
|
||||
elm_widget_item_style_set_hook_set(item, _item_style_set_hook);
|
||||
elm_widget_item_style_get_hook_set(item, _item_style_get_hook);
|
||||
|
||||
item->label = eina_stringshare_add(label);
|
||||
item->icon_file = eina_stringshare_add(icon_file);
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
* @li elm_object_item_del
|
||||
* @li elm_object_item_part_text_get
|
||||
* @li elm_object_item_signal_emit - this works only when the item is created.
|
||||
* @li elm_object_item_style_set - this works only when the item is created.
|
||||
* @li elm_object_item_style_get - this works only when the item is created.
|
||||
*
|
||||
* See @ref tutorial_hoversel for an example.
|
||||
* @{
|
||||
|
|
|
@ -1798,6 +1798,18 @@ elm_object_item_signal_callback_del(Elm_Object_Item *it, const char *emission, c
|
|||
return _elm_widget_item_signal_callback_del((Elm_Widget_Item *)it, emission, source, (Elm_Widget_Item_Signal_Cb) func);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_object_item_style_set(Elm_Object_Item *it, const char *style)
|
||||
{
|
||||
elm_widget_item_style_set(it, style);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
elm_object_item_style_get(Elm_Object_Item *it)
|
||||
{
|
||||
return elm_widget_item_style_get(it);
|
||||
}
|
||||
|
||||
EAPI void elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled)
|
||||
{
|
||||
_elm_widget_item_disabled_set((Elm_Widget_Item *)it, disabled);
|
||||
|
|
|
@ -725,3 +725,22 @@ EAPI void elm_object_item_untrack(Elm_Object_Item *it);
|
|||
*/
|
||||
EAPI int elm_object_item_track_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Set a style of an object item
|
||||
*
|
||||
* @param it The Elementary object item
|
||||
* @param part The style
|
||||
*
|
||||
* @ingroup General
|
||||
*/
|
||||
EAPI void elm_object_item_style_set(Elm_Object_Item *it, const char *part);
|
||||
|
||||
/**
|
||||
* Get the style of an object item
|
||||
*
|
||||
* @param it The Elementary object item
|
||||
* @return The style of object item
|
||||
*
|
||||
* @ingroup General
|
||||
*/
|
||||
EAPI const char *elm_object_item_style_get(Elm_Object_Item *it);
|
||||
|
|
|
@ -5140,7 +5140,39 @@ _elm_widget_item_del_pre_hook_set(Elm_Widget_Item *item,
|
|||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
|
||||
item->del_pre_func = func;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Set the function to set the style of item
|
||||
*
|
||||
* @param item a valid #Elm_Widget_Item to be notified
|
||||
* @see elm_widget_item_style_set_hook_set() convenience macro.
|
||||
* @ingroup Widget
|
||||
*/
|
||||
EAPI void
|
||||
_elm_widget_item_style_set_hook_set(Elm_Widget_Item *item,
|
||||
Elm_Widget_Style_Set_Cb func)
|
||||
{
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
|
||||
item->style_set_func = func;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Set the function to get the style of item
|
||||
*
|
||||
* @param item a valid #Elm_Widget_Item to be notified
|
||||
* @see elm_widget_item_style_get_hook_set() convenience macro.
|
||||
* @ingroup Widget
|
||||
*/
|
||||
EAPI void
|
||||
_elm_widget_item_style_get_hook_set(Elm_Widget_Item *item,
|
||||
Elm_Widget_Style_Get_Cb func)
|
||||
{
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
|
||||
item->style_get_func = func;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
|
@ -5268,6 +5300,20 @@ _elm_widget_item_disabled_get(const Elm_Widget_Item *item)
|
|||
return item->disabled;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
_elm_widget_item_style_set(Elm_Widget_Item *item, const char *style)
|
||||
{
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item);
|
||||
item->style_set_func(item, style);
|
||||
}
|
||||
|
||||
EAPI const char *
|
||||
_elm_widget_item_style_get(Elm_Widget_Item *item)
|
||||
{
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
|
||||
return item->style_get_func(item);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
_elm_widget_item_disable_hook_set(Elm_Widget_Item *item,
|
||||
Elm_Widget_Disable_Cb func)
|
||||
|
|
|
@ -464,6 +464,8 @@ typedef void (*Elm_Widget_Signal_Emit_Cb)(void *data, const cha
|
|||
typedef void (*Elm_Widget_Disable_Cb)(void *data);
|
||||
typedef Eina_Bool (*Elm_Widget_Del_Pre_Cb)(void *data);
|
||||
typedef void (*Elm_Widget_Item_Signal_Cb)(void *data, Elm_Widget_Item *item, const char *emission, const char *source);
|
||||
typedef void (*Elm_Widget_Style_Set_Cb)(void *data, const char *style);
|
||||
typedef const char *(*Elm_Widget_Style_Get_Cb)(const void *data);
|
||||
|
||||
#define ELM_ACCESS_DONE -1 /* sentence done - send done event here */
|
||||
#define ELM_ACCESS_CANCEL -2 /* stop reading immediately */
|
||||
|
@ -573,6 +575,8 @@ struct _Elm_Widget_Item
|
|||
Elm_Widget_Text_Get_Cb text_get_func;
|
||||
Elm_Widget_Signal_Emit_Cb signal_emit_func;
|
||||
Elm_Widget_Disable_Cb disable_func;
|
||||
Elm_Widget_Style_Set_Cb style_set_func;
|
||||
Elm_Widget_Style_Get_Cb style_get_func;
|
||||
Evas_Object *access_obj;
|
||||
const char *access_info;
|
||||
Eina_List *access_order;
|
||||
|
@ -758,6 +762,9 @@ EAPI void _elm_widget_item_part_text_custom_set(Elm_Widget_Item *ite
|
|||
EAPI const char *_elm_widget_item_part_text_custom_get(Elm_Widget_Item *item, const char *part);
|
||||
EAPI void _elm_widget_item_part_text_custom_update(Elm_Widget_Item *item);
|
||||
|
||||
EAPI void _elm_widget_item_style_set(Elm_Widget_Item *item, const char *style);
|
||||
EAPI const char *_elm_widget_item_style_get(Elm_Widget_Item *item);
|
||||
|
||||
EAPI void _elm_widget_item_signal_callback_add(Elm_Widget_Item *item, const char *emission, const char *source, Elm_Widget_Item_Signal_Cb func, void *data);
|
||||
EAPI void *_elm_widget_item_signal_callback_del(Elm_Widget_Item *it, const char *emission, const char *source, Elm_Widget_Item_Signal_Cb func);
|
||||
EAPI void _elm_widget_item_signal_emit(Elm_Widget_Item *item, const char *emission, const char *source);
|
||||
|
@ -772,6 +779,8 @@ EAPI void _elm_widget_item_disabled_set(Elm_Widget_Item *item, Eina_
|
|||
EAPI Eina_Bool _elm_widget_item_disabled_get(const Elm_Widget_Item *item);
|
||||
EAPI void _elm_widget_item_disable_hook_set(Elm_Widget_Item *item, Elm_Widget_Disable_Cb func);
|
||||
EAPI void _elm_widget_item_del_pre_hook_set(Elm_Widget_Item *item, Elm_Widget_Del_Pre_Cb func);
|
||||
EAPI void _elm_widget_item_style_set_hook_set(Elm_Widget_Item *item, Elm_Widget_Style_Set_Cb func);
|
||||
EAPI void _elm_widget_item_style_get_hook_set(Elm_Widget_Item *item, Elm_Widget_Style_Get_Cb func);
|
||||
EAPI void _elm_widget_item_domain_translatable_part_text_set(Elm_Widget_Item *item, const char *part, const char *domain, const char *label);
|
||||
EAPI const char * _elm_widget_item_translatable_part_text_get(const Elm_Widget_Item *item, const char *part);
|
||||
EAPI void _elm_widget_item_translate(Elm_Widget_Item *item);
|
||||
|
@ -1003,7 +1012,31 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out
|
|||
*/
|
||||
#define elm_widget_item_del_pre_hook_set(item, func) \
|
||||
_elm_widget_item_del_pre_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Del_Pre_Cb)func)
|
||||
/**
|
||||
* Convenience function to query style set hook.
|
||||
* @see _elm_widget_item_style_set_hook_set()
|
||||
*/
|
||||
#define elm_widget_item_style_set_hook_set(item, func) \
|
||||
_elm_widget_item_style_set_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Style_Set_Cb)func)
|
||||
/**
|
||||
* Convenience function to query style get hook.
|
||||
* @see _elm_widget_item_style_get_hook_set()
|
||||
*/
|
||||
#define elm_widget_item_style_get_hook_set(item, func) \
|
||||
_elm_widget_item_style_get_hook_set((Elm_Widget_Item *)item, (Elm_Widget_Style_Get_Cb)func)
|
||||
|
||||
/**
|
||||
* Convenience function to set style .
|
||||
* @see _elm_widget_item_style_set()
|
||||
*/
|
||||
#define elm_widget_item_style_set(item, style) \
|
||||
_elm_widget_item_style_set((Elm_Widget_Item *)item, style)
|
||||
/**
|
||||
* Convenience function to get style .
|
||||
* @see _elm_widget_item_style_get()
|
||||
*/
|
||||
#define elm_widget_item_style_get(item) \
|
||||
_elm_widget_item_style_get((Elm_Widget_Item *)item)
|
||||
/**
|
||||
* Convenience function to query track_cancel.
|
||||
* @see _elm_widget_item_del_pre_hook_set()
|
||||
|
|
Loading…
Reference in New Issue