summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2016-04-27 15:42:12 +0300
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2016-07-21 16:40:46 +0300
commitca16f8e827dd5ecdf7cfaa23a26c0e603bbcd626 (patch)
tree19925b0f013672fb73d655a73c37a423e89253b4
parenta23e88deb749a5736245f73a1e09bc341a4d1b1a (diff)
downloadefl-ca16f8e827dd5ecdf7cfaa23a26c0e603bbcd626.tar.gz
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
-rw-r--r--src/lib/edje/Edje_Edit.h60
-rw-r--r--src/lib/edje/edje_edit.c49
2 files changed, 109 insertions, 0 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index c96470fc63..c982a74045 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -5340,6 +5340,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 110521ba32..26ee98abb7 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -8329,6 +8329,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 */
/****************/