From f14c66d34087ca9cebe2e6c9a772728a49c61336 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Wed, 3 Aug 2011 11:55:24 +0000 Subject: [PATCH] elementary/elm_object_item - modified for consistency (naming, macros) SVN revision: 62050 --- legacy/elementary/src/lib/Elementary.h.in | 22 ++++---- legacy/elementary/src/lib/elm_main.c | 20 ++++---- legacy/elementary/src/lib/elm_widget.c | 50 +++++++++---------- legacy/elementary/src/lib/elm_widget.h | 61 +++++++++++++++++------ 4 files changed, 92 insertions(+), 61 deletions(-) diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index d15e928b41..4e19f65e1f 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/src/lib/Elementary.h.in @@ -763,14 +763,14 @@ extern "C" { * Set a content of an object item * * @param it The Elementary object item - * @param item The content id to unset (NULL for the default content) + * @param part The content part name to unset (NULL for the default content) * @param content The new content of the object item * * @note Elementary object items may have many contents * * @ingroup General */ - EAPI void elm_object_item_content_part_set(Elm_Object_Item *it, const char *item, Evas_Object *content); + EAPI void elm_object_item_content_part_set(Elm_Object_Item *it, const char *part, Evas_Object *content); #define elm_object_item_content_set(it, content) elm_object_item_content_part_set((it), NULL, (content)) @@ -778,7 +778,7 @@ extern "C" { * Get a content of an object item * * @param it The Elementary object item - * @param item The content id to unset (NULL for the default content) + * @param part The content part name to unset (NULL for the default content) * @return content of the object item or NULL for any error * * @note Elementary object items may have many contents @@ -793,43 +793,43 @@ extern "C" { * Unset a content of an object item * * @param it The Elementary object item - * @param item The content id to unset (NULL for the default content) + * @param part The content part name to unset (NULL for the default content) * * @note Elementary object items may have many contents * * @ingroup General */ - EAPI Evas_Object *elm_object_item_content_part_unset(Elm_Object_Item *it, const char *item); + EAPI Evas_Object *elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part); #define elm_object_item_content_unset(it, content) elm_object_item_content_part_unset((it), (content)) /** * Set a label of an objec itemt * - * @param obj The Elementary object item - * @param item The label id to set (NULL for the default label) + * @param it The Elementary object item + * @param part The text part name to set (NULL for the default label) * @param label The new text of the label * * @note Elementary object items may have many labels * * @ingroup General */ - EAPI void elm_object_item_text_part_set(Elm_Object_Item *it, const char *item, const char *label); + EAPI void elm_object_item_text_part_set(Elm_Object_Item *it, const char *part, const char *label); #define elm_object_item_text_set(it, label) elm_object_item_text_part_set((it), NULL, (label)) /** * Get a label of an object * - * @param obj The Elementary object item - * @param item The label id to get (NULL for the default label) + * @param it The Elementary object item + * @param part The text part name to get (NULL for the default label) * @return text of the label or NULL for any error * * @note Elementary object items may have many labels * * @ingroup General */ - EAPI const char *elm_object_item_text_part_get(const Elm_Object_Item *it, const char *item); + EAPI const char *elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part); #define elm_object_item_text_get(it) elm_object_item_part_text_get((it), NULL) diff --git a/legacy/elementary/src/lib/elm_main.c b/legacy/elementary/src/lib/elm_main.c index 0586b12a5b..f6a80d0877 100644 --- a/legacy/elementary/src/lib/elm_main.c +++ b/legacy/elementary/src/lib/elm_main.c @@ -3453,35 +3453,35 @@ elm_longpress_timeout_get(void) EAPI void elm_object_item_content_part_set(Elm_Object_Item *it, - const char *item, + const char *part, Evas_Object *content) { - elm_widget_item_content_part_set(it, item, content); + elm_widget_item_content_part_set(it, part, content); } EAPI Evas_Object * elm_object_item_content_part_get(const Elm_Object_Item *it, - const char *item) + const char *part) { - return elm_widget_item_content_part_get(it, item); + return elm_widget_item_content_part_get(it, part); } EAPI Evas_Object * -elm_object_item_content_part_unset(Elm_Object_Item *it, const char *item) +elm_object_item_content_part_unset(Elm_Object_Item *it, const char *part) { - return elm_widget_item_content_part_unset(it, item); + return elm_widget_item_content_part_unset(it, part); } EAPI void elm_object_item_text_part_set(Elm_Object_Item *it, - const char *item, + const char *part, const char *label) { - elm_widget_item_text_part_set(it, item, label); + elm_widget_item_text_part_set(it, part, label); } EAPI const char * -elm_object_item_text_part_get(const Elm_Object_Item *it, const char *item) +elm_object_item_text_part_get(const Elm_Object_Item *it, const char *part) { - return elm_widget_item_text_part_get(it, item); + return elm_widget_item_text_part_get(it, part); } diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index f40fcb1d17..10a46e9410 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -2922,50 +2922,50 @@ _smart_reconfigure(Smart_Data *sd) } EAPI void -elm_widget_item_content_part_set(Elm_Widget_Item *it, - const char *item, +_elm_widget_item_content_part_set(Elm_Widget_Item *item, + const char *part, Evas_Object *content) { - ELM_WIDGET_ITEM_CHECK_OR_RETURN(it); - if (!it->on_content_set_func) return; - it->on_content_set_func(it, item, content); + ELM_WIDGET_ITEM_CHECK_OR_RETURN(item); + if (!item->on_content_set_func) return; + item->on_content_set_func(item, part, content); } EAPI Evas_Object * -elm_widget_item_content_part_get(const Elm_Widget_Item *it, - const char *item) +_elm_widget_item_content_part_get(const Elm_Widget_Item *item, + const char *part) { - ELM_WIDGET_ITEM_CHECK_OR_RETURN(it, NULL); - if (!it->on_content_get_func) return NULL; - return it->on_content_get_func(it, item); + ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL); + if (!item->on_content_get_func) return NULL; + return item->on_content_get_func(item, part); } EAPI Evas_Object * -elm_widget_item_content_part_unset(Elm_Widget_Item *it, - const char *item) +_elm_widget_item_content_part_unset(Elm_Widget_Item *item, + const char *part) { - ELM_WIDGET_ITEM_CHECK_OR_RETURN(it, NULL); - if (!it->on_content_unset_func) return NULL; - return it->on_content_unset_func(it, item); + ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL); + if (!item->on_content_unset_func) return NULL; + return item->on_content_unset_func(item, part); } EAPI void -elm_widget_item_text_part_set(Elm_Widget_Item *it, - const char *item, +_elm_widget_item_text_part_set(Elm_Widget_Item *item, + const char *part, const char *label) { - ELM_WIDGET_ITEM_CHECK_OR_RETURN(it); - if (!it->on_text_set_func) return; - it->on_text_set_func(it, item, label); + ELM_WIDGET_ITEM_CHECK_OR_RETURN(item); + if (!item->on_text_set_func) return; + item->on_text_set_func(item, part, label); } EAPI const char * -elm_widget_item_text_part_get(const Elm_Widget_Item *it, - const char *item) +_elm_widget_item_text_part_get(const Elm_Widget_Item *item, + const char *part) { - ELM_WIDGET_ITEM_CHECK_OR_RETURN(it, NULL); - if (!it->on_text_get_func) return NULL; - return it->on_text_get_func(it, item); + ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL); + if (!item->on_text_get_func) return NULL; + return item->on_text_get_func(item, part); } static void diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index e26c52ab63..4f93929268 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -202,18 +202,18 @@ struct _Elm_Widget_Item Evas_Object *view; /**< the base view object */ const void *data; /**< item specific data */ Evas_Smart_Cb del_cb; /**< used to notify the item is being deleted */ - void (*on_content_set_func)(Elm_Widget_Item *it, - const char *item, + void (*on_content_set_func)(Elm_Widget_Item *item, + const char *part, Evas_Object *content); - Evas_Object *(*on_content_get_func)(const Elm_Widget_Item *it, - const char *item); - Evas_Object *(*on_content_unset_func)(Elm_Widget_Item *it, - const char *item); - void (*on_text_set_func)(Elm_Widget_Item *it, - const char *item, + Evas_Object *(*on_content_get_func)(const Elm_Widget_Item *item, + const char *part); + Evas_Object *(*on_content_unset_func)(Elm_Widget_Item *item, + const char *part); + void (*on_text_set_func)(Elm_Widget_Item *item, + const char *part, const char *label); - const char *(*on_text_get_func)(const Elm_Widget_Item *it, - const char *item); + const char *(*on_text_get_func)(const Elm_Widget_Item *item, + const char *part); /* widget variations should have data from here and on */ /* @todo: TODO check if this is enough for 1.0 release, maybe add padding! */ }; @@ -356,11 +356,11 @@ EAPI void _elm_widget_item_cursor_style_set(Elm_Widget_Item *item, c EAPI const char *_elm_widget_item_cursor_style_get(const Elm_Widget_Item *item); EAPI void _elm_widget_item_cursor_engine_only_set(Elm_Widget_Item *item, Eina_Bool engine_only); EAPI Eina_Bool _elm_widget_item_cursor_engine_only_get(const Elm_Widget_Item *item); -EAPI void elm_widget_item_content_part_set(Elm_Object_Item *it, const char *item, Evas_Object *content); -EAPI Evas_Object *elm_widget_item_content_part_get(const Elm_Object_Item *it, const char *item); -EAPI Evas_Object *elm_widget_item_content_part_unset(Elm_Object_Item *it, const char *item); -EAPI void elm_widget_item_text_part_set(Elm_Object_Item *it, const char *item, const char *label); -EAPI const char *elm_widget_item_text_part_get(const Elm_Object_Item *it, const char *item); +EAPI void _elm_widget_item_content_part_set(Elm_Object_Item *item, const char *part, Evas_Object *content); +EAPI Evas_Object *_elm_widget_item_content_part_get(const Elm_Object_Item *item, const char *part); +EAPI Evas_Object *_elm_widget_item_content_part_unset(Elm_Object_Item *item, const char *part); +EAPI void _elm_widget_item_text_part_set(Elm_Object_Item *item, const char *part, const char *label); +EAPI const char *_elm_widget_item_text_part_get(const Elm_Object_Item *item, const char *part); /* debug function. don't use it unless you are tracking parenting issues */ @@ -487,6 +487,37 @@ EAPI void elm_widget_tree_dot_dump(const Evas_Object *top, FILE *out */ #define elm_widget_item_cursor_engine_only_get(item) \ _elm_widget_item_cursor_engine_only_get((const Elm_Widget_Item *)item) +/** + * Convenience function to query item's content part set. + * @see _elm_widget_item_content_part_set() + */ +#define elm_widget_item_content_part_set(item, part, content) \ + _elm_widget_item_content_part_set((Elm_Widget_Item *)item, part, content) +/** + * Convenience function to query item's content part get. + * @see _elm_widget_item_content_part_get() + */ +#define elm_widget_item_content_part_get(item, part) \ + _elm_widget_item_content_part_get((const Elm_Widget_Item *)item, part) +/** + * Convenience function to query item's content part unset. + * @see _elm_widget_item_content_part_unset() + */ +#define elm_widget_item_content_part_unset(item, part) \ + _elm_widget_item_content_part_unset((Elm_Widget_Item *)item, part) +/** + * Convenience function to query item's text part set. + * @see _elm_widget_item_text_part_set() + */ +#define elm_widget_item_text_part_set(item, part, label) \ + _elm_widget_item_text_part_set((Elm_Widget_Item *)item, part, label) +/** + * Convenience function to query item's text part get. + * @see _elm_widget_item_text_part_get() + */ +#define elm_widget_item_text_part_get(item, part) \ + _elm_widget_item_text_part_get((const Elm_Widget_Item *)item, part) + /** * Cast and ensure the given pointer is an Elm_Widget_Item or return NULL.