forked from enlightenment/efl
Elm_image: move preload_disabled API from eo to legacy.
This commit is contained in:
parent
5be49ace8f
commit
66b9884ab3
|
@ -1230,28 +1230,6 @@ _elm_image_resizable_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool *siz
|
|||
if (size_down) *size_down = sd->resize_down;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_image_preload_disabled_set(Eo *obj EINA_UNUSED, Elm_Image_Data *sd, Eina_Bool disable)
|
||||
{
|
||||
if (sd->edje || !sd->img) return;
|
||||
|
||||
if (disable)
|
||||
{
|
||||
if (sd->preload_status == ELM_IMAGE_PRELOADING)
|
||||
{
|
||||
evas_object_image_preload(sd->img, disable);
|
||||
if (sd->show) evas_object_show(sd->img);
|
||||
ELM_SAFE_FREE(sd->prev_img, evas_object_del);
|
||||
}
|
||||
sd->preload_status = ELM_IMAGE_PRELOAD_DISABLED;
|
||||
}
|
||||
else if (sd->preload_status == ELM_IMAGE_PRELOAD_DISABLED)
|
||||
{
|
||||
sd->preload_status = ELM_IMAGE_PRELOADING;
|
||||
evas_object_image_preload(sd->img, disable);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_image_prescale_set(Evas_Object *obj,
|
||||
int size)
|
||||
|
@ -1668,4 +1646,30 @@ elm_image_fill_outside_get(const Evas_Object *obj)
|
|||
return !sd->fill_inside;
|
||||
}
|
||||
|
||||
// TODO: merge preload and async code
|
||||
EAPI void
|
||||
elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disable)
|
||||
{
|
||||
ELM_IMAGE_CHECK(obj);
|
||||
ELM_IMAGE_DATA_GET(obj, sd);
|
||||
|
||||
if (sd->edje || !sd->img) return;
|
||||
|
||||
if (disable)
|
||||
{
|
||||
if (sd->preload_status == ELM_IMAGE_PRELOADING)
|
||||
{
|
||||
evas_object_image_preload(sd->img, disable);
|
||||
if (sd->show) evas_object_show(sd->img);
|
||||
ELM_SAFE_FREE(sd->prev_img, evas_object_del);
|
||||
}
|
||||
sd->preload_status = ELM_IMAGE_PRELOAD_DISABLED;
|
||||
}
|
||||
else if (sd->preload_status == ELM_IMAGE_PRELOAD_DISABLED)
|
||||
{
|
||||
sd->preload_status = ELM_IMAGE_PRELOADING;
|
||||
evas_object_image_preload(sd->img, disable);
|
||||
}
|
||||
}
|
||||
|
||||
#include "elm_image.eo.c"
|
||||
|
|
|
@ -155,14 +155,6 @@ class Elm.Image (Elm.Widget, Efl.File, Efl.Image_Load, Evas.Clickable_Interface,
|
|||
down: bool; [[A bool to set if the object is resizable down. Default is $true.]]
|
||||
}
|
||||
}
|
||||
@property preload_disabled {
|
||||
set {
|
||||
[[Enable or disable preloading of the image]]
|
||||
}
|
||||
values {
|
||||
disabled: bool; [[If true, preloading will be disabled]]
|
||||
}
|
||||
}
|
||||
@property object {
|
||||
get {
|
||||
[[Get the inlined image object of the image widget.
|
||||
|
|
|
@ -365,4 +365,13 @@ EAPI void elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside);
|
|||
*/
|
||||
EAPI Eina_Bool elm_image_fill_outside_get(const Evas_Object *obj);
|
||||
|
||||
/**
|
||||
* @brief Enable or disable preloading of the image
|
||||
*
|
||||
* @param[in] disabled If true, preloading will be disabled
|
||||
*
|
||||
* @ingroup Elm_Image
|
||||
*/
|
||||
|
||||
EAPI void elm_image_preload_disabled_set(Evas_Object *obj, Eina_Bool disabled);
|
||||
#include "elm_image.eo.legacy.h"
|
||||
|
|
Loading…
Reference in New Issue