From 9d4ca6f352a465cc6e0bcc70aeb3ac3108917e67 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Fri, 18 Mar 2016 11:29:55 +0900 Subject: [PATCH] Evas.Image: (eo) fill_set now unsets the filled flag There's no point in calling fill_set AND fillet_set(false). If a users wants to specify the fill, that should be enough to switch to non-filled mode. Maybe the "filled" mode should even be called auto or something? --- src/lib/evas/canvas/evas_image_legacy.c | 2 +- src/lib/evas/canvas/evas_image_private.h | 3 +++ src/lib/evas/canvas/evas_object_image.c | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c index 9b510ddba0..cd92e6f4b7 100644 --- a/src/lib/evas/canvas/evas_image_legacy.c +++ b/src/lib/evas/canvas/evas_image_legacy.c @@ -47,7 +47,7 @@ evas_object_image_fill_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { EVAS_IMAGE_API(obj); - efl_gfx_fill_set(obj, x, y, w, h); + _evas_image_fill_set(obj, eo_data_scope_get(obj, EVAS_IMAGE_CLASS), x, y, w, h); } EAPI void diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h index ff7ffcded4..7274c4185f 100644 --- a/src/lib/evas/canvas/evas_image_private.h +++ b/src/lib/evas/canvas/evas_image_private.h @@ -142,6 +142,9 @@ void _evas_image_init_set(const Eina_File *f, const char *file, const char *key, void _evas_image_done_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o); void _evas_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o); +/* Efl.Gfx.Fill */ +void _evas_image_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h); + /* Efl.File */ Eina_Bool _evas_image_mmap_set(Eo *eo_obj, const Eina_File *f, const char *key); void _evas_image_mmap_get(const Eo *eo_obj, const Eina_File **f, const char **key); diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 097c04fd02..5b4114f59f 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -542,9 +542,8 @@ _evas_image_efl_image_border_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data * return o->cur->border.scale; } -EOLIAN static void -_evas_image_efl_gfx_fill_fill_set(Eo *eo_obj, Evas_Image_Data *o, - int x, int y, int w, int h) +void +_evas_image_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); @@ -573,6 +572,16 @@ _evas_image_efl_gfx_fill_fill_set(Eo *eo_obj, Evas_Image_Data *o, evas_object_change(eo_obj, obj); } +EOLIAN static void +_evas_image_efl_gfx_fill_fill_set(Eo *eo_obj, Evas_Image_Data *o, + int x, int y, int w, int h) +{ + // Should (0,0,0,0) reset the filled flag to true? + o->filled = EINA_FALSE; + o->filled_set = EINA_TRUE; + _evas_image_fill_set(eo_obj, o, x, y, w, h); +} + EOLIAN static void _evas_image_efl_gfx_fill_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *x, int *y, int *w, int *h)