Thumb: Use file interface.
authorTom Hacohen <tom@stosb.com>
Tue, 22 Jul 2014 15:25:39 +0000 (16:25 +0100)
committerTom Hacohen <tom@stosb.com>
Thu, 21 Aug 2014 10:04:28 +0000 (11:04 +0100)
src/lib/elm_thumb.c
src/lib/elm_thumb.eo
src/lib/elm_thumb_legacy.h

index d6d7d04..7bee347 100644 (file)
@@ -614,8 +614,8 @@ _elm_thumb_reload(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd)
      _thumb_show(sd);
 }
 
-EOLIAN static void
-_elm_thumb_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key)
+EOLIAN static Eina_Bool
+_elm_thumb_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key)
 {
    Eina_Bool file_replaced, key_replaced;
 
@@ -651,10 +651,12 @@ _elm_thumb_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, c
 
    if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj)))
      _thumb_show(sd);
+
+   return EINA_TRUE;
 }
 
 EOLIAN static void
-_elm_thumb_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key)
+_elm_thumb_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key)
 {
    if (file)
      *file = sd->file;
@@ -848,4 +850,17 @@ _elm_thumb_class_constructor(Eo_Class *klass)
    evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
 }
 
+EAPI void
+elm_thumb_file_set(Eo *obj, const char *file, const char *key)
+{
+   eo_do((Eo *) obj, efl_file_set(file, key));
+}
+
+EAPI void
+elm_thumb_file_get(const Eo *obj, const char **file, const char **key)
+{
+   eo_do((Eo *) obj, efl_file_get(file, key));
+}
+
+
 #include "elm_thumb.eo.c"
index c7b230d..e863f89 100644 (file)
@@ -1,4 +1,4 @@
-class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface)
+class Elm_Thumb (Elm_Layout, Efl.File, Evas.Clickable_Interface)
 {
    eo_prefix: elm_obj_thumb;
    properties {
@@ -104,35 +104,6 @@ class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface)
             Ethumb_Thumb_FDO_Size size; /*@ The FDO size setting. */
          }
       }
-      file {
-         set {
-            /*@
-            Set the file that will be used as thumbnail @b source.
-
-            The file can be an image or a video (in that case, acceptable
-            extensions are: avi, mp4, ogv, mov, mpg and wmv). To start the
-            video animation, use the function elm_thumb_animate().
-
-            @see elm_thumb_file_get()
-            @see elm_thumb_reload()
-            @see elm_thumb_animate()
-
-            @ingroup Thumb */
-         }
-         get {
-            /*@
-            Get the image or video path and key used to generate the thumbnail.
-
-            @see elm_thumb_file_set()
-            @see elm_thumb_path_get()
-
-            @ingroup Thumb */
-         }
-         values {
-            const(char)* file; /*@ The path to file that will be used as thumbnail source. */
-            const(char)* key; /*@ The key used in case of an EET file. */
-         }
-      }
       orientation {
          set {
             /*@
@@ -331,6 +302,8 @@ class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface)
    implements {
       class.constructor;
       Eo.Base.constructor;
+      Efl.File.file.set;
+      Efl.File.file.get;
       Evas.Object_Smart.hide;
       Evas.Object_Smart.add;
       Evas.Object_Smart.del;
index 313c805..bd68b28 100644 (file)
  */
 EAPI Evas_Object                *elm_thumb_add(Evas_Object *parent);
 
-#include "elm_thumb.eo.legacy.h"
\ No newline at end of file
+/**
+ *
+ * Set the file that will be used as thumbnail @b source.
+ *
+ * The file can be an image or a video (in that case, acceptable
+ * extensions are: avi, mp4, ogv, mov, mpg and wmv). To start the
+ * video animation, use the function elm_thumb_animate().
+ *
+ * @see elm_thumb_file_get()
+ * @see elm_thumb_reload()
+ * @see elm_thumb_animate()
+ *
+ * @ingroup Thumb
+ *
+ * @param[in] file The path to file that will be used as thumbnail source.
+ * @param[in] key The key used in case of an EET file.
+ */
+EAPI void elm_thumb_file_set(Eo *obj, const char *file, const char *key);
+
+/**
+ *
+ * Get the image or video path and key used to generate the thumbnail.
+ *
+ * @see elm_thumb_file_set()
+ * @see elm_thumb_path_get()
+ *
+ * @ingroup Thumb
+ *
+ * @param[out] file The path to file that will be used as thumbnail source.
+ * @param[out] key The key used in case of an EET file.
+ */
+EAPI void elm_thumb_file_get(const Eo *obj, const char **file, const char **key);
+
+#include "elm_thumb.eo.legacy.h"