[elementary] change API name from _scale_set to _resizable_set in

elm_image + elm_icon.


SVN revision: 68719
This commit is contained in:
WooHyun Jung 2012-03-05 13:36:01 +00:00
parent 35977ad0f7
commit 6009652735
11 changed files with 135 additions and 46 deletions

View File

@ -201,7 +201,7 @@ _activate(Evas_Object *obj)
if (item->icon_file) if (item->icon_file)
{ {
ic = elm_icon_add(obj); 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) if (item->icon_type == ELM_ICON_FILE)
elm_icon_file_set(ic, item->icon_file, item->icon_group); elm_icon_file_set(ic, item->icon_file, item->icon_group);
else if (item->icon_type == ELM_ICON_STANDARD) else if (item->icon_type == ELM_ICON_STANDARD)

View File

@ -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); 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);
/** /**
* @} * @}
*/ */

View File

@ -286,7 +286,7 @@ EAPI const Eina_List *elm_diskselector_items_get(const Evas_Object *obj);
* disk = elm_diskselector_add(win); * disk = elm_diskselector_add(win);
* ic = elm_icon_add(win); * ic = elm_icon_add(win);
* elm_icon_file_set(ic, "path/to/image", NULL); * 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); * elm_diskselector_item_append(disk, "label", ic, NULL, NULL);
* @endcode * @endcode
* *

View File

@ -891,26 +891,38 @@ elm_icon_no_scale_get(const Evas_Object *obj)
return wd->no_scale; 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_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); ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return; if (!wd) return;
wd->scale_up = scale_up; wd->scale_up = size_up;
wd->scale_down = scale_down; wd->scale_down = size_down;
if (!wd->in_eval) _sizing_eval(obj); if (!wd->in_eval) _sizing_eval(obj);
} }
EAPI void 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); ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return; if (!wd) return;
if (scale_up) *scale_up = wd->scale_up; if (size_up) *size_up = wd->scale_up;
if (scale_down) *scale_down = wd->scale_down; if (size_down) *size_down = wd->scale_down;
} }
EAPI void EAPI void

View File

@ -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 * This function disables scaling of the icon object through the function
* elm_object_scale_set(). However, this does not affect the object * elm_object_scale_set(). However, this does not affect the object
* size/resize in any way. For that effect, take a look at * 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_no_scale_get()
* @see elm_icon_scale_set() * @see elm_icon_resizable_set()
* @see elm_object_scale_set() * @see elm_object_scale_set()
* *
* @ingroup Icon * @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. * Set if the object is (up/down) resizeable.
* *
* @param obj The icon object * @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. * @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. * 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 * @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 * @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. * Get if the object is (up/down) resizeable.
* *
* @param obj The icon object * @param obj The icon object
* @param scale_up A bool to set if the object is resizeable up * @param size_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_down A bool to set if the object is resizeable down
* *
* @see elm_icon_scale_set() * @see elm_icon_resizable_set()
* *
* @ingroup Icon * @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 * Get the object's image size

View File

@ -211,26 +211,38 @@ elm_image_no_scale_get(const Evas_Object *obj)
return wd->no_scale; 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_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); ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return; if (!wd) return;
wd->scale_up = scale_up; wd->scale_up = size_up;
wd->scale_down = scale_down; wd->scale_down = size_down;
_sizing_eval(obj); _sizing_eval(obj);
} }
EAPI void 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); ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return; if (!wd) return;
if (scale_up) *scale_up = wd->scale_up; if (size_up) *size_up = wd->scale_up;
if (scale_down) *scale_down = wd->scale_down; if (size_down) *size_down = wd->scale_down;
} }
EAPI void EAPI void

View File

@ -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 * This function disables scaling of the elm_image widget through the
* function elm_object_scale_set(). However, this does not affect the widget * function elm_object_scale_set(). However, this does not affect the widget
* size/resize in any way. For that effect, take a look at * 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_no_scale_get()
* @see elm_image_scale_set() * @see elm_image_resizable_set()
* @see elm_object_scale_set() * @see elm_object_scale_set()
* *
* @ingroup Image * @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. * Set if the object is (up/down) resizeable.
* *
* @param obj The image object * @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. * @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. * 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 * @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 * @ingroup Image
*/ */
//XXX: elm_image_resizable_set EAPI void elm_image_resizable_set(Evas_Object *obj, Eina_Bool size_up, Eina_Bool size_down);
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. * Get if the object is (up/down) resizeable.
* *
* @param obj The image object * @param obj The image object
* @param scale_up A bool to set if the object is resizeable up * @param size_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_down A bool to set if the object is resizeable down
* *
* @see elm_image_scale_set() * @see elm_image_resizable_set()
* *
* @ingroup Image * @ingroup Image
*/ */
//XXX: elm_image_resizable_get EAPI void elm_image_resizable_get(const Evas_Object *obj, Eina_Bool *size_up, Eina_Bool *size_down);
EAPI void elm_image_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down);
/** /**
* Set if the image fills the entire object area, when keeping the aspect ratio. * Set if the image fills the entire object area, when keeping the aspect ratio.

View File

@ -363,7 +363,7 @@ EAPI void elm_list_scroller_policy_get(const Evas_Object
* li = elm_list_add(win); * li = elm_list_add(win);
* ic = elm_icon_add(win); * ic = elm_icon_add(win);
* elm_icon_file_set(ic, "path/to/image", NULL); * 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_item_append(li, "label", ic, NULL, NULL, NULL);
* elm_list_go(li); * elm_list_go(li);
* evas_object_show(li); * evas_object_show(li);

View File

@ -1974,7 +1974,7 @@ _icon_dup(Evas_Object *icon, Evas_Object *parent)
if (!icon || !parent) return NULL; if (!icon || !parent) return NULL;
// Evas_Object do not support object duplication?? // Evas_Object do not support object duplication??
const char *file = NULL, *group = NULL; 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); Evas_Object *dup = elm_icon_add(parent);
elm_icon_file_get(icon, &file, &group); 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_standard_set(dup, elm_icon_standard_get(icon));
elm_icon_order_lookup_set(dup, elm_icon_order_lookup_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_no_scale_set(dup, elm_icon_no_scale_get(icon));
elm_icon_scale_get(icon, &scale_up, &scale_down); elm_icon_resizable_get(icon, &size_up, &size_down);
elm_icon_scale_set(dup, scale_up, scale_down); elm_icon_resizable_set(dup, size_up, size_down);
elm_icon_fill_outside_set(dup, elm_icon_fill_outside_get(icon)); elm_icon_fill_outside_set(dup, elm_icon_fill_outside_get(icon));
elm_icon_prescale_set(dup, elm_icon_prescale_get(icon)); elm_icon_prescale_set(dup, elm_icon_prescale_get(icon));
elm_icon_aspect_fixed_set(dup, elm_icon_aspect_fixed_get(icon)); elm_icon_aspect_fixed_set(dup, elm_icon_aspect_fixed_get(icon));

View File

@ -96,7 +96,7 @@ EAPI Evas_Object *elm_segment_control_add(Evas_Object *parent);
* sc = elm_segment_control_add(win); * sc = elm_segment_control_add(win);
* ic = elm_icon_add(win); * ic = elm_icon_add(win);
* elm_icon_file_set(ic, "path/to/image", NULL); * 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"); * elm_segment_control_item_add(sc, ic, "label");
* evas_object_show(sc); * evas_object_show(sc);
* @endcode * @endcode

View File

@ -315,7 +315,7 @@ _store_item_content_get(void *data, Evas_Object *obj, const char *part)
m->details.icon.h); m->details.icon.h);
elm_icon_smooth_set(ic, m->details.icon.smooth); elm_icon_smooth_set(ic, m->details.icon.smooth);
elm_icon_no_scale_set(ic, m->details.icon.no_scale); 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_up,
m->details.icon.scale_down); m->details.icon.scale_down);
if (s) if (s)