From 350c3e7895c283c2ad6a7a28d420553fb4d233b9 Mon Sep 17 00:00:00 2001 From: caro Date: Wed, 20 Oct 2010 07:55:20 +0000 Subject: [PATCH] API break: emotion_object_file_set() returns a boolean, now. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@53648 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/emotion_test_main.c | 5 ++++- src/lib/Emotion.h | 2 +- src/lib/emotion_smart.c | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/bin/emotion_test_main.c b/src/bin/emotion_test_main.c index e6b3eff..80b0438 100644 --- a/src/bin/emotion_test_main.c +++ b/src/bin/emotion_test_main.c @@ -699,7 +699,10 @@ init_video_object(char *module_filename, char *filename) if (!emotion_object_init(o, module_filename)) return; emotion_object_vis_set(o, vis); - emotion_object_file_set(o, filename); + if (!emotion_object_file_set(o, filename)) + { + return; + } emotion_object_play_set(o, 1); evas_object_move(o, 0, 0); evas_object_resize(o, 320, 240); diff --git a/src/lib/Emotion.h b/src/lib/Emotion.h index 929b30a..009e391 100644 --- a/src/lib/Emotion.h +++ b/src/lib/Emotion.h @@ -119,7 +119,7 @@ extern "C" { EAPI Evas_Object *emotion_object_add (Evas *evas); EAPI void emotion_object_module_option_set (Evas_Object *obj, const char *opt, const char *val); EAPI Eina_Bool emotion_object_init (Evas_Object *obj, const char *module_filename); -EAPI void emotion_object_file_set (Evas_Object *obj, const char *filename); +EAPI Eina_Bool emotion_object_file_set (Evas_Object *obj, const char *filename); EAPI const char *emotion_object_file_get (const Evas_Object *obj); EAPI void emotion_object_play_set (Evas_Object *obj, Eina_Bool play); EAPI Eina_Bool emotion_object_play_get (const Evas_Object *obj); diff --git a/src/lib/emotion_smart.c b/src/lib/emotion_smart.c index 30d0951..ad64970 100644 --- a/src/lib/emotion_smart.c +++ b/src/lib/emotion_smart.c @@ -314,7 +314,7 @@ emotion_object_init(Evas_Object *obj, const char *module_filename) return EINA_TRUE; } -EAPI void +EAPI Eina_Bool emotion_object_file_set(Evas_Object *obj, const char *file) { Smart_Data *sd; @@ -322,9 +322,9 @@ emotion_object_file_set(Evas_Object *obj, const char *file) E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); DBG("file=%s", file); - if (!sd->module) return; + if (!sd->module) return EINA_FALSE; - if ((file) && (sd->file) && (!strcmp(file, sd->file))) return; + if ((file) && (sd->file) && (!strcmp(file, sd->file))) return EINA_FALSE; if ((file) && (file[0] != 0)) { int w, h; @@ -334,7 +334,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file) sd->module->file_close(sd->video); evas_object_image_size_set(sd->obj, 1, 1); if (!sd->module->file_open(sd->file, obj, sd->video)) - return; + return EINA_FALSE; sd->module->size_get(sd->video, &w, &h); evas_object_image_size_set(sd->obj, w, h); _emotion_image_data_zero(sd->obj); @@ -353,6 +353,8 @@ emotion_object_file_set(Evas_Object *obj, const char *file) free(sd->file); sd->file = NULL; } + + return EINA_TRUE; } EAPI const char * -- 2.7.4