From f532d324ed20556ff314392b201173bb5926d597 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Thu, 17 Nov 2011 00:42:14 +0000 Subject: [PATCH] elemlentary - minor changes. guarantee the compatibility for priveous content_set/get/unset changes. SVN revision: 65320 --- src/lib/Elementary.h.in | 17 ++++++++++------- src/lib/elc_player.c | 2 +- src/lib/elm_bg.c | 6 +++--- src/lib/elm_button.c | 6 +++--- src/lib/elm_check.c | 6 +++--- src/lib/elm_panes.c | 21 ++++++--------------- src/lib/elm_progressbar.c | 6 +++--- src/lib/elm_radio.c | 6 +++--- src/lib/elm_slider.c | 9 +++------ 9 files changed, 35 insertions(+), 44 deletions(-) diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 343e0c1..f661584 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -6923,7 +6923,7 @@ extern "C" { * elm_scroller_content_unset() function. * @deprecated use elm_object_content_set() instead */ - EINA_DEPRECATED EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child) EINA_ARG_NONNULL(1); + EINA_DEPRECATED EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child) EINA_ARG_NONNULL(1); /** * @brief Get the content of the scroller widget * @@ -7491,6 +7491,12 @@ extern "C" { * until the toggle is released by the cursor (assuming it * has been triggered by the cursor in the first place). * + * Default contents parts of the toggle widget that you can use for are: + * @li "icon" - A icon of the toggle + * + * Default text parts of the toggle widget that you can use for are: + * @li "elm.text" - Label of the toggle + * * @ref tutorial_toggle show how to use a toggle. * @{ */ @@ -7530,7 +7536,7 @@ extern "C" { * If you want to keep that old content object, use the * elm_toggle_icon_unset() function. * - * @deprecated use elm_object_content_set() instead. + * @deprecated use elm_object_content_part_set() instead. */ EINA_DEPRECATED EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); /** @@ -7543,7 +7549,7 @@ extern "C" { * * @see elm_toggle_icon_set() * - * @deprecated use elm_object_content_get() instead. + * @deprecated use elm_object_content_part_get() instead. */ EINA_DEPRECATED EAPI Evas_Object *elm_toggle_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); /** @@ -7556,7 +7562,7 @@ extern "C" { * * @see elm_toggle_icon_set() * - * @deprecated use elm_object_content_unset() instead. + * @deprecated use elm_object_content_part_unset() instead. */ EINA_DEPRECATED EAPI Evas_Object *elm_toggle_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** @@ -26676,12 +26682,9 @@ extern "C" { * you want to keep that old content object, use the * elm_ctxpopup_content_unset() function. * - * @deprecated use elm_object_content_set() - * * @warning Ctxpopup can't hold both a item list and a content at the same * time. When a content is set, any previous items will be removed. * - * * @deprecated use elm_object_content_set() instead * */ diff --git a/src/lib/elc_player.c b/src/lib/elc_player.c index e249954..a891dbf 100644 --- a/src/lib/elc_player.c +++ b/src/lib/elc_player.c @@ -456,7 +456,7 @@ _double_to_time(double value) static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { - if (!part || strcmp(part, "video")) return; + if (part && strcmp(part, "video")) return; #ifdef HAVE_EMOTION ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); diff --git a/src/lib/elm_bg.c b/src/lib/elm_bg.c index dd463e9..99d4157 100644 --- a/src/lib/elm_bg.c +++ b/src/lib/elm_bg.c @@ -122,7 +122,7 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; - if (!part || strcmp(part, "overlay")) return; + if (part && strcmp(part, "overlay")) return; wd = elm_widget_data_get(obj); if (!wd) return; @@ -146,7 +146,7 @@ _content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (!part || strcmp(part, "overlay")) return NULL; + if (part && strcmp(part, "overlay")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->overlay; @@ -158,7 +158,7 @@ _content_unset_hook(Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; Evas_Object *overlay; - if (!part || strcmp(part, "overlay")) return NULL; + if (part && strcmp(part, "overlay")) return NULL; wd = elm_widget_data_get(obj); if (!wd || !wd->overlay) return NULL; overlay = wd->overlay; diff --git a/src/lib/elm_button.c b/src/lib/elm_button.c index 9572cd2..81357f9 100644 --- a/src/lib/elm_button.c +++ b/src/lib/elm_button.c @@ -181,7 +181,7 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (!part || strcmp(part, "icon")) return; + if (part && strcmp(part, "icon")) return; if (wd->icon == content) return; if (wd->icon) evas_object_del(wd->icon); wd->icon = content; @@ -204,7 +204,7 @@ _content_get_hook(const Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (!part || strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -216,7 +216,7 @@ _content_unset_hook(Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (!part || strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; diff --git a/src/lib/elm_check.c b/src/lib/elm_check.c index cf7f8c6..daab8bc 100644 --- a/src/lib/elm_check.c +++ b/src/lib/elm_check.c @@ -212,7 +212,7 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; - if (strcmp(part, "icon")) return; + if (part && strcmp(part, "icon")) return; wd = elm_widget_data_get(obj); if (!wd) return; if (wd->icon == content) return; @@ -237,7 +237,7 @@ _content_get_hook(const Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -249,7 +249,7 @@ _content_unset_hook(Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; diff --git a/src/lib/elm_panes.c b/src/lib/elm_panes.c index b31d5cf..df702d6 100644 --- a/src/lib/elm_panes.c +++ b/src/lib/elm_panes.c @@ -274,12 +274,9 @@ static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - Widget_Data *wd; - - if (!part) return; - wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (!strcmp(part, "right")) + if (!part || !strcmp(part, "right")) _content_right_set(obj, content); else if(!strcmp(part, "left")) _content_left_set(obj, content); @@ -289,12 +286,9 @@ static Evas_Object * _content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd; - - if (!part) return NULL; - wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - if (!strcmp(part, "right")) + if (!part || !strcmp(part, "right")) return wd->contents.left; else if (!strcmp(part, "left")) return wd->contents.right; @@ -305,12 +299,9 @@ static Evas_Object * _content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - Widget_Data *wd; - - if (!part) return NULL; - wd = elm_widget_data_get(obj); + Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return NULL; - if (!strcmp(part, "right")) + if (!part || !strcmp(part, "right")) _content_right_unset(obj); else if (!strcmp(part, "left")) _content_left_unset(obj); diff --git a/src/lib/elm_progressbar.c b/src/lib/elm_progressbar.c index 9ada9fb..205455b 100644 --- a/src/lib/elm_progressbar.c +++ b/src/lib/elm_progressbar.c @@ -202,7 +202,7 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; - if (!part || strcmp(part, "icon")) return; + if (part && strcmp(part, "icon")) return; wd = elm_widget_data_get(obj); if (!wd) return; if (wd->icon == content) return; @@ -226,7 +226,7 @@ _content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (!part || strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -238,7 +238,7 @@ _content_unset_hook(Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; Evas_Object *icon; - if (!part || strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; diff --git a/src/lib/elm_radio.c b/src/lib/elm_radio.c index 3a3617d..391197d 100644 --- a/src/lib/elm_radio.c +++ b/src/lib/elm_radio.c @@ -304,7 +304,7 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd; - if (!part || strcmp(part, "icon")) return; + if (part && strcmp(part, "icon")) return; wd = elm_widget_data_get(obj); if (!wd) return; if (wd->icon == content) return; @@ -329,7 +329,7 @@ _content_get_hook(const Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (!part || strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; return wd->icon; @@ -341,7 +341,7 @@ _content_unset_hook(Evas_Object *obj, const char *part) ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; Evas_Object *icon; - if (!part || strcmp(part, "icon")) return NULL; + if (part && strcmp(part, "icon")) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; if (!wd->icon) return NULL; diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index 209dbe5..731ccd6 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -580,8 +580,7 @@ static void _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content) { ELM_CHECK_WIDTYPE(obj, widtype); - if (!part) return; - if (!strcmp(part, "icon")) + if (!part || !strcmp(part, "icon")) _icon_set(obj, content); else if (!strcmp(part, "end")) _end_set(obj, content); @@ -592,10 +591,9 @@ _content_get_hook(const Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; Widget_Data *wd; - if (!part) return NULL; wd = elm_widget_data_get(obj); if (!wd) return NULL; - if (!strcmp(part, "icon")) + if (!part || !strcmp(part, "icon")) return wd->icon; else if (!strcmp(part, "end")) return wd->end; @@ -606,8 +604,7 @@ static Evas_Object * _content_unset_hook(Evas_Object *obj, const char *part) { ELM_CHECK_WIDTYPE(obj, widtype) NULL; - if (!part) return NULL; - if (!strcmp(part, "icon")) + if (!part || !strcmp(part, "icon")) return _icon_unset(obj); else if (!strcmp(part, "end")) return _end_unset(obj); -- 2.7.4