From 242fd686146965e50ea3371421df437626e28171 Mon Sep 17 00:00:00 2001 From: woohyun Date: Fri, 2 Mar 2012 08:56:32 +0000 Subject: [PATCH] elementary/elm_menu : Deprecated one API and modified test codes. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68619 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/test_menu.c | 5 +++-- src/examples/menu_example_01.c | 5 +++-- src/lib/elm_deprecated.h | 16 ++++++++++++++++ src/lib/elm_menu.c | 2 +- src/lib/elm_menu.h | 18 +----------------- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/bin/test_menu.c b/src/bin/test_menu.c index 60b1368..2f892fa 100644 --- a/src/bin/test_menu.c +++ b/src/bin/test_menu.c @@ -79,7 +79,7 @@ _populate_2(Elm_Object_Item *menu_it) static void _populate_1(Evas_Object *win, Elm_Object_Item *menu_it) { - Elm_Object_Item *menu_it2; + Elm_Object_Item *menu_it2, *menu_it3; Evas_Object *radio; radio = elm_radio_add(win); @@ -88,7 +88,8 @@ _populate_1(Evas_Object *win, Elm_Object_Item *menu_it) elm_object_text_set(radio, "radio in menu"); menu_it2 = elm_menu_item_add(menu, menu_it, "object-rotate-left", "menu 1", NULL, NULL); - elm_menu_item_add_object(menu, menu_it, radio, NULL, NULL); + menu_it3 = elm_menu_item_add(menu, menu_it, NULL, NULL, NULL, NULL); + elm_object_item_content_set(menu_it3, radio); _populate_2(menu_it2); } diff --git a/src/examples/menu_example_01.c b/src/examples/menu_example_01.c index 2dfd89d..5b33d47 100644 --- a/src/examples/menu_example_01.c +++ b/src/examples/menu_example_01.c @@ -28,7 +28,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win, *bg, *menu, *button, *rect; - Elm_Object_Item *menu_it; + Elm_Object_Item *menu_it, *menu_it1; win = elm_win_add(NULL, "menu", ELM_WIN_BASIC); elm_win_title_set(win, "Menu"); @@ -51,7 +51,8 @@ elm_main(int argc, char **argv) elm_menu_item_add(menu, menu_it, "object-rotate-left", "menu 1", NULL, NULL); button = elm_button_add(win); elm_object_text_set(button, "button - delete items"); - elm_menu_item_add_object(menu, menu_it, button, NULL, NULL); + menu_it1 = elm_menu_item_add(menu, menu_it, NULL, NULL, NULL, NULL); + elm_object_item_content_set(menu_it1, button); evas_object_smart_callback_add(button, "clicked", _del_it, menu); elm_menu_item_separator_add(menu, menu_it); elm_menu_item_add(menu, menu_it, NULL, "third item", NULL, NULL); diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h index a3e8615..e7e25cf 100644 --- a/src/lib/elm_deprecated.h +++ b/src/lib/elm_deprecated.h @@ -4565,5 +4565,21 @@ EINA_DEPRECATED EAPI Eina_Bool elm_web_history_enable_get(const Evas_Obj EINA_DEPRECATED EAPI void elm_web_history_enable_set(Evas_Object *obj, Eina_Bool enable); /** + * @brief Add an object swallowed in an item at the end of the given menu + * widget + * + * @param obj The menu object. + * @param parent The parent menu item (optional) + * @param subobj The object to swallow + * @param func Function called when the user select the item. + * @param data Data sent by the callback. + * @return Returns the new item. + * + * Add an evas object as an item to the menu. + * @deprecated please use "elm_menu_item_add" + "elm_object_item_content_set" instead. + */ +EINA_DEPRECATED EAPI Elm_Object_Item *elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data); + +/** * @} */ diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c index 00a9fb1..e4591cf 100644 --- a/src/lib/elm_menu.c +++ b/src/lib/elm_menu.c @@ -751,7 +751,7 @@ elm_menu_item_add(Evas_Object *obj, Elm_Object_Item *parent, const char *icon, c return (Elm_Object_Item *) subitem; } -EAPI Elm_Object_Item * +EINA_DEPRECATED EAPI Elm_Object_Item * elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data) { Elm_Menu_Item *subitem; diff --git a/src/lib/elm_menu.h b/src/lib/elm_menu.h index f212a09..0ba6726 100644 --- a/src/lib/elm_menu.h +++ b/src/lib/elm_menu.h @@ -112,26 +112,10 @@ EAPI Evas_Object *elm_menu_item_object_get(const Elm_Object_Item EAPI Elm_Object_Item *elm_menu_item_add(Evas_Object *obj, Elm_Object_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); /** - * @brief Add an object swallowed in an item at the end of the given menu - * widget - * - * @param obj The menu object. - * @param parent The parent menu item (optional) - * @param subobj The object to swallow - * @param func Function called when the user select the item. - * @param data Data sent by the callback. - * @return Returns the new item. - * - * Add an evas object as an item to the menu. - */ -//XXX: Any better API name? "_item_add_object" looks not good enough. -EAPI Elm_Object_Item *elm_menu_item_add_object(Evas_Object *obj, Elm_Object_Item *parent, Evas_Object *subobj, Evas_Smart_Cb func, const void *data); - -/** * @brief Set the icon of a menu item to the standard icon with name @p icon * * @param it The menu item object. - * @param icon The icon object to set for the content of @p item + * @param icon The name of icon object to set for the content of @p item * * Once this icon is set, any previously set icon will be deleted. */ -- 2.7.4