From: Jean-Philippe Andre Date: Thu, 4 Aug 2016 10:16:18 +0000 (+0900) Subject: evas image: Lower ERR message to WRN and fix it X-Git-Tag: upstream/1.20.0~4930 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26ee77ff674d42f105172540481d67217e509e5f;p=platform%2Fupstream%2Fefl.git evas image: Lower ERR message to WRN and fix it In elm_image, efl_file_get() was called on a legacy Evas Image object, which generated an ERR message. This was way too much noise for something that actually works. It's best not to call efl_file_get/set API on a legacy object, but it can be convenient for smooth code transitions from legacy to pure eo. Also, add safety to those APIs. Test case: elm_test genlist dnd, start dragging anything. --- diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index f27d17f..11cace6 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -1117,7 +1117,7 @@ _efl_ui_image_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, cons return; } - efl_file_get(sd->img, file, key); + evas_object_image_file_get(sd->img, file, key); } static Eina_Bool diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c index fae5b29..e682041 100644 --- a/src/lib/evas/canvas/evas_image_legacy.c +++ b/src/lib/evas/canvas/evas_image_legacy.c @@ -1130,42 +1130,43 @@ evas_object_image_pixels_import(Evas_Object *eo_obj, Evas_Pixel_Import_Source *p EAPI void evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool ismask EINA_UNUSED) { - DBG("This function is not implemented, has never been and never will be."); + WRN("This function is not implemented, has never been and never will be."); EVAS_IMAGE_LEGACY_API(eo_obj); } - -/* FIXME: Temporarily allow efl_file_ APIs on Evas.Image. - * They don't belong here, as only Efl.Canvas.Image should support them. - * Elm.Image uses them, though, instead of using the legacy APIs... - */ - EOLIAN static Eina_Bool _evas_image_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const char *file, const char *key) { - ERR("efl_file_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + WRN("efl_file_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + EVAS_IMAGE_API(obj, EINA_FALSE); return _evas_image_file_set(obj, file, key); } EOLIAN static void _evas_image_efl_file_file_get(Eo *obj, void *pd EINA_UNUSED, const char **file, const char **key) { - ERR("efl_file_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + WRN("efl_file_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + if (file) *file = NULL; + if (key) *key = NULL; + EVAS_IMAGE_API(obj); _evas_image_file_get(obj, file, key); } EOLIAN static Eina_Bool _evas_image_efl_file_mmap_set(Eo *obj, void *pd EINA_UNUSED, const Eina_File *f, const char *key) { - ERR("efl_file_mmap_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + WRN("efl_file_mmap_set shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + EVAS_IMAGE_API(obj, EINA_FALSE); return _evas_image_mmap_set(obj, f, key); } - EOLIAN static void _evas_image_efl_file_mmap_get(Eo *obj, void *pd EINA_UNUSED, const Eina_File **f, const char **key) { - ERR("efl_file_mmap_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + WRN("efl_file_mmap_get shouldn't be used on Evas.Image. please switch to Efl.Canvas.Image"); + if (f) *f = NULL; + if (key) *key = NULL; + EVAS_IMAGE_API(obj); _evas_image_mmap_get(obj, f, key); }