API break: emotion_object_file_set() returns a boolean, now.
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 20 Oct 2010 07:55:20 +0000 (07:55 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 20 Oct 2010 07:55:20 +0000 (07:55 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@53648 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/emotion_test_main.c
src/lib/Emotion.h
src/lib/emotion_smart.c

index e6b3eff..80b0438 100644 (file)
@@ -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);
index 929b30a..009e391 100644 (file)
@@ -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);
index 30d0951..ad64970 100644 (file)
@@ -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 *