summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-07-22 16:20:31 +0100
committerTom Hacohen <tom@stosb.com>2014-08-20 17:14:09 +0100
commit911f2c701e80359c3312501aa95549919b3018e3 (patch)
tree2d682920d844706d89bb2e57ca1a85f6cf717dfb
parent4a681cc4895c950ca51dca5b5a493e45b95c3bcf (diff)
downloadelementary-911f2c701e80359c3312501aa95549919b3018e3.tar.gz
Photo: Use file interface.
-rw-r--r--src/lib/elm_photo.c8
-rw-r--r--src/lib/elm_photo.eo20
-rw-r--r--src/lib/elm_photo_legacy.h17
3 files changed, 25 insertions, 20 deletions
diff --git a/src/lib/elm_photo.c b/src/lib/elm_photo.c
index ba0ee5bdc..2bf583846 100644
--- a/src/lib/elm_photo.c
+++ b/src/lib/elm_photo.c
@@ -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"
diff --git a/src/lib/elm_photo.eo b/src/lib/elm_photo.eo
index ba414d72e..1847cb5f0 100644
--- a/src/lib/elm_photo.eo
+++ b/src/lib/elm_photo.eo
@@ -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;
diff --git a/src/lib/elm_photo_legacy.h b/src/lib/elm_photo_legacy.h
index 0c07d8a26..853426805 100644
--- a/src/lib/elm_photo_legacy.h
+++ b/src/lib/elm_photo_legacy.h
@@ -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"