elementary/widget - introduce elm_object_item_object_get().

We've countered application's requirements multiple times to they have the object handle from the elm_object_item.

Now we introduce it for their convenient but they should use it carefully.
This commit is contained in:
ChunEon Park 2013-09-02 17:19:36 +09:00
parent 83db5ad972
commit b67b72f710
7 changed files with 40 additions and 15 deletions

View File

@ -1578,6 +1578,10 @@
* Gengrid: implement selectraise feature.
2013-08-28 DAniel Juyung Seo (SeoZ)
2013-08-28 Daniel Juyung Seo (SeoZ)
* Bg: Add bg reset feature.
2013-09-02 ChunEon Park (Hermet)
* Widget: Introduce elm_object_item_object_get() API.

View File

@ -85,6 +85,7 @@ Additions:
* Add elm_win_focus_highlight_animate_set/get().
* Add selectraise feature to gengrid.
* Add bg reset feature.
* Add elm_object_item_object_get().
Improvements:

View File

@ -1859,3 +1859,9 @@ elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
{
return elm_widget_item_cursor_engine_only_get(it);
}
EAPI const Evas_Object *
elm_object_item_object_get(const Elm_Object_Item *it)
{
return _elm_widget_item_object_get((Elm_Widget_Item*)it);
}

View File

@ -33,6 +33,25 @@ typedef void (*Elm_Object_Item_Signal_Cb)(void *data, Elm_Objec
*/
EAPI Evas_Object *elm_object_item_widget_get(const Elm_Object_Item *it);
/**
* Get the object item's internal object handle.
*
* @param it The Elementary object item
* @return The Internal object of the object item.
*
* @note This function should only be used if you really need to refer the
* internal object's properties (i.e geometry). Since the object items are
* managed/controlled by the widget, you should not modify the object directly
* nor you should not treat the object without validation.
*
* Some widget items may return @c NULL for this API if the items @p are not
* based on the evas object.
*
* @since 1.8
* @ingroup General
*/
EAPI const Evas_Object *elm_object_item_object_get(const Elm_Object_Item *it);
/**
* Set a content of an object item
*

View File

@ -489,19 +489,6 @@ EINA_DEPRECATED EAPI Elm_Gen_Item *elm_gen_item_next_get(const Elm_Gen_Item *it)
EINA_DEPRECATED EAPI Elm_Gen_Item *elm_gen_item_prev_get(const Elm_Gen_Item *it);
EINA_DEPRECATED EAPI Evas_Object *elm_gen_item_widget_get(const Elm_Gen_Item *it);
/**
* Get the widget object's handle which contains a given item
*
* @param it The Elementary object item
* @return The widget object
*
* @note This returns the widget object itself that an item belongs to.
* @note Every elm_object_item supports this API
* @deprecated Use elm_object_item_widget_get() instead
* @ingroup General
*/
EINA_DEPRECATED EAPI Evas_Object *elm_object_item_object_get(const Elm_Object_Item *it);
/**
* Set the text to show in the anchorblock
*
@ -3303,7 +3290,7 @@ EINA_DEPRECATED EAPI void elm_slideshow_show(Elm_Object_Item *i
*
* This returns the toolbar object itself that an item belongs to.
*
* @deprecated use elm_object_item_object_get() instead.
* @deprecated use elm_object_item_widget_get() instead.
*/
EINA_DEPRECATED EAPI Evas_Object *elm_toolbar_item_toolbar_get(const Elm_Object_Item *it);

View File

@ -5771,6 +5771,13 @@ _elm_widget_item_translate(Elm_Widget_Item *item)
#endif
}
EAPI const Evas_Object *
_elm_widget_item_object_get(const Elm_Widget_Item *item)
{
ELM_WIDGET_ITEM_CHECK_OR_RETURN(item, NULL);
return item->view;
}
/* happy debug functions */
#ifdef ELM_DEBUG
static void

View File

@ -772,6 +772,7 @@ EAPI void _elm_widget_item_domain_translatable_part_text_set(Elm_Wid
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);
EAPI void _elm_widget_item_domain_part_text_translatable_set(Elm_Widget_Item *item, const char *part, const char *domain, Eina_Bool translatable);
EAPI const Evas_Object *_elm_widget_item_object_get(const Elm_Widget_Item *item);
/**
* Function to operate on a given widget's scrollabe children when necessary.