diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-08-04 19:16:18 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-08-05 10:32:30 +0900 |
commit | 26ee77ff674d42f105172540481d67217e509e5f (patch) | |
tree | 37b51c4f34bbbc43633469bfba02d56c32472f7f | |
parent | 12fbaacc976232bbe2b0a47b3270ad73dbc613ea (diff) | |
download | efl-26ee77ff674d42f105172540481d67217e509e5f.tar.gz |
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.
-rw-r--r-- | src/lib/elementary/efl_ui_image.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_image_legacy.c | 25 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index f27d17f033..11cace6f50 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 fae5b29a26..e682041735 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); } |