From 552d1918b55dd9989d0a5b78fa61395ac1e36354 Mon Sep 17 00:00:00 2001 From: hermet Date: Tue, 31 Jan 2012 01:22:16 +0000 Subject: [PATCH] elementary/gengrid - deprecated 3 APIs. elm_gengrid_item_data_set -> elm_object_item_data_set elm_gengrid_item_data_get -> elm_object_item_data_get elm_gengrid_item_gengrid_get -> elm_object_item_widget_get git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@67619 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- doc/examples.dox | 2 +- src/examples/entry_example.c | 2 +- src/examples/gengrid_example.c | 2 +- src/lib/elc_fileselector.c | 9 ++++---- src/lib/elm_deprecated.h | 49 ++++++++++++++++++++++++++++++++++++++++++ src/lib/elm_gengrid.h | 49 +----------------------------------------- 6 files changed, 57 insertions(+), 56 deletions(-) diff --git a/doc/examples.dox b/doc/examples.dox index c2e8f30..c839d47 100644 --- a/doc/examples.dox +++ b/doc/examples.dox @@ -4256,7 +4256,7 @@ * selection of the items. There, we print the item handle's value, * along with the callback function data. The latter will be @c NULL, * always, because it's what we pass when adding all icons. By using - * elm_gengrid_item_data_get(), we can have the item data back and, + * elm_object_item_data_get(), we can have the item data back and, * with that, we're priting the item's path string. Finally, we * exemplify elm_gengrid_item_pos_get(), printing the item's position * in the grid: diff --git a/src/examples/entry_example.c b/src/examples/entry_example.c index 9663d6c..c0192b2 100644 --- a/src/examples/entry_example.c +++ b/src/examples/entry_example.c @@ -43,7 +43,7 @@ _it_sel_cb(void *data, Evas_Object *obj __UNUSED__, void *event) App_Inwin_Data *aid = data; Elm_Object_Item *gg_it = event; - aid->emo = elm_gengrid_item_data_get(gg_it); + aid->emo = elm_object_item_data_get(gg_it); elm_pager_content_promote(aid->pager, aid->settings); } diff --git a/src/examples/gengrid_example.c b/src/examples/gengrid_example.c index 4e911ef..121a116 100644 --- a/src/examples/gengrid_example.c +++ b/src/examples/gengrid_example.c @@ -135,7 +135,7 @@ _grid_sel(void *data, void *event_info) { unsigned int x, y; - Example_Item *it = elm_gengrid_item_data_get(event_info); + Example_Item *it = elm_object_item_data_get(event_info); elm_gengrid_item_pos_get(event_info, &x, &y); diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 5f4bf18..f581762 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -419,15 +419,14 @@ _sel(void *data, Widget_Data *wd; void *old_sd; char *dir; + Elm_Object_Item *gg_it = event_info; wd = elm_widget_data_get(data); if (!wd) return; sd = malloc(sizeof(*sd)); sd->fs = data; - sd->path = wd->mode == ELM_FILESELECTOR_LIST ? - elm_object_item_data_get(event_info) : - elm_gengrid_item_data_get(event_info); + sd->path = wd->mode == elm_object_item_data_get(gg_it); if (!sd->path) { @@ -599,7 +598,7 @@ _file_grid_cmp(const void *a, const void *b) return 1; } - return strcoll(elm_gengrid_item_data_get(ga), elm_gengrid_item_data_get(gb)); + return strcoll(elm_object_item_data_get(ga), elm_object_item_data_get(gb)); } static int @@ -1160,7 +1159,7 @@ elm_fileselector_selected_get(const Evas_Object *obj) else { Elm_Object_Item *gg_it = elm_gengrid_selected_item_get(wd->files_grid); - if (gg_it) return elm_gengrid_item_data_get(gg_it); + if (gg_it) return elm_object_item_data_get(gg_it); } return wd->path; diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h index 894ea73..368e596 100644 --- a/src/lib/elm_deprecated.h +++ b/src/lib/elm_deprecated.h @@ -3863,3 +3863,52 @@ EINA_DEPRECATED EAPI Evas_Object *elm_entry_end_unset(Evas_Object *obj); */ EINA_DEPRECATED EAPI void elm_map_utils_rotate_coord(const Evas_Object *obj, const Evas_Coord x, const Evas_Coord y, const Evas_Coord cx, const Evas_Coord cy, const double degree, Evas_Coord *xx, Evas_Coord *yy); +/** + * Get the gengrid object's handle which contains a given gengrid item + * + * @param it The item to fetch the container from + * @return The gengrid (parent) object + * + * This returns the gengrid object itself that an item belongs to. + * + * @deprecated Use elm_object_item_widget_get() instead + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI Evas_Object *elm_gengrid_item_gengrid_get(const Elm_Object_Item *it); + +/** + * Return the data associated to a given gengrid item + * + * @param it The gengrid item. + * @return the data associated with this item. + * + * This returns the @c data value passed on the + * elm_gengrid_item_append() and related item addition calls. + * + * @see elm_gengrid_item_append() + * @see elm_gengrid_item_data_set() + * @deprecated Use elm_object_item_data_get() instead + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void *elm_gengrid_item_data_get(const Elm_Object_Item *it); + +/** + * Set the data associated with a given gengrid item + * + * @param it The gengrid item + * @param data The data pointer to set on it + * + * This @b overrides the @c data value passed on the + * elm_gengrid_item_append() and related item addition calls. This + * function @b won't call elm_gengrid_item_update() automatically, + * so you'd issue it afterwards if you want to have the item + * updated to reflect the new data. + * + * @see elm_gengrid_item_data_get() + * @see elm_gengrid_item_update() + * @deprecated Use elm_object_item_data_set() instead + * + * @ingroup Gengrid + */ +EINA_DEPRECATED EAPI void elm_gengrid_item_data_set(Elm_Object_Item *it, const void *data); + diff --git a/src/lib/elm_gengrid.h b/src/lib/elm_gengrid.h index 02fa47b..2170055 100644 --- a/src/lib/elm_gengrid.h +++ b/src/lib/elm_gengrid.h @@ -980,18 +980,6 @@ EAPI Elm_Object_Item *elm_gengrid_item_next_get(const Elm_Object_Ite EAPI Elm_Object_Item *elm_gengrid_item_prev_get(const Elm_Object_Item *it); /** - * Get the gengrid object's handle which contains a given gengrid item - * - * @param it The item to fetch the container from - * @return The gengrid (parent) object - * - * This returns the gengrid object itself that an item belongs to. - * - * @ingroup Gengrid - */ -EAPI Evas_Object *elm_gengrid_item_gengrid_get(const Elm_Object_Item *it); - -/** * Remove a gengrid item from its parent, deleting it. * * @param it The item to be removed. @@ -1044,41 +1032,6 @@ EAPI const Elm_Gengrid_Item_Class *elm_gengrid_item_item_class_get(const Elm_Obj EAPI void elm_gengrid_item_item_class_set(Elm_Object_Item *it, const Elm_Gengrid_Item_Class *gic); /** - * Return the data associated to a given gengrid item - * - * @param it The gengrid item. - * @return the data associated with this item. - * - * This returns the @c data value passed on the - * elm_gengrid_item_append() and related item addition calls. - * - * @see elm_gengrid_item_append() - * @see elm_gengrid_item_data_set() - * - * @ingroup Gengrid - */ -EAPI void *elm_gengrid_item_data_get(const Elm_Object_Item *it); - -/** - * Set the data associated with a given gengrid item - * - * @param it The gengrid item - * @param data The data pointer to set on it - * - * This @b overrides the @c data value passed on the - * elm_gengrid_item_append() and related item addition calls. This - * function @b won't call elm_gengrid_item_update() automatically, - * so you'd issue it afterwards if you want to have the item - * updated to reflect the new data. - * - * @see elm_gengrid_item_data_get() - * @see elm_gengrid_item_update() - * - * @ingroup Gengrid - */ -EAPI void elm_gengrid_item_data_set(Elm_Object_Item *it, const void *data); - -/** * Get a given gengrid item's position, relative to the whole * gengrid's grid area. * @@ -1142,7 +1095,7 @@ EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Objec * lower level callbacks for events on that object. Do not delete * this object under any circumstances. * - * @see elm_gengrid_item_data_get() + * @see elm_object_item_data_get() * * @ingroup Gengrid */ -- 2.7.4