From 32a89141b45b81b00ba7f1978ccf923f771a1933 Mon Sep 17 00:00:00 2001 From: woohyun Date: Mon, 5 Mar 2012 13:36:01 +0000 Subject: [PATCH] [elementary] change API name from _scale_set to _resizable_set in elm_image + elm_icon. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@68719 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elc_hoversel.c | 2 +- src/lib/elm_deprecated.h | 67 +++++++++++++++++++++++++++++++++++++++++++ src/lib/elm_diskselector.h | 2 +- src/lib/elm_icon.c | 24 ++++++++++++---- src/lib/elm_icon.h | 24 ++++++++-------- src/lib/elm_image.c | 24 ++++++++++++---- src/lib/elm_image.h | 26 ++++++++--------- src/lib/elm_list.h | 2 +- src/lib/elm_map.c | 6 ++-- src/lib/elm_segment_control.h | 2 +- src/lib/elm_store.c | 2 +- 11 files changed, 135 insertions(+), 46 deletions(-) diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index cd5743d..779fb24 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -201,7 +201,7 @@ _activate(Evas_Object *obj) if (item->icon_file) { ic = elm_icon_add(obj); - elm_icon_scale_set(ic, 0, 1); + elm_icon_resizable_set(ic, EINA_FALSE, EINA_TRUE); if (item->icon_type == ELM_ICON_FILE) elm_icon_file_set(ic, item->icon_file, item->icon_group); else if (item->icon_type == ELM_ICON_STANDARD) diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h index 5a9add8..4eeae63 100644 --- a/src/lib/elm_deprecated.h +++ b/src/lib/elm_deprecated.h @@ -4785,5 +4785,72 @@ EINA_DEPRECATED EAPI void elm_theme_all_set(const char *theme); EINA_DEPRECATED EAPI Evas_Object *elm_conformant_content_area_get(const Evas_Object *obj); /** + * Set if the object is (up/down) resizeable. + * + * @param obj The image object + * @param scale_up A bool to set if the object is resizeable up. Default is + * @c EINA_TRUE. + * @param scale_down A bool to set if the object is resizeable down. Default + * is @c EINA_TRUE. + * + * This function limits the image resize ability. If @p scale_up is set to + * @c EINA_FALSE, the object can't have its height or width resized to a value + * higher than the original image size. Same is valid for @p scale_down. + * + * @see elm_image_scale_get() + * @deprecated Please use elm_image_resizable_set() + * + * @ingroup Image + */ +EINA_DEPRECATED EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down); + +/** + * Get if the object is (up/down) resizeable. + * + * @param obj The image object + * @param scale_up A bool to set if the object is resizeable up + * @param scale_down A bool to set if the object is resizeable down + * + * @see elm_image_scale_set() + * @deprecated Please use elm_image_resizable_get() + * + * @ingroup Image + */ +EINA_DEPRECATED EAPI void elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down); + +/** + * Set if the object is (up/down) resizeable. + * + * @param obj The icon object + * @param scale_up A bool to set if the object is resizeable up. Default is + * @c EINA_TRUE. + * @param scale_down A bool to set if the object is resizeable down. Default + * is @c EINA_TRUE. + * + * This function limits the icon object resize ability. If @p scale_up is set to + * @c EINA_FALSE, the object can't have its height or width resized to a value + * higher than the original icon size. Same is valid for @p scale_down. + * + * @see elm_icon_scale_get() + * @deprecated Please use elm_icon_resizable_set() + * + * @ingroup Icon + */ +EINA_DEPRECATED EAPI void elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down); + +/** + * Get if the object is (up/down) resizeable. + * + * @param obj The icon object + * @param scale_up A bool to set if the object is resizeable up + * @param scale_down A bool to set if the object is resizeable down + * + * @see elm_icon_scale_set() + * @deprecated Please use elm_icon_resizable_get() + * + * @ingroup Icon + */ +EINA_DEPRECATED EAPI void elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down); +/** * @} */ diff --git a/src/lib/elm_diskselector.h b/src/lib/elm_diskselector.h index adfa256..2522dec 100644 --- a/src/lib/elm_diskselector.h +++ b/src/lib/elm_diskselector.h @@ -286,7 +286,7 @@ EAPI const Eina_List *elm_diskselector_items_get(const Evas_Object *obj); * disk = elm_diskselector_add(win); * ic = elm_icon_add(win); * elm_icon_file_set(ic, "path/to/image", NULL); - * elm_icon_scale_set(ic, EINA_TRUE, EINA_TRUE); + * elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE); * elm_diskselector_item_append(disk, "label", ic, NULL, NULL); * @endcode * diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c index 75bdfc7..d34fd04 100644 --- a/src/lib/elm_icon.c +++ b/src/lib/elm_icon.c @@ -891,26 +891,38 @@ elm_icon_no_scale_get(const Evas_Object *obj) return wd->no_scale; } -EAPI void +EINA_DEPRECATED EAPI void elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) { + elm_icon_resizable_set(obj, scale_up, scale_down); +} + +EINA_DEPRECATED EAPI void +elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) +{ + elm_icon_resizable_get(obj, scale_up, scale_down); +} + +EAPI void +elm_icon_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down) +{ ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - wd->scale_up = scale_up; - wd->scale_down = scale_down; + wd->scale_up = size_up; + wd->scale_down = size_down; if (!wd->in_eval) _sizing_eval(obj); } EAPI void -elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) +elm_icon_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (scale_up) *scale_up = wd->scale_up; - if (scale_down) *scale_down = wd->scale_down; + if (size_up) *size_up = wd->scale_up; + if (size_down) *size_down = wd->scale_down; } EAPI void diff --git a/src/lib/elm_icon.h b/src/lib/elm_icon.h index 8abdba2..0e835ed 100644 --- a/src/lib/elm_icon.h +++ b/src/lib/elm_icon.h @@ -271,10 +271,10 @@ EAPI Eina_Bool elm_icon_smooth_get(const Evas_Object *obj); * This function disables scaling of the icon object through the function * elm_object_scale_set(). However, this does not affect the object * size/resize in any way. For that effect, take a look at - * elm_icon_scale_set(). + * elm_icon_resizable_set(). * * @see elm_icon_no_scale_get() - * @see elm_icon_scale_set() + * @see elm_icon_resizable_set() * @see elm_object_scale_set() * * @ingroup Icon @@ -297,33 +297,33 @@ EAPI Eina_Bool elm_icon_no_scale_get(const Evas_Object *obj); * Set if the object is (up/down) resizeable. * * @param obj The icon object - * @param scale_up A bool to set if the object is resizeable up. Default is + * @param size_up A bool to set if the object is resizeable up. Default is * @c EINA_TRUE. - * @param scale_down A bool to set if the object is resizeable down. Default + * @param size_down A bool to set if the object is resizeable down. Default * is @c EINA_TRUE. * - * This function limits the icon object resize ability. If @p scale_up is set to + * This function limits the icon object resize ability. If @p size_up is set to * @c EINA_FALSE, the object can't have its height or width resized to a value - * higher than the original icon size. Same is valid for @p scale_down. + * higher than the original icon size. Same is valid for @p size_down. * - * @see elm_icon_scale_get() + * @see elm_icon_resizable_get() * * @ingroup Icon */ -EAPI void elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down); +EAPI void elm_icon_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down); /** * Get if the object is (up/down) resizeable. * * @param obj The icon object - * @param scale_up A bool to set if the object is resizeable up - * @param scale_down A bool to set if the object is resizeable down + * @param size_up A bool to set if the object is resizeable up + * @param size_down A bool to set if the object is resizeable down * - * @see elm_icon_scale_set() + * @see elm_icon_resizable_set() * * @ingroup Icon */ -EAPI void elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down); +EAPI void elm_icon_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down); /** * Get the object's image size diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c index 18bdc80..d586d92 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -211,26 +211,38 @@ elm_image_no_scale_get(const Evas_Object *obj) return wd->no_scale; } -EAPI void +EINA_DEPRECATED EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down) { + elm_image_resizable_set(obj, scale_up, scale_down); +} + +EINA_DEPRECATED EAPI void +elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) +{ + elm_image_resizable_get(obj, scale_up, scale_down); +} + +EAPI void +elm_image_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down) +{ ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - wd->scale_up = scale_up; - wd->scale_down = scale_down; + wd->scale_up = size_up; + wd->scale_down = size_down; _sizing_eval(obj); } EAPI void -elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down) +elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (scale_up) *scale_up = wd->scale_up; - if (scale_down) *scale_down = wd->scale_down; + if (size_up) *size_up = wd->scale_up; + if (size_down) *size_down = wd->scale_down; } EAPI void diff --git a/src/lib/elm_image.h b/src/lib/elm_image.h index c8a0c69..fe37a88 100644 --- a/src/lib/elm_image.h +++ b/src/lib/elm_image.h @@ -148,10 +148,10 @@ EAPI void elm_image_object_size_get(const Evas_Object *obj, int *w, * This function disables scaling of the elm_image widget through the * function elm_object_scale_set(). However, this does not affect the widget * size/resize in any way. For that effect, take a look at - * elm_image_scale_set(). + * elm_image_resizable_set(). * * @see elm_image_no_scale_get() - * @see elm_image_scale_set() + * @see elm_image_resizable_set() * @see elm_object_scale_set() * * @ingroup Image @@ -174,35 +174,33 @@ EAPI Eina_Bool elm_image_no_scale_get(const Evas_Object *obj); * Set if the object is (up/down) resizeable. * * @param obj The image object - * @param scale_up A bool to set if the object is resizeable up. Default is + * @param size_up A bool to set if the object is resizeable up. Default is * @c EINA_TRUE. - * @param scale_down A bool to set if the object is resizeable down. Default + * @param size_down A bool to set if the object is resizeable down. Default * is @c EINA_TRUE. * - * This function limits the image resize ability. If @p scale_up is set to + * This function limits the image resize ability. If @p size_up is set to * @c EINA_FALSE, the object can't have its height or width resized to a value - * higher than the original image size. Same is valid for @p scale_down. + * higher than the original image size. Same is valid for @p size_down. * - * @see elm_image_scale_get() + * @see elm_image_resizable_get() * * @ingroup Image */ -//XXX: elm_image_resizable_set -EAPI void elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down); +EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down); /** * Get if the object is (up/down) resizeable. * * @param obj The image object - * @param scale_up A bool to set if the object is resizeable up - * @param scale_down A bool to set if the object is resizeable down + * @param size_up A bool to set if the object is resizeable up + * @param size_down A bool to set if the object is resizeable down * - * @see elm_image_scale_set() + * @see elm_image_resizable_set() * * @ingroup Image */ -//XXX: elm_image_resizable_get -EAPI void elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down); +EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down); /** * Set if the image fills the entire object area, when keeping the aspect ratio. diff --git a/src/lib/elm_list.h b/src/lib/elm_list.h index b348b2b..43f23be 100644 --- a/src/lib/elm_list.h +++ b/src/lib/elm_list.h @@ -363,7 +363,7 @@ EAPI void elm_list_scroller_policy_get(const Evas_Object * li = elm_list_add(win); * ic = elm_icon_add(win); * elm_icon_file_set(ic, "path/to/image", NULL); - * elm_icon_scale_set(ic, EINA_TRUE, EINA_TRUE); + * elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE); * elm_list_item_append(li, "label", ic, NULL, NULL, NULL); * elm_list_go(li); * evas_object_show(li); diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 0c90c6d..bc46a7a 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -1974,7 +1974,7 @@ _icon_dup(Evas_Object *icon, Evas_Object *parent) if (!icon || !parent) return NULL; // Evas_Object do not support object duplication?? const char *file = NULL, *group = NULL; - Eina_Bool scale_up, scale_down; + Eina_Bool size_up, size_down; Evas_Object *dup = elm_icon_add(parent); elm_icon_file_get(icon, &file, &group); @@ -1984,8 +1984,8 @@ _icon_dup(Evas_Object *icon, Evas_Object *parent) elm_icon_standard_set(dup, elm_icon_standard_get(icon)); elm_icon_order_lookup_set(dup, elm_icon_order_lookup_get(icon)); elm_icon_no_scale_set(dup, elm_icon_no_scale_get(icon)); - elm_icon_scale_get(icon, &scale_up, &scale_down); - elm_icon_scale_set(dup, scale_up, scale_down); + elm_icon_resizable_get(icon, &size_up, &size_down); + elm_icon_resizable_set(dup, size_up, size_down); elm_icon_fill_outside_set(dup, elm_icon_fill_outside_get(icon)); elm_icon_prescale_set(dup, elm_icon_prescale_get(icon)); elm_icon_aspect_fixed_set(dup, elm_icon_aspect_fixed_get(icon)); diff --git a/src/lib/elm_segment_control.h b/src/lib/elm_segment_control.h index e7e6953..45f5c6f 100644 --- a/src/lib/elm_segment_control.h +++ b/src/lib/elm_segment_control.h @@ -96,7 +96,7 @@ EAPI Evas_Object *elm_segment_control_add(Evas_Object *parent); * sc = elm_segment_control_add(win); * ic = elm_icon_add(win); * elm_icon_file_set(ic, "path/to/image", NULL); - * elm_icon_scale_set(ic, EINA_TRUE, EINA_TRUE); + * elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE); * elm_segment_control_item_add(sc, ic, "label"); * evas_object_show(sc); * @endcode diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c index 61e1548..720056b 100644 --- a/src/lib/elm_store.c +++ b/src/lib/elm_store.c @@ -315,7 +315,7 @@ _store_item_content_get(void *data, Evas_Object *obj, const char *part) m->details.icon.h); elm_icon_smooth_set(ic, m->details.icon.smooth); elm_icon_no_scale_set(ic, m->details.icon.no_scale); - elm_icon_scale_set(ic, + elm_icon_resizable_set(ic, m->details.icon.scale_up, m->details.icon.scale_down); if (s) -- 2.7.4