summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-03-07 04:19:17 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-03-07 04:19:17 +0000
commit10da9b00a308689ce817aab37da681ec01b9a55c (patch)
tree73c13e1cf9e617b356978f5cd7520f7ee76fe33e
parent73a9612f2c320cc6779da7ab3063f89cdf920169 (diff)
api for image content hint - nothing uses it yet, but... it will. and does
nothing right now... but that will be able to change. it opens up better optimisation paths in future. SVN revision: 46922
-rw-r--r--legacy/evas/src/lib/Evas.h9
-rw-r--r--legacy/evas/src/lib/canvas/evas_object_image.c50
2 files changed, 58 insertions, 1 deletions
diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h
index 841a6a298e..00c8609640 100644
--- a/legacy/evas/src/lib/Evas.h
+++ b/legacy/evas/src/lib/Evas.h
@@ -532,6 +532,13 @@ typedef enum _Evas_Image_Scale_Hint
532 EVAS_IMAGE_SCALE_HINT_STATIC = 2 532 EVAS_IMAGE_SCALE_HINT_STATIC = 2
533} Evas_Image_Scale_Hint; 533} Evas_Image_Scale_Hint;
534 534
535typedef enum _Evas_Image_Content_Hint
536{
537 EVAS_IMAGE_CONTENT_HINT_NONE = 0,
538 EVAS_IMAGE_CONTENT_HINT_DYNAMIC = 1,
539 EVAS_IMAGE_CONTENT_HINT_STATIC = 2
540} Evas_Image_Content_Hint;
541
535struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */ 542struct _Evas_Engine_Info /** Generic engine information. Generic info is useless */
536{ 543{
537 int magic; /**< Magic number */ 544 int magic; /**< Magic number */
@@ -895,6 +902,8 @@ extern "C" {
895 EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; 902 EAPI Evas_Native_Surface *evas_object_image_native_surface_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
896 EAPI void evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1); 903 EAPI void evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) EINA_ARG_NONNULL(1);
897 EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE; 904 EAPI Evas_Image_Scale_Hint evas_object_image_scale_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
905 EAPI void evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) EINA_ARG_NONNULL(1);
906 EAPI Evas_Image_Content_Hint evas_object_image_content_hint_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
898 907
899/* image cache */ 908/* image cache */
900 EAPI void evas_image_cache_flush (Evas *e) EINA_ARG_NONNULL(1); 909 EAPI void evas_image_cache_flush (Evas *e) EINA_ARG_NONNULL(1);
diff --git a/legacy/evas/src/lib/canvas/evas_object_image.c b/legacy/evas/src/lib/canvas/evas_object_image.c
index 85d2ec3bd8..4b773d0e0b 100644
--- a/legacy/evas/src/lib/canvas/evas_object_image.c
+++ b/legacy/evas/src/lib/canvas/evas_object_image.c
@@ -57,7 +57,8 @@ struct _Evas_Object_Image
57 void *get_pixels_data; 57 void *get_pixels_data;
58 } func; 58 } func;
59 59
60 Evas_Image_Scale_Hint scale_hint; 60 Evas_Image_Scale_Hint scale_hint;
61 Evas_Image_Content_Hint content_hint;
61 62
62 void *engine_data; 63 void *engine_data;
63 64
@@ -2023,6 +2024,53 @@ evas_object_image_scale_hint_get(const Evas_Object *obj)
2023} 2024}
2024 2025
2025/** 2026/**
2027 * Set the content hint of a given image of the canvas.
2028 *
2029 * @param obj The given canvas pointer.
2030 * @param hint The content hint value.
2031 *
2032 * This function sets the content hint value of the given image of the canvas.
2033 *
2034 */
2035EAPI void
2036evas_object_image_content_hint_set(Evas_Object *obj, Evas_Image_Content_Hint hint)
2037{
2038 Evas_Object_Image *o;
2039
2040 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
2041 return;
2042 MAGIC_CHECK_END();
2043 o = (Evas_Object_Image *)(obj->object_data);
2044 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
2045 return;
2046 MAGIC_CHECK_END();
2047 o->content_hint = hint;
2048}
2049
2050/**
2051 * Get the content hint of a given image of the canvas.
2052 *
2053 * @param obj The given canvas pointer.
2054 *
2055 * This function returns the content hint value of the given image of the canvas.
2056 *
2057 */
2058EAPI Evas_Image_Content_Hint
2059evas_object_image_content_hint_get(const Evas_Object *obj)
2060{
2061 Evas_Object_Image *o;
2062
2063 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
2064 return EVAS_IMAGE_CONTENT_HINT_NONE;
2065 MAGIC_CHECK_END();
2066 o = (Evas_Object_Image *)(obj->object_data);
2067 MAGIC_CHECK(o, Evas_Object_Image, MAGIC_OBJ_IMAGE);
2068 return EVAS_IMAGE_CONTENT_HINT_NONE;
2069 MAGIC_CHECK_END();
2070 return o->content_hint;
2071}
2072
2073/**
2026 * Flush the image cache of the canvas. 2074 * Flush the image cache of the canvas.
2027 * 2075 *
2028 * @param e The given evas pointer. 2076 * @param e The given evas pointer.