BUILT_SOURCES += \
lib/efl/interfaces/efl_file.eo.c \
lib/efl/interfaces/efl_file.eo.h \
+ lib/efl/interfaces/efl_image.eo.c \
+ lib/efl/interfaces/efl_image.eo.h \
lib/efl/interfaces/efl_text_properties.eo.c \
lib/efl/interfaces/efl_text_properties.eo.h
efleolianfilesdir = $(datadir)/eolian/include/efl-@VMAJ@
efleolianfiles_DATA = \
lib/efl/interfaces/efl_file.eo \
+ lib/efl/interfaces/efl_image.eo \
lib/efl/interfaces/efl_text_properties.eo
EXTRA_DIST += \
installed_eflinterfacesdir = $(includedir)/efl-@VMAJ@/interfaces
nodist_installed_eflinterfaces_DATA = \
lib/efl/interfaces/efl_file.eo.h \
+ lib/efl/interfaces/efl_image.eo.h \
lib/efl/interfaces/efl_text_properties.eo.h
generated_efl_cxx_bindings = \
lib/efl/interfaces/efl_file.eo.hh \
+ lib/efl/interfaces/efl_image.eo.hh \
lib/efl/interfaces/efl_text_properties.eo.hh
lib/efl/Efl.hh: $(generated_efl_cxx_bindings)
p3->type.common.fill.y,
p3->type.common.fill.w,
p3->type.common.fill.h),
- evas_obj_image_smooth_scale_set(p3->smooth),
+ efl_image_smooth_scale_set(p3->smooth),
evas_obj_image_source_visible_set(chosen_desc->proxy.source_visible),
evas_obj_image_source_clip_set(chosen_desc->proxy.source_clip));
}
eo_do(ep->object,
evas_obj_image_fill_set(p3->type.common.fill.x, p3->type.common.fill.y,
p3->type.common.fill.w, p3->type.common.fill.h),
- evas_obj_image_smooth_scale_set(p3->smooth));
+ efl_image_smooth_scale_set(p3->smooth));
if (chosen_desc->image.border.scale)
{
if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0))
/* Interfaces */
#include "interfaces/efl_file.eo.h"
+#include "interfaces/efl_image.eo.h"
#include "interfaces/efl_text_properties.eo.h"
#endif
--- /dev/null
+interface Efl.Image {
+ legacy_prefix: null;
+ properties {
+ animated {
+ get {
+ /*@
+ Check if an image can be animated (have multiple frames)
+
+ @return whether the image support animation
+ */
+ }
+ values {
+ bool is_animated; /*@ If it's animated or not. */
+ }
+ }
+ load_size {
+ set {
+ /*@
+ Set the loading size of an image. The image will be loaded into memory as if it was
+ the set size instead of the original size. This can save a lot of memory, and is
+ important for scalable types like svg.
+ */
+ }
+ get {
+ }
+ values {
+ int w; /*@ The new width of the image's load size. */
+ int h; /*@ The new height of the image's load size. */
+ }
+ }
+ smooth_scale {
+ set {
+ /*@
+ Sets whether to use high-quality image scaling algorithm on the
+ given image.
+
+ 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.
+ */
+ }
+ get {
+ /*@
+ Retrieves whether the given image is using high-quality
+ image scaling algorithm.
+
+ @return Whether smooth scale is being used.
+ */
+ }
+ values {
+ bool smooth_scale; /*@ Whether to use smooth scale or not. */
+ }
+ }
+ }
+}
#include <Efl.h>
#include "interfaces/efl_file.eo.c"
+#include "interfaces/efl_image.eo.c"
#include "interfaces/efl_text_properties.eo.c"
*/
EAPI Eina_Bool evas_object_image_save(const Eo *obj, const char *file, const char *key, const char *flags) EINA_ARG_NONNULL(2);
+/**
+ *
+ * Check if an image object can be animated (have multiple frames)
+ *
+ * @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 Eo *obj);
+
+/**
+ *
+ * Set the size of a given image object's source image, when loading
+ * it.
+ *
+ * This function sets a new (loading) size for the given canvas
+ * image.
+ *
+ * @see evas_object_image_load_size_get()
+ *
+ * @param[in] w The new width of the image's load size.
+ * @param[in] h The new height of the image's load size.
+ */
+EAPI void evas_object_image_load_size_set(Eo *obj, int w, int h);
+
+/**
+ *
+ * Get the size of a given image object's source image, when loading
+ * it.
+ *
+ * @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
+ *
+ * @param[out] w The new width of the image's load size.
+ * @param[out] h The new height of the image's load size.
+ */
+EAPI void evas_object_image_load_size_get(const Eo *obj, int *w, int *h);
+
+/**
+ *
+ * Sets whether to use high-quality image scaling algorithm on the
+ * given image object.
+ *
+ * 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.
+ *
+ * @see evas_object_image_smooth_scale_get()
+ *
+ * @param[in] smooth_scale Whether to use smooth scale or not.
+ */
+EAPI void evas_object_image_smooth_scale_set(Eo *obj, Eina_Bool smooth_scale);
+
+/**
+ *
+ * Retrieves whether the given image object is using high-quality
+ * image scaling algorithm.
+ *
+ * @return Whether smooth scale is being used.
+ *
+ * See @ref evas_object_image_smooth_scale_set() for more details.
+ *
+ */
+EAPI Eina_Bool evas_object_image_smooth_scale_get(const Eo *obj);
+
#include "canvas/evas_image.eo.legacy.h"
/**
-class Evas.Image (Evas.Object, Efl.File)
+class Evas.Image (Evas.Object, Efl.File, Efl.Image)
{
legacy_prefix: evas_object_image;
eo_prefix: evas_obj_image;
or not (@c EINA_FALSE). */
}
}
- load_size {
- set {
- /*@
- Set the size of a given image object's source image, when loading
- it.
-
- This function sets a new (loading) size for the given canvas
- image.
-
- @see evas_object_image_load_size_get() */
- }
- get {
- /*@
- Get the size of a given image object's source image, when loading
- it.
-
- @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 */
- }
- values {
- int w; /*@ The new width of the image's load size. */
- int h; /*@ The new height of the image's load size. */
- }
- }
border {
set {
/*@
int b; /*@ The border's bottom width. */
}
}
- smooth_scale {
- set {
- /*@
- Sets whether to use high-quality image scaling algorithm on the
- given image object.
-
- 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.
-
- @see evas_object_image_smooth_scale_get() */
- }
- get {
- /*@
- Retrieves whether the given image object is using high-quality
- image scaling algorithm.
-
- @return Whether smooth scale is being used.
-
- See @ref evas_object_image_smooth_scale_set() for more details. */
- }
- values {
- bool smooth_scale; /*@ Whether to use smooth scale or not. */
- }
- }
border_scale {
set {
/*@
return: int @warn_unused;
}
}
- animated {
- get {
- /*@
- Check if an image object can be animated (have multiple frames)
-
- @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 */
- return: bool;
- }
- }
animated_loop_type {
get {
/*@
Efl.File.file.set;
Efl.File.file.get;
Efl.File.save;
+ Efl.Image.animated.get;
+ Efl.Image.load_size.set;
+ Efl.Image.load_size.get;
+ Efl.Image.smooth_scale.set;
+ Efl.Image.smooth_scale.get;
}
}
}
EOLIAN static void
-_evas_image_smooth_scale_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool smooth_scale)
+_evas_image_efl_image_smooth_scale_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool smooth_scale)
{
Evas_Object_Protected_Data *obj;
}
EOLIAN static Eina_Bool
-_evas_image_smooth_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_evas_image_efl_image_smooth_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
{
return o->cur->smooth_scale;
}
}
EOLIAN static void
-_evas_image_load_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h)
+_evas_image_efl_image_load_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h)
{
if ((o->load_opts->w == w) && (o->load_opts->h == h)) return;
}
EOLIAN static void
-_evas_image_load_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *w, int *h)
+_evas_image_efl_image_load_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *w, int *h)
{
if (w) *w = o->load_opts->w;
if (h) *h = o->load_opts->h;
/* animated feature */
EOLIAN static Eina_Bool
-_evas_image_animated_get(Eo *eo_obj, Evas_Image_Data *o)
+_evas_image_efl_image_animated_get(Eo *eo_obj, Evas_Image_Data *o)
{
Eina_Bool animated;
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
return eo_do((Eo *) obj, efl_file_save(file, key, flags));
}
+EAPI Eina_Bool
+evas_object_image_animated_get(const Eo *obj)
+{
+ return eo_do((Eo *) obj, efl_image_animated_get());
+}
+
+EAPI void
+evas_object_image_load_size_set(Eo *obj, int w, int h)
+{
+ eo_do((Eo *) obj, efl_image_load_size_set(w, h));
+}
+
+EAPI void
+evas_object_image_load_size_get(const Eo *obj, int *w, int *h)
+{
+ eo_do((Eo *) obj, efl_image_load_size_get(w, h));
+}
+
+EAPI void
+evas_object_image_smooth_scale_set(Eo *obj, Eina_Bool smooth_scale)
+{
+ eo_do((Eo *) obj, efl_image_smooth_scale_set(smooth_scale));
+}
+
+EAPI Eina_Bool
+evas_object_image_smooth_scale_get(const Eo *obj)
+{
+ return eo_do((Eo *) obj, efl_image_smooth_scale_get());
+}
+
#include "canvas/evas_image.eo.c"