furrymyad pushed a commit to branch master.

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

commit 458981630966b140897c976689f1a726cdc92cd2
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Wed Apr 27 15:42:12 2016 +0300

    Edje_Edit: setters and getters for set's image size (min and max)
    
    Functions are:
    edje_edit_image_set_image_min_get
    edje_edit_image_set_image_min_set
    edje_edit_image_set_image_max_get
    edje_edit_image_set_image_max_set
---
 src/lib/edje/Edje_Edit.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/lib/edje/edje_edit.c | 49 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 109 insertions(+)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 963f44d..4af9beb 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -5630,6 +5630,66 @@ edje_edit_image_set_image_add(Evas_Object *obj, const 
char *set_name, const char
 EAPI Eina_Bool
 edje_edit_image_set_image_del(Evas_Object *obj, const char *set_name, unsigned 
int place);
 
+/** Get min size of set's image.
+ *
+ * @param obj Object being edited.
+ * @param set_name name of image set.
+ * @param place position of image.
+ * @param w Where to store the width min value.
+ * @param h Where to store the height min value.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_image_set_image_min_get(Evas_Object *obj, const char *set_name, 
unsigned int place, int *w, int *h);
+
+/** Set min size of set's image.
+ *
+ * @param obj Object being edited.
+ * @param set_name name of image set.
+ * @param place position of image.
+ * @param w New value of picture's min width.
+ * @param h New value of picture's min height.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_image_set_image_min_set(Evas_Object *obj, const char *set_name, 
unsigned int place, int w, int h);
+
+/** Get max size of set's image.
+ *
+ * @param obj Object being edited.
+ * @param set_name name of image set.
+ * @param place position of image.
+ * @param w Where to store the width max value.
+ * @param h Where to store the height max value.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_image_set_image_max_get(Evas_Object *obj, const char *set_name, 
unsigned int place, int *w, int *h);
+
+/** Set max size of set's image.
+ *
+ * @param obj Object being edited.
+ * @param set_name name of image set.
+ * @param place position of image.
+ * @param w New value of picture's max width.
+ * @param h New value of picture's max height.
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_image_set_image_max_set(Evas_Object *obj, const char *set_name, 
unsigned int place, int w, int h);
+
 //@}
 
/******************************************************************************/
 /**************************   IMAGES API   
************************************/
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 5ab0a3c..7056e66 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -8643,6 +8643,55 @@ edje_edit_image_set_image_del(Evas_Object *obj, const 
char *set_name, unsigned i
    return EINA_TRUE;
 }
 
+#define FUNC_IMAGE_SET_API_SIZE(Value) \
+ EAPI Eina_Bool \
+ edje_edit_image_set_image_##Value##_get(Evas_Object *obj, const char 
*set_name, unsigned int place, int *w, int *h) \
+ { \
+    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 (w) *w = dim->size.Value.w; \
+    if (h) *h = dim->size.Value.h; \
+    return EINA_TRUE; \
+ } \
+ EAPI Eina_Bool \
+ edje_edit_image_set_image_##Value##_set(Evas_Object *obj, const char 
*set_name, unsigned int place, int w, int h) \
+ { \
+    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; \
+    dim->size.Value.w = w; \
+    dim->size.Value.h = h; \
+    return EINA_TRUE; \
+ }
+
+FUNC_IMAGE_SET_API_SIZE(min);
+FUNC_IMAGE_SET_API_SIZE(max);
+
 /****************/
 /*  IMAGES API  */
 /****************/

-- 


Reply via email to