Elm.Image: Adapt to recent changes in Efl.Image

This commit is contained in:
Jean-Philippe Andre 2016-03-03 20:27:23 +09:00
parent bbffd68c0b
commit caa7039b2c
3 changed files with 55 additions and 38 deletions

View File

@ -1225,20 +1225,6 @@ _elm_image_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, const char
efl_file_get(sd->img, file, key);
}
EOLIAN static void
_elm_image_smooth_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool smooth)
{
sd->smooth = smooth;
elm_obj_image_sizing_eval(obj);
}
EOLIAN static Eina_Bool
_elm_image_smooth_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
{
return sd->smooth;
}
static Eina_Bool
_elm_image_efl_file_async_wait(const Eo *obj EINA_UNUSED, Elm_Image_Data *pd)
{
@ -1370,7 +1356,7 @@ elm_image_prescale_set(Evas_Object *obj,
}
EOLIAN static void
_elm_image_efl_image_load_size_set(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int w, int h)
_elm_image_efl_image_load_load_size_set(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int w, int h)
{
if (w > h)
sd->load_size = w;
@ -1389,7 +1375,7 @@ elm_image_prescale_get(const Evas_Object *obj)
}
EOLIAN static void
_elm_image_efl_image_load_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int *w, int *h)
_elm_image_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, int *w, int *h)
{
if (w) *w = sd->load_size;
if (h) *h = sd->load_size;
@ -1647,6 +1633,18 @@ _elm_image_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED
return &atspi_actions[0];
}
EAPI void
elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth)
{
efl_image_smooth_scale_set(obj, smooth);
elm_obj_image_sizing_eval(obj);
}
EAPI Eina_Bool
elm_image_smooth_get(const Evas_Object *obj)
{
return efl_image_smooth_scale_get(obj);
}
// A11Y - END

View File

@ -41,8 +41,8 @@ struct Elm.Image.Error
open_error: Eina.Bool;
}
class Elm.Image (Elm.Widget, Efl.File, Efl.Image, Evas.Clickable_Interface,
Edje.Object,
class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface,
Edje.Object, Efl.Image,
Elm.Interface_Atspi_Image, Elm.Interface_Atspi_Widget_Action,
Efl.Player)
{
@ -89,24 +89,6 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image, Evas.Clickable_Interface,
resize_up: bool; [[whether resizing up is allowed]]
}
}
@property smooth {
[[Control the smooth effect for an image.
Set the scaling algorithm to be used when scaling the image. Smooth
scaling provides a better resulting image, but is slower.
The smooth scaling should be disabled when making animations that change
the image size, since it will be faster. Animations that don't require
resizing of the image can keep the smooth scaling enabled (even if the
image is already scaled, since the scaled image will be cached).]]
set {
}
get {
}
values {
smooth: bool; [[$true if smooth scaling should be used, $false otherwise. Default is $true.]]
}
}
@property no_scale {
[[Control scaling behaviour of this object.
@ -317,8 +299,8 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image, Evas.Clickable_Interface,
Efl.File.async.set;
Efl.File.async.get;
Efl.File.async_wait;
Efl.Image.load_size.set;
Efl.Image.load_size.get;
Efl.Image_Load.load_size.set;
Efl.Image_Load.load_size.get;
Efl.Image.smooth_scale.set;
Efl.Image.smooth_scale.get;
Efl.Player.playable.get;

View File

@ -112,6 +112,43 @@ EAPI int elm_image_prescale_get(const Evas_Object *obj);
*/
EAPI Eina_Bool elm_image_mmap_set(Evas_Object *obj, const Eina_File *file, const char *group);
/**
* @brief Control the smooth effect for an image.
*
* Set the scaling algorithm to be used when scaling the image. Smooth scaling
* provides a better resulting image, but is slower.
*
* The smooth scaling should be disabled when making animations that change the
* image size, since it will be faster. Animations that don't require resizing
* of the image can keep the smooth scaling enabled (even if the image is
* already scaled, since the scaled image will be cached).
*
* @param[in] smooth @c true if smooth scaling should be used, @c false
* otherwise. Default is @c true.
*
* @ingroup Elm_Image
*/
EAPI void elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth);
/**
* @brief Get the smooth effect for an image.
*
* Get the scaling algorithm to be used when scaling the image. Smooth scaling
* provides a better resulting image, but is slower.
*
* The smooth scaling should be disabled when making animations that change the
* image size, since it will be faster. Animations that don't require resizing
* of the image can keep the smooth scaling enabled (even if the image is
* already scaled, since the scaled image will be cached).
*
* @return @c true if smooth scaling should be used, @c false otherwise.
* Default is @c true.
*
* @ingroup Elm_Image
*/
EAPI Eina_Bool elm_image_smooth_get(const Evas_Object *obj);
/**
* Start or stop an image object's animation.
*