Photo: Use file interface.
authorTom Hacohen <tom@stosb.com>
Tue, 22 Jul 2014 15:20:31 +0000 (16:20 +0100)
committerTom Hacohen <tom@stosb.com>
Thu, 21 Aug 2014 10:04:28 +0000 (11:04 +0100)
src/lib/elm_photo.c
src/lib/elm_photo.eo
src/lib/elm_photo_legacy.h

index ba0ee5b..2bf5838 100644 (file)
@@ -324,7 +324,7 @@ _elm_photo_eo_base_constructor(Eo *obj, Elm_Photo_Data *_pd EINA_UNUSED)
 }
 
 EOLIAN static Eina_Bool
-_elm_photo_file_set(Eo *obj, Elm_Photo_Data *sd, const char *file)
+_elm_photo_efl_file_file_set(Eo *obj, Elm_Photo_Data *sd, const char *file, const char *key EINA_UNUSED)
 {
    if (!file)
      {
@@ -410,4 +410,10 @@ _elm_photo_class_constructor(Eo_Class *klass)
    evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
 }
 
+EAPI Eina_Bool
+elm_photo_file_set(Eo *obj, const char *file)
+{
+   return eo_do((Eo *) obj, efl_file_set(file, NULL));
+}
+
 #include "elm_photo.eo.c"
index ba414d7..1847cb5 100644 (file)
@@ -1,4 +1,4 @@
-class Elm_Photo (Elm_Widget, Evas.Clickable_Interface, Evas.Draggable_Interface)
+class Elm_Photo (Elm_Widget, Efl.File, Evas.Clickable_Interface, Evas.Draggable_Interface)
 {
    eo_prefix: elm_obj_photo;
    properties {
@@ -74,23 +74,6 @@ class Elm_Photo (Elm_Widget, Evas.Clickable_Interface, Evas.Draggable_Interface)
             int size; /*@ The size of the photo */
          }
       }
-      file {
-         set {
-            /*@
-            Set the file that will be used as the photo widget's image.
-
-            @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
-
-            @note Use @c NULL on @a file to set the photo widget back to it's
-            initial state, which indicates "no photo".
-
-            @ingroup Photo */
-            return: bool;
-         }
-         values {
-            const(char)* file; /*@ The path to file that will be used as @a obj's image. */
-         }
-      }
    }
    methods {
       thumb_set @const {
@@ -107,6 +90,7 @@ class Elm_Photo (Elm_Widget, Evas.Clickable_Interface, Evas.Draggable_Interface)
    implements {
       class.constructor;
       Eo.Base.constructor;
+      Efl.File.file.set;
       Evas.Object_Smart.add;
       Evas.Object_Smart.del;
       Elm_Widget.theme_apply;
index 0c07d8a..8534268 100644 (file)
@@ -8,4 +8,19 @@
  */
 EAPI Evas_Object *elm_photo_add(Evas_Object *parent);
 
-#include "elm_photo.eo.legacy.h"
\ No newline at end of file
+/**
+ *
+ * Set the file that will be used as the photo widget's image.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
+ *
+ * @note Use @c NULL on @a file to set the photo widget back to it's
+ * initial state, which indicates "no photo".
+ *
+ * @ingroup Photo
+ *
+ * @param[in] file The path to file that will be used as @a obj's image.
+ */
+EAPI Eina_Bool elm_photo_file_set(Eo *obj, const char *file);
+
+#include "elm_photo.eo.legacy.h"