Bg: Use file interface
authorTom Hacohen <tom@stosb.com>
Tue, 22 Jul 2014 14:44:52 +0000 (15:44 +0100)
committerTom Hacohen <tom@stosb.com>
Thu, 21 Aug 2014 10:04:28 +0000 (11:04 +0100)
src/lib/elm_bg.c
src/lib/elm_bg.eo
src/lib/elm_bg_legacy.h

index d746f4b..bc71baf 100644 (file)
@@ -143,7 +143,7 @@ _elm_bg_eo_base_constructor(Eo *obj, Elm_Bg_Data *_pd EINA_UNUSED)
 }
 
 EOLIAN static Eina_Bool
-_elm_bg_file_set(Eo *obj, Elm_Bg_Data *sd, const char *file, const char *group)
+_elm_bg_efl_file_file_set(Eo *obj, Elm_Bg_Data *sd, const char *file, const char *group)
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
 
@@ -197,7 +197,7 @@ _elm_bg_file_set(Eo *obj, Elm_Bg_Data *sd, const char *file, const char *group)
 }
 
 EOLIAN static void
-_elm_bg_file_get(Eo *obj EINA_UNUSED, Elm_Bg_Data *sd, const char **file, const char **group)
+_elm_bg_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Bg_Data *sd, const char **file, const char **group)
 {
    if (file) *file = sd->file;
    if (group) *group = sd->group;
@@ -287,4 +287,16 @@ _elm_bg_class_constructor(Eo_Class *klass)
    evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
 }
 
+EAPI Eina_Bool
+elm_bg_file_set(Eo *obj, const char *file, const char *group)
+{
+   return eo_do((Eo *) obj, efl_file_set(file, group));
+}
+
+EAPI void
+elm_bg_file_get(const Eo *obj, const char **file, const char **group)
+{
+   eo_do((Eo *) obj, efl_file_get(file, group));
+}
+
 #include "elm_bg.eo.c"
index 20c7e9b..0ba1e5e 100644 (file)
@@ -1,4 +1,4 @@
-class Elm_Bg (Elm_Layout)
+class Elm_Bg (Elm_Layout, Efl.File)
 {
    eo_prefix: elm_obj_bg;
    properties {
@@ -69,48 +69,6 @@ class Elm_Bg (Elm_Layout)
             int a; /*@ The blue color component's value */
          }
       }
-      file {
-         set {
-            /*@
-            Set the file (image or edje collection) to give life for the
-            background
-
-            @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
-
-            This sets the image file used in the background object. If the
-            image comes from an Edje group, it will be stretched to completely
-            fill the background object. If it comes from a traditional image file, it
-            will by default be centered in this widget's are (thus retaining
-            its aspect), what could lead to some parts being not visible. You
-            may change the mode of exhibition for a real image file with
-            elm_bg_option_set().
-
-            @note Once the image of @p obj is set, a previously set one will be
-            deleted, even if @p file is @c NULL.
-
-            @note This will only affect the contents of one of the background's
-            swallow spots, namely @c "elm.swallow.background". If you want to
-            achieve the @c Layout's file setting behavior, you'll have to call
-            that method on this object.
-
-            @ingroup Bg */
-            return: bool;
-         }
-         get {
-            /*@
-            Get the file (image or edje collection) set on a given background
-            widget
-
-            @note Use @c NULL pointers on the file components you're not
-            interested in: they'll be ignored by the function.
-
-            @ingroup Bg */
-         }
-         values {
-            const(char)* file; /*@ The file path */
-            const(char)* group; /*@ Optional key (group in Edje) within the file */
-         }
-      }
       load_size {
          set {
             /*@
@@ -144,6 +102,8 @@ class Elm_Bg (Elm_Layout)
       Evas.Object_Smart.add;
       Elm_Layout.content_aliases.get;
       Elm_Layout.sizing_eval;
+      Efl.File.file.set;
+      Efl.File.file.get;
    }
 
 }
index 6f1ccc3..612624c 100644 (file)
@@ -48,4 +48,49 @@ EAPI void                         elm_bg_color_set(Evas_Object *obj, int r, int
  */
 EAPI void                         elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b);
 
-#include "elm_bg.eo.legacy.h"
\ No newline at end of file
+/**
+ *
+ * Set the file (image or edje collection) to give life for the
+ * background
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
+ *
+ * This sets the image file used in the background object. If the
+ * image comes from an Edje group, it will be stretched to completely
+ * fill the background object. If it comes from a traditional image file, it
+ * will by default be centered in this widget's are (thus retaining
+ * its aspect), what could lead to some parts being not visible. You
+ * may change the mode of exhibition for a real image file with
+ * elm_bg_option_set().
+ *
+ * @note Once the image of @p obj is set, a previously set one will be
+ * deleted, even if @p file is @c NULL.
+ *
+ * @note This will only affect the contents of one of the background's
+ * swallow spots, namely @c "elm.swallow.background". If you want to
+ * achieve the @c Layout's file setting behavior, you'll have to call
+ * that method on this object.
+ *
+ * @ingroup Bg
+ *
+ * @param[in] file The file path
+ * @param[in] group Optional key (group in Edje) within the file
+ */
+EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group);
+
+/**
+ *
+ * Get the file (image or edje collection) set on a given background
+ * widget
+ *
+ * @note Use @c NULL pointers on the file components you're not
+ * interested in: they'll be ignored by the function.
+ *
+ * @ingroup Bg
+ *
+ * @param[out] file The file path
+ * @param[out] group Optional key (group in Edje) within the file
+ */
+EAPI void elm_bg_file_get(const Eo *obj, const char **file, const char **group);
+
+#include "elm_bg.eo.legacy.h"