From 6009652735d8954ee335307023e3b86f0d3f5ec5 Mon Sep 17 00:00:00 2001 From: WooHyun Jung 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. SVN revision: 68719 --- legacy/elementary/src/lib/elc_hoversel.c | 2 +- legacy/elementary/src/lib/elm_deprecated.h | 67 +++++++++++++++++++ legacy/elementary/src/lib/elm_diskselector.h | 2 +- legacy/elementary/src/lib/elm_icon.c | 24 +++++-- legacy/elementary/src/lib/elm_icon.h | 24 +++---- legacy/elementary/src/lib/elm_image.c | 24 +++++-- legacy/elementary/src/lib/elm_image.h | 26 ++++--- legacy/elementary/src/lib/elm_list.h | 2 +- legacy/elementary/src/lib/elm_map.c | 6 +- .../elementary/src/lib/elm_segment_control.h | 2 +- legacy/elementary/src/lib/elm_store.c | 2 +- 11 files changed, 135 insertions(+), 46 deletions(-) diff --git a/legacy/elementary/src/lib/elc_hoversel.c b/legacy/elementary/src/lib/elc_hoversel.c index cd5743d825..779fb24597 100644 --- a/legacy/elementary/src/lib/elc_hoversel.c +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_deprecated.h b/legacy/elementary/src/lib/elm_deprecated.h index 5a9add8786..4eeae63acd 100644 --- a/legacy/elementary/src/lib/elm_deprecated.h +++ b/legacy/elementary/src/lib/elm_deprecated.h @@ -4784,6 +4784,73 @@ 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/legacy/elementary/src/lib/elm_diskselector.h b/legacy/elementary/src/lib/elm_diskselector.h index adfa256d9a..2522decb34 100644 --- a/legacy/elementary/src/lib/elm_diskselector.h +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_icon.c b/legacy/elementary/src/lib/elm_icon.c index 75bdfc7493..d34fd04c3f 100644 --- a/legacy/elementary/src/lib/elm_icon.c +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_icon.h b/legacy/elementary/src/lib/elm_icon.h index 8abdba2906..0e835ed610 100644 --- a/legacy/elementary/src/lib/elm_icon.h +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_image.c b/legacy/elementary/src/lib/elm_image.c index 18bdc80b95..d586d92f6c 100644 --- a/legacy/elementary/src/lib/elm_image.c +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_image.h b/legacy/elementary/src/lib/elm_image.h index c8a0c6905c..fe37a88f46 100644 --- a/legacy/elementary/src/lib/elm_image.h +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_list.h b/legacy/elementary/src/lib/elm_list.h index b348b2bdb0..43f23be04b 100644 --- a/legacy/elementary/src/lib/elm_list.h +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_map.c b/legacy/elementary/src/lib/elm_map.c index 0c90c6d822..bc46a7a615 100644 --- a/legacy/elementary/src/lib/elm_map.c +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_segment_control.h b/legacy/elementary/src/lib/elm_segment_control.h index e7e695380f..45f5c6f38e 100644 --- a/legacy/elementary/src/lib/elm_segment_control.h +++ b/legacy/elementary/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/legacy/elementary/src/lib/elm_store.c b/legacy/elementary/src/lib/elm_store.c index 61e1548c8b..720056b350 100644 --- a/legacy/elementary/src/lib/elm_store.c +++ b/legacy/elementary/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)