EVAS_OBJ_IMAGE_SUB_ID_DATA_CONVERT,
EVAS_OBJ_IMAGE_SUB_ID_DATA_SET,
EVAS_OBJ_IMAGE_SUB_ID_DATA_GET,
- EVAS_OBJ_IMAGE_SUB_ID_PRELOAD,
+ EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_BEGIN,
+ EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_CANCEL,
EVAS_OBJ_IMAGE_SUB_ID_DATA_COPY_SET,
EVAS_OBJ_IMAGE_SUB_ID_DATA_UPDATE_ADD,
EVAS_OBJ_IMAGE_SUB_ID_ALPHA_SET,
#define evas_obj_image_smooth_scale_get(smooth_scale) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_SMOOTH_SCALE_GET), EO_TYPECHECK(Eina_Bool *, smooth_scale)
/**
- * @def evas_obj_image_preload
+ * @def evas_obj_image_preload_begin
* @since 1.8
*
- * Preload an image object's image data in the background
+ * Begin preloading an image object's image data in the background
+ *
+ * @see evas_object_image_preload
+ */
+#define evas_obj_image_preload_begin() EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_BEGIN)
+
+/**
+ * @def evas_obj_image_preload_cancel
+ * @since 1.8
*
- * @param[in] cancel in
+ * Cancel preloading an image object's image data in the background
*
* @see evas_object_image_preload
*/
-#define evas_obj_image_preload(cancel) EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD), EO_TYPECHECK(Eina_Bool, cancel)
+#define evas_obj_image_preload_cancel() EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_CANCEL)
/**
* @def evas_obj_image_reload
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
return ;
MAGIC_CHECK_END();
- eo_do(eo_obj, evas_obj_image_preload(cancel));
+ if (cancel)
+ eo_do(eo_obj, evas_obj_image_preload_cancel());
+ else
+ eo_do(eo_obj, evas_obj_image_preload_begin());
}
static void
-_image_preload(Eo *eo_obj, void *_pd, va_list *list)
+_image_preload_internal(Eo *eo_obj, void *_pd, Eina_Bool cancel)
{
Evas_Object_Image *o = _pd;
// FIXME: if already busy preloading, then dont request again until
// preload done
Evas_Object_Protected_Data *obj = eo_data_get(eo_obj, EVAS_OBJ_CLASS);
- Eina_Bool cancel = va_arg(*list, int);
if (cancel)
{
if (o->preloading)
}
}
+static void
+_image_preload_begin(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ _image_preload_internal(eo_obj, _pd, EINA_FALSE);
+}
+
+static void
+_image_preload_cancel(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
+{
+ _image_preload_internal(eo_obj, _pd, EINA_TRUE);
+}
+
EAPI void
evas_object_image_data_copy_set(Evas_Object *eo_obj, void *data)
{
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_DATA_CONVERT), _image_data_convert),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_DATA_SET), _image_data_set),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_DATA_GET), _image_data_get),
- EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD), _image_preload),
+ EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_BEGIN), _image_preload_begin),
+ EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_CANCEL), _image_preload_cancel),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_DATA_COPY_SET), _image_data_copy_set),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_DATA_UPDATE_ADD), _image_data_update_add),
EO_OP_FUNC(EVAS_OBJ_IMAGE_ID(EVAS_OBJ_IMAGE_SUB_ID_ALPHA_SET), _image_alpha_set),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_DATA_CONVERT, "Converts the raw image data of the given image object to the specified colorspace."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_DATA_SET, "Sets the raw image data of the given image object."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_DATA_GET, "Get a pointer to the raw image data of the given image object."),
- EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD, "Preload an image object's image data in the background."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_BEGIN, "Begin preload an image object's image data in the background."),
+ EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_PRELOAD_CANCEL, "Cancel preload an image object's image data in the background."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_DATA_COPY_SET, "Replaces the raw image data of the given image object."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_DATA_UPDATE_ADD, "Mark a sub-region of the given image object to be redrawn."),
EO_OP_DESCRIPTION(EVAS_OBJ_IMAGE_SUB_ID_ALPHA_SET, "Enable or disable alpha channel usage on the given image object."),