From 334db738666e3c3140b8160e646f11feb40eeb22 Mon Sep 17 00:00:00 2001 From: Yossi Kantor Date: Thu, 3 Apr 2014 14:07:33 +0300 Subject: [PATCH] Eolian: Legacy integration of Evas Image --- src/Makefile_Evas.am | 4 +- src/lib/evas/Evas_Legacy.h | 1207 +------------------------------------ src/lib/evas/canvas/evas_image.eo | 2 + 3 files changed, 25 insertions(+), 1188 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 11db9a5..0f07f7c 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -44,6 +44,7 @@ BUILT_SOURCES += \ lib/evas/canvas/evas_grid.eo.legacy.h \ lib/evas/canvas/evas_image.eo.c \ lib/evas/canvas/evas_image.eo.h \ + lib/evas/canvas/evas_image.eo.legacy.h \ lib/evas/canvas/evas_out.eo.c \ lib/evas/canvas/evas_out.eo.h \ lib/evas/canvas/evas_draggable_interface.eo.c \ @@ -135,7 +136,8 @@ nodist_installed_evascanvasheaders_DATA = \ lib/evas/canvas/evas_table.eo.legacy.h \ lib/evas/canvas/evas_common_interface.eo.legacy.h \ lib/evas/canvas/evas_object.eo.legacy.h \ - lib/evas/canvas/evas_grid.eo.legacy.h + lib/evas/canvas/evas_grid.eo.legacy.h \ + lib/evas/canvas/evas_image.eo.legacy.h noinst_HEADERS = \ lib/evas/include/evas_inline.x \ diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 56a21c5..b5fda0b 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -2597,526 +2597,15 @@ EAPI Evas_Object *evas_object_image_filled_add(Evas *e) EINA_WA EAPI void evas_object_image_memfile_set(Evas_Object *obj, void *data, int size, char *format, char *key) EINA_ARG_NONNULL(1, 2); /** - * Set the source file from where an image object must fetch the real - * image data (it may be an Eet file, besides pure image ones). - * - * @param obj The given image object. - * @param file The image file path. - * @param key The image key in @p file (if its an Eet one), or @c - * NULL, otherwise. - * - * If the file supports multiple data stored in it (as Eet files do), - * you can specify the key to be used as the index of the image in - * this file. - * - * Example: - * @code - * img = evas_object_image_add(canvas); - * evas_object_image_file_set(img, "/path/to/img", NULL); - * err = evas_object_image_load_error_get(img); - * if (err != EVAS_LOAD_ERROR_NONE) - * { - * fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n", - * valid_path, evas_load_error_str(err)); - * } - * else - * { - * evas_object_image_fill_set(img, 0, 0, w, h); - * evas_object_resize(img, w, h); - * evas_object_show(img); - * } - * @endcode - */ -EAPI void evas_object_image_file_set(Evas_Object *obj, const char *file, const char *key) EINA_ARG_NONNULL(1); - -/** - * Set the source mmaped file from where an image object must fetch the real - * image data (it must be an Eina_File). - * - * @param obj The given image object. - * @param f The mmaped file - * @param key The image key in @p file (if its an Eet one), or @c - * NULL, otherwise. - * - * If the file supports multiple data stored in it (as Eet files do), - * you can specify the key to be used as the index of the image in - * this file. - * - * @since 1.8 - */ -EAPI void evas_object_image_mmap_set(Evas_Object *obj, const Eina_File *f, const char *key); - -/** - * Get the source mmaped file from where an image object must fetch the real - * image data (it must be an Eina_File). - * - * @param obj The given image object. - * @param f The mmaped file - * @param key The image key in @p file (if its an Eet one), or @c - * NULL, otherwise. - * - * If the file supports multiple data stored in it (as Eet files do), - * you can get the key to be used as the index of the image in - * this file. - * - * @since 1.10 - */ -EAPI void evas_object_image_mmap_get(const Evas_Object *obj, const Eina_File **f, const char **key); - -/** - * Retrieve the source file from where an image object is to fetch the - * real image data (it may be an Eet file, besides pure image ones). - * - * @param obj The given image object. - * @param file Location to store the image file path. - * @param key Location to store the image key (if @p file is an Eet - * one). - * - * You must @b not modify the strings on the returned pointers. - * - * @note Use @c NULL pointers on the file components you're not - * interested in: they'll be ignored by the function. - */ -EAPI void evas_object_image_file_get(const Evas_Object *obj, const char **file, const char **key) EINA_ARG_NONNULL(1); - -/** - * Set the dimensions for an image object's border, a region which @b - * won't ever be scaled together with its center. - * - * @param obj The given image object. - * @param l The border's left width. - * @param r The border's right width. - * @param t The border's top width. - * @param b The border's bottom width. - * - * When Evas is rendering, an image source may be scaled to fit the - * size of its image object. This function sets an area from the - * borders of the image inwards which is @b not to be scaled. This - * function is useful for making frames and for widget theming, where, - * for example, buttons may be of varying sizes, but their border size - * must remain constant. - * - * The units used for @p l, @p r, @p t and @p b are canvas units. - * - * @note The border region itself @b may be scaled by the - * evas_object_image_border_scale_set() function. - * - * @note By default, image objects have no borders set, i. e. @c l, @c - * r, @c t and @c b start as @c 0. - * - * See the following figures for visual explanation:\n - * @htmlonly - * - * Full-size - * @endhtmlonly - * @image rtf image-borders.png - * @image latex image-borders.eps width=\textwidth - * @htmlonly - * - * Full-size - * @endhtmlonly - * @image rtf border-effect.png - * @image latex border-effect.eps width=\textwidth - * - * @see evas_object_image_border_get() - * @see evas_object_image_border_center_fill_set() - */ -EAPI void evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b) EINA_ARG_NONNULL(1); - -/** - * Retrieve the dimensions for an image object's border, a region - * which @b won't ever be scaled together with its center. - * - * @param obj The given image object. - * @param l Location to store the border's left width in. - * @param r Location to store the border's right width in. - * @param t Location to store the border's top width in. - * @param b Location to store the border's bottom width in. - * - * @note Use @c NULL pointers on the border components you're not - * interested in: they'll be ignored by the function. - * - * See @ref evas_object_image_border_set() for more details. - */ -EAPI void evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) EINA_ARG_NONNULL(1); - -/** - * Sets @b how the center part of the given image object (not the - * borders) should be drawn when Evas is rendering it. - * - * @param obj The given image object. - * @param fill Fill mode of the center region of @p obj (a value in - * #Evas_Border_Fill_Mode). - * - * This function sets how the center part of the image object's source - * image is to be drawn, which must be one of the values in - * #Evas_Border_Fill_Mode. By center we mean the complementary part of - * that defined by evas_object_image_border_set(). This one is very - * useful for making frames and decorations. You would most probably - * also be using a filled image (as in evas_object_image_filled_set()) - * to use as a frame. - * - * @see evas_object_image_border_center_fill_get() - */ -EAPI void evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill) EINA_ARG_NONNULL(1); - -/** - * Retrieves @b how the center part of the given image object (not the - * borders) is to be drawn when Evas is rendering it. - * - * @param obj The given image object. - * @return fill Fill mode of the center region of @p obj (a value in - * #Evas_Border_Fill_Mode). - * - * See @ref evas_object_image_fill_set() for more details. - */ -EAPI Evas_Border_Fill_Mode evas_object_image_border_center_fill_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Set whether the image object's fill property should track the - * object's size. - * - * @param obj The given image object. - * @param setting @c EINA_TRUE, to make the fill property follow - * object size or @c EINA_FALSE, otherwise. - * - * If @p setting is @c EINA_TRUE, then every evas_object_resize() will - * @b automatically trigger a call to evas_object_image_fill_set() - * with the that new size (and @c 0, @c 0 as source image's origin), - * so the bound image will fill the whole object's area. - * - * @see evas_object_image_filled_add() - * @see evas_object_image_fill_get() - */ -EAPI void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1); - -/** - * Retrieve whether the image object's fill property should track the - * object's size. - * - * @param obj The given image object. - * @return @c EINA_TRUE if it is tracking, @c EINA_FALSE, if not (and - * evas_object_fill_set() must be called manually). - * - * @see evas_object_image_filled_set() for more information - */ -EAPI Eina_Bool evas_object_image_filled_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Sets the scaling factor (multiplier) for the borders of an image - * object. - * - * @param obj The given image object. - * @param scale The scale factor (default is @c 1.0 - i.e. no scaling) - * - * @see evas_object_image_border_set() - * @see evas_object_image_border_scale_get() - */ -EAPI void evas_object_image_border_scale_set(Evas_Object *obj, double scale); - -/** - * Retrieves the scaling factor (multiplier) for the borders of an - * image object. - * - * @param obj The given image object. - * @return The scale factor set for its borders - * - * @see evas_object_image_border_set() - * @see evas_object_image_border_scale_set() - */ -EAPI double evas_object_image_border_scale_get(const Evas_Object *obj); - -/** - * Set how to fill an image object's drawing rectangle given the - * (real) image bound to it. - * - * @param obj The given image object to operate on. - * @param x The x coordinate (from the top left corner of the bound - * image) to start drawing from. - * @param y The y coordinate (from the top left corner of the bound - * image) to start drawing from. - * @param w The width the bound image will be displayed at. - * @param h The height the bound image will be displayed at. - * - * Note that if @p w or @p h are smaller than the dimensions of - * @p obj, the displayed image will be @b tiled around the object's - * area. To have only one copy of the bound image drawn, @p x and @p y - * must be 0 and @p w and @p h need to be the exact width and height - * of the image object itself, respectively. - * - * See the following image to better understand the effects of this - * call. On this diagram, both image object and original image source - * have @c a x @c a dimensions and the image itself is a circle, with - * empty space around it: - * - * @image html image-fill.png - * @image rtf image-fill.png - * @image latex image-fill.eps - * - * @warning The default values for the fill parameters are @p x = 0, - * @p y = 0, @p w = 0 and @p h = 0. Thus, if you're not using the - * evas_object_image_filled_add() helper and want your image - * displayed, you'll have to set valid values with this function on - * your object. - * - * @note evas_object_image_filled_set() is a helper function which - * will @b override the values set here automatically, for you, in a - * given way. - */ -EAPI void evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); - -/** - * Retrieve how an image object is to fill its drawing rectangle, - * given the (real) image bound to it. - * - * @param obj The given image object. - * @param x Location to store the x coordinate (from the top left - * corner of the bound image) to start drawing from. - * @param y Location to store the y coordinate (from the top left - * corner of the bound image) to start drawing from. - * @param w Location to store the width the bound image is to be - * displayed at. - * @param h Location to store the height the bound image is to be - * displayed at. - * - * @note Use @c NULL pointers on the fill components you're not - * interested in: they'll be ignored by the function. - * - * See @ref evas_object_image_fill_set() for more details. - */ -EAPI void evas_object_image_fill_get(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); - -/** - * Sets the tiling mode for the given evas image object's fill. - * @param obj The given evas image object. - * @param spread One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT, - * EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD. - */ -EAPI void evas_object_image_fill_spread_set(Evas_Object *obj, Evas_Fill_Spread spread) EINA_ARG_NONNULL(1); - -/** - * Retrieves the spread (tiling mode) for the given image object's - * fill. - * - * @param obj The given evas image object. - * @return The current spread mode of the image object. - */ -EAPI Evas_Fill_Spread evas_object_image_fill_spread_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Sets the size of the given image object. - * - * @param obj The given image object. - * @param w The new width of the image. - * @param h The new height of the image. - * - * This function will scale down or crop the image so that it is - * treated as if it were at the given size. If the size given is - * smaller than the image, it will be cropped. If the size given is - * larger, then the image will be treated as if it were in the upper - * left hand corner of a larger image that is otherwise transparent. - */ -EAPI void evas_object_image_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1); - -/** - * Retrieves the size of the given image object. - * - * @param obj The given image object. - * @param w Location to store the width of the image in, or @c NULL. - * @param h Location to store the height of the image in, or @c NULL. - * - * See @ref evas_object_image_size_set() for more details. - */ -EAPI void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1); - -/** - * Retrieves the row stride of the given image object. - * - * @param obj The given image object. - * @return The stride of the image (in bytes). - * - * The row stride is the number of bytes between the start of a row - * and the start of the next row for image data. - */ -EAPI int evas_object_image_stride_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Retrieves a number representing any error that occurred during the - * last loading of the given image object's source image. - * - * @param obj The given image object. - * @return A value giving the last error that occurred. It should be - * one of the #Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE - * is returned if there was no error. - */ -EAPI Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Sets the raw image data of the given image object. - * - * @param obj The given image object. - * @param data The raw data, or @c NULL. - * - * Note that the raw data must be of the same size (see - * evas_object_image_size_set(), which has to be called @b before this - * one) and colorspace (see evas_object_image_colorspace_set()) of the - * image. If data is @c NULL, the current image data will be - * freed. Naturally, if one does not set an image object's data - * manually, it will still have one, allocated by Evas. - * - * @see evas_object_image_data_get() - */ -EAPI void evas_object_image_data_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1); - -/** - * Get a pointer to the raw image data of the given image object. - * - * @param obj The given image object. - * @param for_writing Whether the data being retrieved will be - * modified (@c EINA_TRUE) or not (@c EINA_FALSE). - * @return The raw image data. - * - * This function returns a pointer to an image object's internal pixel - * buffer, for reading only or read/write. If you request it for - * writing, the image will be marked dirty so that it gets redrawn at - * the next update. - * - * Each time you call this function on an image object, its data - * buffer will have an internal reference counter - * incremented. Decrement it back by using - * evas_object_image_data_set(). - * - * This is best suited for when you want to modify an existing image, - * without changing its dimensions. - * - * @note The contents' format returned by it depend on the color - * space of the given image object. - * - * @note You may want to use evas_object_image_data_update_add() to - * inform data changes, if you did any. - * - * @see evas_object_image_data_set() - */ -EAPI void *evas_object_image_data_get(const Evas_Object *obj, Eina_Bool for_writing) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Converts the raw image data of the given image object to the - * specified colorspace. - * - * Note that this function does not modify the raw image data. If the - * requested colorspace is the same as the image colorspace nothing is - * done and @c NULL is returned. You should use - * evas_object_image_colorspace_get() to check the current image - * colorspace. - * - * See @ref evas_object_image_colorspace_get. - * - * @param obj The given image object. - * @param to_cspace The colorspace to which the image raw data will be converted. - * @return data A newly allocated data in the format specified by to_cspace. - */ -EAPI void *evas_object_image_data_convert(Evas_Object *obj, Evas_Colorspace to_cspace) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Replaces the raw image data of the given image object. - * - * @param obj The given image object. - * @param data The raw data to replace. - * - * This function lets the application replace an image object's - * internal pixel buffer with an user-allocated one. For best results, - * you should generally first call evas_object_image_size_set() with - * the width and height for the new buffer. - * - * This call is best suited for when you will be using image data with - * different dimensions than the existing image data, if any. If you - * only need to modify the existing image in some fashion, then using - * evas_object_image_data_get() is probably what you are after. - * - * Note that the caller is responsible for freeing the buffer when - * finished with it, as user-set image data will not be automatically - * freed when the image object is deleted. - * - * See @ref evas_object_image_data_get() for more details. - * - */ -EAPI void evas_object_image_data_copy_set(Evas_Object *obj, void *data) EINA_ARG_NONNULL(1); - -/** - * Mark a sub-region of the given image object to be redrawn. - * - * @param obj The given image object. - * @param x X-offset of the region to be updated. - * @param y Y-offset of the region to be updated. - * @param w Width of the region to be updated. - * @param h Height of the region to be updated. - * - * This function schedules a particular rectangular region of an image - * object to be updated (redrawn) at the next rendering cycle. - */ -EAPI void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1); - -/** - * Enable or disable alpha channel usage on the given image object. - * - * @param obj The given image object. - * @param has_alpha Whether to use alpha channel (@c EINA_TRUE) data - * or not (@c EINA_FALSE). - * - * This function sets a flag on an image object indicating whether or - * not to use alpha channel data. A value of @c EINA_TRUE makes it use - * alpha channel data, and @c EINA_FALSE makes it ignore that - * data. Note that this has nothing to do with an object's color as - * manipulated by evas_object_color_set(). - * - * @see evas_object_image_alpha_get() - */ -EAPI void evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool has_alpha) EINA_ARG_NONNULL(1); - -/** - * Retrieve whether alpha channel data is being used on the given - * image object. - * - * @param obj The given image object. - * @return Whether the alpha channel data is being used (@c EINA_TRUE) - * or not (@c EINA_FALSE). - * - * This function returns @c EINA_TRUE if the image object's alpha - * channel is being used, or @c EINA_FALSE otherwise. - * - * See @ref evas_object_image_alpha_set() for more details. - */ -EAPI Eina_Bool evas_object_image_alpha_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Sets whether to use high-quality image scaling algorithm on the - * given image object. - * - * @param obj The given image object. - * @param smooth_scale Whether to use smooth scale or not. - * - * When enabled, a higher quality image scaling algorithm is used when - * scaling images to sizes other than the source image's original - * one. This gives better results but is more computationally - * expensive. - * - * @note Image objects get created originally with smooth scaling @b - * on. + * Set the native surface of a given image of the canvas * - * @see evas_object_image_smooth_scale_get() - */ -EAPI void evas_object_image_smooth_scale_set(Evas_Object *obj, Eina_Bool smooth_scale) EINA_ARG_NONNULL(1); - -/** - * Retrieves whether the given image object is using high-quality - * image scaling algorithm. + * @param obj The given canvas pointer. + * @param surf The new native surface. * - * @param obj The given image object. - * @return Whether smooth scale is being used. + * This function sets a native surface of a given canvas image. * - * See @ref evas_object_image_smooth_scale_set() for more details. */ -EAPI Eina_Bool evas_object_image_smooth_scale_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); +EAPI void evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2); /** * Preload an image object's image data in the background @@ -3146,689 +2635,33 @@ EAPI Eina_Bool evas_object_image_smooth_scale_get(const Evas EAPI void evas_object_image_preload(Evas_Object *obj, Eina_Bool cancel) EINA_ARG_NONNULL(1); /** - * Reload an image object's image data. - * - * @param obj The given image object pointer. - * - * This function reloads the image data bound to image object @p obj. - */ -EAPI void evas_object_image_reload(Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Save the given image object's contents to an (image) file. - * - * @param obj The given image object. - * @param file The filename to be used to save the image (extension - * obligatory). - * @param key The image key in the file (if an Eet one), or @c NULL, - * otherwise. - * @param flags String containing the flags to be used (@c NULL for - * none). - * - * The extension suffix on @p file will determine which saver - * module Evas is to use when saving, thus the final file's - * format. If the file supports multiple data stored in it (Eet ones), - * you can specify the key to be used as the index of the image in it. - * - * You can specify some flags when saving the image. Currently - * acceptable flags are @c quality and @c compress. Eg.: @c - * "quality=100 compress=9" - */ -EAPI Eina_Bool evas_object_image_save(const Evas_Object *obj, const char *file, const char *key, const char *flags) EINA_ARG_NONNULL(1, 2); - -/** - * Import pixels from given source to a given canvas image object. - * - * @param obj The given canvas object. - * @param pixels The pixel's source to be imported. - * - * This function imports pixels from a given source to a given canvas image. - * - */ -EAPI Eina_Bool evas_object_image_pixels_import(Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_ARG_NONNULL(1, 2); - -/** - * Set the callback function to get pixels from a canvas' image. - * - * @param obj The given canvas pointer. - * @param func The callback function. - * @param data The data pointer to be passed to @a func. + * Clear the source object on a proxy image object. * - * This functions sets a function to be the callback function that get - * pixels from a image of the canvas. + * @param obj Image object to clear source of. + * @return @c EINA_TRUE on success, @c EINA_FALSE on error. * + * This is equivalent to calling evas_object_image_source_set() with a + * @c NULL source. */ -EAPI void evas_object_image_pixels_get_callback_set(Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) EINA_ARG_NONNULL(1, 2); +EAPI Eina_Bool evas_object_image_source_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); /** - * Mark whether the given image object is dirty and needs to request its pixels. - * - * @param obj The given image object. - * @param dirty Whether the image is dirty. + * Enable an image to be used as an alpha mask. * - * This function will only properly work if a pixels get callback has been set. + * This will set any flags, and discard any excess image data not used as an + * alpha mask. * - * @warning use this function if you really know what you are doing. + * Note there is little point in using a image as alpha mask unless it has an + * alpha channel. * - * @see evas_object_image_pixels_get_callback_set() + * @param obj Object to use as an alpha mask. + * @param ismask Use image as alphamask, must be true. */ -EAPI void evas_object_image_pixels_dirty_set(Evas_Object *obj, Eina_Bool dirty) EINA_ARG_NONNULL(1); +EAPI void evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1); -/** - * Retrieves whether the given image object is dirty (needs to be redrawn). - * - * @param obj The given image object. - * @return Whether the image is dirty. - */ -EAPI Eina_Bool evas_object_image_pixels_dirty_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); +#include "canvas/evas_image.eo.legacy.h" /** - * Set the DPI resolution of an image object's source image. - * - * @param obj The given canvas pointer. - * @param dpi The new DPI resolution. - * - * This function sets the DPI resolution of a given loaded canvas - * image. Most useful for the SVG image loader. - * - * @see evas_object_image_load_dpi_get() - */ -EAPI void evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) EINA_ARG_NONNULL(1); - -/** - * Get the DPI resolution of a loaded image object in the canvas. - * - * @param obj The given canvas pointer. - * @return The DPI resolution of the given canvas image. - * - * This function returns the DPI resolution of the given canvas image. - * - * @see evas_object_image_load_dpi_set() for more details - */ -EAPI double evas_object_image_load_dpi_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Set the size of a given image object's source image, when loading - * it. - * - * @param obj The given canvas object. - * @param w The new width of the image's load size. - * @param h The new height of the image's load size. - * - * This function sets a new (loading) size for the given canvas - * image. - * - * @see evas_object_image_load_size_get() - */ -EAPI void evas_object_image_load_size_set(Evas_Object *obj, int w, int h) EINA_ARG_NONNULL(1); - -/** - * Get the size of a given image object's source image, when loading - * it. - * - * @param obj The given image object. - * @param w Where to store the new width of the image's load size. - * @param h Where to store the new height of the image's load size. - * - * @note Use @c NULL pointers on the size components you're not - * interested in: they'll be ignored by the function. - * - * @see evas_object_image_load_size_set() for more details - */ -EAPI void evas_object_image_load_size_get(const Evas_Object *obj, int *w, int *h) EINA_ARG_NONNULL(1); - -/** - * Set the scale down factor of a given image object's source image, - * when loading it. - * - * @param obj The given image object pointer. - * @param scale_down The scale down factor. - * - * This function sets the scale down factor of a given canvas - * image. Most useful for the SVG image loader. - * - * @see evas_object_image_load_scale_down_get() - */ -EAPI void evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) EINA_ARG_NONNULL(1); - -/** - * get the scale down factor of a given image object's source image, - * when loading it. - * - * @param obj The given image object pointer. - * - * @see evas_object_image_load_scale_down_set() for more details - */ -EAPI int evas_object_image_load_scale_down_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Inform a given image object to load a selective region of its - * source image. - * - * @param obj The given image object pointer. - * @param x X-offset of the region to be loaded. - * @param y Y-offset of the region to be loaded. - * @param w Width of the region to be loaded. - * @param h Height of the region to be loaded. - * - * This function is useful when one is not showing all of an image's - * area on its image object. - * - * @note The image loader for the image format in question has to - * support selective region loading in order to this function to take - * effect. - * - * @see evas_object_image_load_region_get() - */ -EAPI void evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) EINA_ARG_NONNULL(1); - -/** - * Retrieve the coordinates of a given image object's selective - * (source image) load region. - * - * @param obj The given image object pointer. - * @param x Where to store the X-offset of the region to be loaded. - * @param y Where to store the Y-offset of the region to be loaded. - * @param w Where to store the width of the region to be loaded. - * @param h Where to store the height of the region to be loaded. - * - * @note Use @c NULL pointers on the coordinates you're not interested - * in: they'll be ignored by the function. - * - * @see evas_object_image_load_region_get() - */ -EAPI void evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) EINA_ARG_NONNULL(1); - -/** - * Define if the orientation information in the image file should be honored. - * - * @param obj The given image object pointer. - * @param enable @c EINA_TRUE means that it should honor the orientation information - * @since 1.1 - */ -EAPI void evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable) EINA_ARG_NONNULL(1); - -/** - * Get if the orientation information in the image file should be honored. - * - * @param obj The given image object pointer. - * @since 1.1 - */ -EAPI Eina_Bool evas_object_image_load_orientation_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Set the colorspace of a given image of the canvas. - * - * @param obj The given image object pointer. - * @param cspace The new color space. - * - * This function sets the colorspace of given canvas image. - * - */ -EAPI void evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace) EINA_ARG_NONNULL(1); - -/** - * Get the colorspace of a given image of the canvas. - * - * @param obj The given image object pointer. - * @return The colorspace of the image. - * - * This function returns the colorspace of given canvas image. - * - */ -EAPI Evas_Colorspace evas_object_image_colorspace_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Get the support state of a given image - * - * @param obj The given image object pointer - * @return The region support state - * @since 1.2 - * - * This function returns the state of the region support of given image - */ -EAPI Eina_Bool evas_object_image_region_support_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Set the native surface of a given image of the canvas - * - * @param obj The given canvas pointer. - * @param surf The new native surface. - * - * This function sets a native surface of a given canvas image. - * - */ -EAPI void evas_object_image_native_surface_set(Evas_Object *obj, Evas_Native_Surface *surf) EINA_ARG_NONNULL(1, 2); - -/** - * Get the native surface of a given image of the canvas - * - * @param obj The given canvas pointer. - * @return The native surface of the given canvas image. - * - * This function returns the native surface of a given canvas image. - * - */ -EAPI Evas_Native_Surface *evas_object_image_native_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Set the video surface linked to a given image of the canvas - * - * @param obj The given canvas pointer. - * @param surf The new video surface. - * @since 1.1 - * - * This function links a video surface to a given canvas image. - * - */ -EAPI void evas_object_image_video_surface_set(Evas_Object *obj, Evas_Video_Surface *surf) EINA_ARG_NONNULL(1); - -/** - * Get the video surface linekd to a given image of the canvas - * - * @param obj The given canvas pointer. - * @return The video surface of the given canvas image. - * @since 1.1 - * - * This function returns the video surface linked to a given canvas image. - * - */ -EAPI const Evas_Video_Surface *evas_object_image_video_surface_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -EAPI void evas_object_image_video_surface_caps_set(Evas_Object *obj, unsigned int caps) EINA_ARG_NONNULL(1); -EAPI unsigned int evas_object_image_video_surface_caps_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Set the scale hint of a given image of the canvas. - * - * @param obj The given image object pointer. - * @param hint The scale hint, a value in - * #Evas_Image_Scale_Hint. - * - * This function sets the scale hint value of the given image object - * in the canvas, which will affect how Evas is to cache scaled - * versions of its original source image. - * - * @see evas_object_image_scale_hint_get() - */ -EAPI void evas_object_image_scale_hint_set(Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1); - -/** - * Get the scale hint of a given image of the canvas. - * - * @param obj The given image object pointer. - * @return The scale hint value set on @p obj, a value in - * #Evas_Image_Scale_Hint. - * - * This function returns the scale hint value of the given image - * object of the canvas. - * - * @see evas_object_image_scale_hint_set() for more details. - */ -EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Set the content hint setting of a given image object of the canvas. - * - * @param obj The given canvas pointer. - * @param hint The content hint value, one of the - * #Evas_Image_Content_Hint ones. - * - * This function sets the content hint value of the given image of the - * canvas. For example, if you're on the GL engine and your driver - * implementation supports it, setting this hint to - * #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need @b zero copies - * at texture upload time, which is an "expensive" operation. - * - * @see evas_object_image_content_hint_get() - */ -EAPI void evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1); - -/** - * Get the content hint setting of a given image object of the canvas. - * - * @param obj The given canvas pointer. - * @return hint The content hint value set on it, one of the - * #Evas_Image_Content_Hint ones (#EVAS_IMAGE_CONTENT_HINT_NONE means - * an error). - * - * This function returns the content hint value of the given image of - * the canvas. - * - * @see evas_object_image_content_hint_set() - */ -EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Enable an image to be used as an alpha mask. - * - * This will set any flags, and discard any excess image data not used as an - * alpha mask. - * - * Note there is little point in using a image as alpha mask unless it has an - * alpha channel. - * - * @param obj Object to use as an alpha mask. - * @param ismask Use image as alphamask, must be true. - */ -EAPI void evas_object_image_alpha_mask_set(Evas_Object *obj, Eina_Bool ismask) EINA_ARG_NONNULL(1); - -/** - * Set the source object on an image object to used as a @b proxy. - * - * @param obj Proxy (image) object. - * @param src Source object to use for the proxy. - * @return @c EINA_TRUE on success, @c EINA_FALSE on error. - * - * If an image object is set to behave as a @b proxy, it will mirror - * the rendering contents of a given @b source object in its drawing - * region, without affecting that source in any way. The source must - * be another valid Evas object. Other effects may be applied to the - * proxy, such as a map (see evas_object_map_set()) to create a - * reflection of the original object (for example). - * - * Any existing source object on @p obj will be removed after this - * call. Setting @p src to @c NULL clears the proxy object (not in - * "proxy state" anymore). - * - * @warning You cannot set a proxy as another proxy's source. - * - * @see evas_object_image_source_get() - * @see evas_object_image_source_unset() - * @see evas_object_image_source_visible_set() - */ -EAPI Eina_Bool evas_object_image_source_set(Evas_Object *obj, Evas_Object *src) EINA_ARG_NONNULL(1); - -/** - * Get the current source object of an image object. - * - * @param obj Image object - * @return Source object (if any), or @c NULL, if not in "proxy mode" - * (or on errors). - * - * @see evas_object_image_source_set() for more details - */ -EAPI Evas_Object *evas_object_image_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Clear the source object on a proxy image object. - * - * @param obj Image object to clear source of. - * @return @c EINA_TRUE on success, @c EINA_FALSE on error. - * - * This is equivalent to calling evas_object_image_source_set() with a - * @c NULL source. - */ -EAPI Eina_Bool evas_object_image_source_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Set the source object to be visible or not. - * - * @param obj Proxy (image) object. - * @param visible @c EINA_TRUE is source object to be shown, @c EINA_FALSE - * otherwise. - * - * If the @p visible set to @c EINA_FALSE, the source object of the proxy(@p obj - * ) will be invisible. - * - * This API works differently to evas_object_show() and evas_object_hide(). - * Once source object is hidden by evas_object_hide() then the proxy object will - * be hidden as well. Actually in this case both objects are excluded from the - * Evas internal update circle. - * - * By this API, instead, one can toggle the visibility of a proxy's source - * object remaining the proxy visibility untouched. - * - * @warning If the all of proxies are deleted, then the source visibility of the - * source object will be cancelled. - * - * @see evas_object_image_source_visible_get() - * @see evas_object_image_source_set() - * @see evas_object_show() - * @see evas_object_hide() - * @since 1.8 - */ -EAPI void evas_object_image_source_visible_set(Evas_Object *obj, Eina_Bool visible) EINA_ARG_NONNULL(1); - -/** - * Get the state of the source object visibility. - * - * @param obj Proxy (image) object. - * @return @c EINA_TRUE if source object is visible, @c EINA_FALSE otherwise. - * - * @see evas_object_image_source_visible_set() - * @see evas_object_image_source_set() - * @see evas_object_show() - * @see evas_object_hide() - * @since 1.8 - */ -EAPI Eina_Bool evas_object_image_source_visible_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Set whether an Evas object is to source events. - * - * @param obj Proxy (image) object. - * @param source whether @p obj is to pass events (@c EINA_TRUE) or not - * (@c EINA_FALSE) - * - * Set whether an Evas object is to repeat events to source. - * - * If @p source is @c EINA_TRUE, it will make events on @p obj to also be - * repeated for the source object (see evas_object_image_source_set()). Even the - * @p obj and source geometries are different, the event position will be - * transformed to the source object's space. - * - * If @p source is @c EINA_FALSE, events occurring on @p obj will be - * processed only on it. - * - * @see evas_object_image_source_get() - * @see evas_object_image_source_visible_set() - * @see evas_object_image_source_events_get() - * @since 1.8 - */ -EAPI void evas_object_image_source_events_set(Evas_Object *obj, Eina_Bool source) EINA_ARG_NONNULL(1); - -/** - * Determine whether an object is set to source events. - * - * @param obj Proxy (image) object. - * @return @c EINA_TRUE if source object has events, @c EINA_FALSE otherwise. - * - * @see evas_object_image_source_set() - * @see evas_object_image_source_visible_set() - * @see evas_object_image_source_events_set() - * @since 1.8 - */ -EAPI Eina_Bool evas_object_image_source_events_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); - -/** - * Clip the proxy object with the source object's clipper. - * - * @param obj Proxy (image) object. - * @param source_clip whether @p obj is clipped by the source clipper. - * (@c EINA_TRUE) or not (@c EINA_FALSE) - * - * @see evas_object_clip_set() - * @see evas_object_image_source_set() - * @since 1.8 - */ -EAPI void evas_object_image_source_clip_set(Evas_Object *obj, Eina_Bool source_clip) EINA_ARG_NONNULL(1); - -/** - * Determine whether an object is clipped by source object's clipper. - * - * @param obj Proxy (image) object. - * @return @c EINA_TRUE if source clip is enabled, @c EINA_FALSE otherwise. - * - * @see evas_object_clip_set() - * @see evas_object_image_source_set() - * @see evas_object_image_source_clip_set() - * @since 1.8 - */ -EAPI Eina_Bool evas_object_image_source_clip_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - -/** - * Check if an image object can be animated (have multiple frames) - * - * @param obj Image object - * @return whether obj support animation - * - * This returns if the image file of an image object is capable of animation - * such as an animated gif file might. This is only useful to be called once - * the image object file has been set. - * - * Example: - * @code - * extern Evas_Object *obj; - * - * if (evas_object_image_animated_get(obj)) - * { - * int frame_count; - * int loop_count; - * Evas_Image_Animated_Loop_Hint loop_type; - * double duration; - * - * frame_count = evas_object_image_animated_frame_count_get(obj); - * printf("This image has %d frames\n",frame_count); - * - * duration = evas_object_image_animated_frame_duration_get(obj,1,0); - * printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n"); - * - * loop_count = evas_object_image_animated_loop_count_get(obj); - * printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count); - * - * loop_type = evas_object_image_animated_loop_type_get(obj); - * if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP) - * printf("You had better set frame like 1->2->3->1->2->3...\n"); - * else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG) - * printf("You had better set frame like 1->2->3->2->1->2...\n"); - * else - * printf("Unknown loop type\n"); - * - * evas_object_image_animated_frame_set(obj,1); - * printf("You set image object's frame to 1. You can see frame 1\n"); - * } - * @endcode - * - * @see evas_object_image_animated_get() - * @see evas_object_image_animated_frame_count_get() - * @see evas_object_image_animated_loop_type_get() - * @see evas_object_image_animated_loop_count_get() - * @see evas_object_image_animated_frame_duration_get() - * @see evas_object_image_animated_frame_set() - * @since 1.1 - */ -EAPI Eina_Bool evas_object_image_animated_get(const Evas_Object *obj); - -/** - * Get the total number of frames of the image object. - * - * @param obj Image object - * @return The number of frames - * - * This returns total number of frames the image object supports (if animated) - * - * @see evas_object_image_animated_get() - * @see evas_object_image_animated_frame_count_get() - * @see evas_object_image_animated_loop_type_get() - * @see evas_object_image_animated_loop_count_get() - * @see evas_object_image_animated_frame_duration_get() - * @see evas_object_image_animated_frame_set() - * @since 1.1 - */ -EAPI int evas_object_image_animated_frame_count_get(const Evas_Object *obj); - -/** - * Get the kind of looping the image object does. - * - * @param obj Image object - * @return Loop type of the image object - * - * This returns the kind of looping the image object wants to do. - * - * If it returns EVAS_IMAGE_ANIMATED_HINT_LOOP, you should display frames in a sequence like: - * 1->2->3->1->2->3->1... - * If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG, it is better to - * display frames in a sequence like: 1->2->3->2->1->2->3->1... - * - * The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP. - * - * @see evas_object_image_animated_get() - * @see evas_object_image_animated_frame_count_get() - * @see evas_object_image_animated_loop_type_get() - * @see evas_object_image_animated_loop_count_get() - * @see evas_object_image_animated_frame_duration_get() - * @see evas_object_image_animated_frame_set() - * @since 1.1 - */ -EAPI Evas_Image_Animated_Loop_Hint evas_object_image_animated_loop_type_get(const Evas_Object *obj); - -/** - * Get the number times the animation of the object loops. - * - * @param obj Image object - * @return The number of loop of an animated image object - * - * This returns loop count of image. The loop count is the number of times - * the animation will play fully from first to last frame until the animation - * should stop (at the final frame). - * - * If 0 is returned, then looping should happen indefinitely (no limit to - * the number of times it loops). - * - * @see evas_object_image_animated_get() - * @see evas_object_image_animated_frame_count_get() - * @see evas_object_image_animated_loop_type_get() - * @see evas_object_image_animated_loop_count_get() - * @see evas_object_image_animated_frame_duration_get() - * @see evas_object_image_animated_frame_set() - * @since 1.1 - */ -EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj); - -/** - * Get the duration of a sequence of frames. - * - * @param obj Image object - * @param start_frame The first frame - * @param fram_num Number of frames in the sequence - * - * This returns total duration that the specified sequence of frames should - * take in seconds. - * - * If you set start_frame to 1 and frame_num 0, you get frame 1's duration - * If you set start_frame to 1 and frame_num 1, you get frame 1's duration + - * frame2's duration - * - * @see evas_object_image_animated_get() - * @see evas_object_image_animated_frame_count_get() - * @see evas_object_image_animated_loop_type_get() - * @see evas_object_image_animated_loop_count_get() - * @see evas_object_image_animated_frame_duration_get() - * @see evas_object_image_animated_frame_set() - * @since 1.1 - */ -EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num); - -/** - * Set the frame to current frame of an image object - * - * @param obj The given image object. - * @param frame_num The index of current frame - * - * This set image object's current frame to frame_num with 1 being the first - * frame. - * - * @see evas_object_image_animated_get() - * @see evas_object_image_animated_frame_count_get() - * @see evas_object_image_animated_loop_type_get() - * @see evas_object_image_animated_loop_count_get() - * @see evas_object_image_animated_frame_duration_get() - * @see evas_object_image_animated_frame_set() - * @since 1.1 - */ -EAPI void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num); -/** * @} */ diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo index 20f9c3d..3fd2c53 100644 --- a/src/lib/evas/canvas/evas_image.eo +++ b/src/lib/evas/canvas/evas_image.eo @@ -1000,6 +1000,7 @@ class Evas_Image (Evas_Object) methods { preload_begin { /*@ Begin preloading an image object's image data in the background */ + legacy null; } data_update_add { /*@ @@ -1118,6 +1119,7 @@ class Evas_Image (Evas_Object) } preload_cancel { /*@ Cancel preloading an image object's image data in the background */ + legacy null; } data_convert { /*@ -- 2.7.4