furrymyad pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a8afffe10584fe5ffc72d3d8c74827c11275a200

commit a8afffe10584fe5ffc72d3d8c74827c11275a200
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Wed Apr 27 16:34:02 2016 +0300

    Edje_Edit: setter and getter for set image's scale_by
    
    edje_edit_image_set_image_border_scale_set
    edje_edit_image_set_image_border_scale_get
---
 src/lib/edje/Edje_Edit.h | 27 ++++++++++++++++++++++++
 src/lib/edje/edje_edit.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 81 insertions(+)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 2aafa8a..f5dd78d 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -5724,6 +5724,33 @@ edje_edit_image_set_image_border_get(Evas_Object *obj, 
const char *set_name, uns
 EAPI Eina_Bool
 edje_edit_image_set_image_border_set(Evas_Object *obj, const char *set_name, 
unsigned int place, int l, int r, int b, int t);
 
+/** Get border scale of set's image.
+ *
+ * @param obj Object being edited.
+ * @param set_name name of image set.
+ * @param place position of image.
+ *
+ * @return @c border scale value on success, @c -1 otherwise.
+ *
+ * @since 1.18
+ */
+EAPI double
+edje_edit_image_set_image_border_scale_get(Evas_Object *obj, const char 
*set_name, unsigned int place);
+
+/** Set border scale of set's image.
+ *
+ * @param obj Object being edited.
+ * @param set_name name of image set.
+ * @param place position of image.
+ * @param scale_by New border scale.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_image_set_image_border_scale_set(Evas_Object *obj, const char 
*set_name, unsigned int place, double scale_by);
+
 //@}
 
/******************************************************************************/
 /**************************   IMAGES API   
************************************/
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 1274087..a5581bf 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -8754,6 +8754,60 @@ edje_edit_image_set_image_border_set(Evas_Object *obj, 
const char *set_name, uns
    return EINA_TRUE;
 }
 
+EAPI double
+edje_edit_image_set_image_border_scale_get(Evas_Object *obj, const char 
*set_name, unsigned int place)
+{
+   Edje_Image_Directory_Set *de = NULL;
+   Edje_Image_Directory_Set_Entry *dim = NULL;
+   unsigned int i;
+
+   GET_ED_OR_RETURN(-1);
+
+   if (!ed->file) return -1;
+   if (!ed->file->image_dir) return -1;
+
+   for (i = 0; i < ed->file->image_dir->sets_count; ++i)
+     {
+        de = ed->file->image_dir->sets + i;
+        if ((de->name) && (!strcmp(set_name, de->name)))
+          break;
+     }
+   if (i == ed->file->image_dir->sets_count) return -1;
+
+   dim = eina_list_nth(de->entries, place);
+   if (!dim) return -1;
+
+   return dim->border.scale_by;
+}
+
+EAPI Eina_Bool
+edje_edit_image_set_image_border_scale_set(Evas_Object *obj, const char 
*set_name, unsigned int place, double scale_by)
+{
+   Edje_Image_Directory_Set *de = NULL;
+   Edje_Image_Directory_Set_Entry *dim = NULL;
+   unsigned int i;
+
+   GET_ED_OR_RETURN(EINA_FALSE);
+
+   if (!ed->file) return EINA_FALSE;
+   if (!ed->file->image_dir) return EINA_FALSE;
+
+   for (i = 0; i < ed->file->image_dir->sets_count; ++i)
+     {
+        de = ed->file->image_dir->sets + i;
+        if ((de->name) && (!strcmp(set_name, de->name)))
+          break;
+     }
+   if (i == ed->file->image_dir->sets_count) return EINA_FALSE;
+
+   dim = eina_list_nth(de->entries, place);
+   if (!dim) return EINA_FALSE;
+
+   if (scale_by >= 0) dim->border.scale_by = scale_by;
+
+   return EINA_TRUE;
+}
+
 /****************/
 /*  IMAGES API  */
 /****************/

-- 


Reply via email to