From: Jérémy Zurcher <jeremy@asynk.ch>

Subject: [E-devel] elm_entry patch : typedef Elm_Entry_Item_Provider_Cb

this improves readability and helps for ruby binding maintenance



SVN revision: 68931
This commit is contained in:
Jérémy Zurcher 2012-03-07 11:31:18 +00:00 committed by Carsten Haitzler
parent 73a47a4efe
commit 9493efc793
2 changed files with 25 additions and 8 deletions

View File

@ -3037,7 +3037,7 @@ elm_entry_context_menu_disabled_get(const Evas_Object *obj)
}
EAPI void
elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
elm_entry_item_provider_append(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
@ -3051,7 +3051,7 @@ elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *dat
}
EAPI void
elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
elm_entry_item_provider_prepend(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
@ -3065,7 +3065,7 @@ elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *da
}
EAPI void
elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
elm_entry_item_provider_remove(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);

View File

@ -411,15 +411,32 @@ struct _Elm_Entry_Anchor_Hover_Info
hover_left */
};
/**
* @typedef Elm_Entry_Item_Provider_Cb
* This callback type is used to provide items.
* If it returns an object handle other than NULL (it should create an
* object to do this), then this object is used to replace the current item.
* If not the next provider is called until one provides an item object, or the
* default provider in entry does.
* @param data The data specified as the last param when adding the provider
* @param entry The entry object
* @param text A pointer to the item href string in the text
* @return The object to be placed in the entry like an icon, or other element
* @see elm_entry_item_provider_append
* @see elm_entry_item_provider_prepend
* @see elm_entry_item_provider_remove
*/
typedef Evas_Object * (*Elm_Entry_Item_Provider_Cb)(void *data, Evas_Object * entry, const char *item);
/**
* @typedef Elm_Entry_Filter_Cb
* This callback type is used by entry filters to modify text.
* @param data The data specified as the last param when adding the filter
* @param entry The entry object
* @param text A pointer to the location of the text being filtered. The type of text is always markup. This data can be modified,
* but any additional allocations must be managed by the user.
* @param text A pointer to the location of the text being filtered. The type of text is always markup. This data can be modified, but any additional allocations must be managed by the user.
* @see elm_entry_markup_filter_append
* @see elm_entry_markup_filter_prepend
* @see elm_entry_markup_filter_remove
*/
typedef void (*Elm_Entry_Filter_Cb)(void *data, Evas_Object *entry, char **text);
@ -923,7 +940,7 @@ EAPI Eina_Bool elm_entry_context_menu_disabled_get(const Evas_Object *o
*
* @see @ref entry-items
*/
EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
EAPI void elm_entry_item_provider_append(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data);
/**
* This prepends a custom item provider to the list for that entry
@ -935,7 +952,7 @@ EAPI void elm_entry_item_provider_append(Evas_Object *obj, Evas_Ob
* @param func The function called to provide the item object
* @param data The data passed to @p func
*/
EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data);
/**
* This removes a custom item provider to the list for that entry
@ -947,7 +964,7 @@ EAPI void elm_entry_item_provider_prepend(Evas_Object *obj, Evas_O
* @param func The function called to provide the item object
* @param data The data passed to @p func
*/
EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object * (*func)(void *data, Evas_Object * entry, const char *item), void *data);
EAPI void elm_entry_item_provider_remove(Evas_Object *obj, Elm_Entry_Item_Provider_Cb func, void *data);
/**
* Append a markup filter function for text inserted in the entry