summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2016-02-24 13:50:36 +0000
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2016-02-24 13:50:36 +0000
commit9f9032befa7f99dee97b7b6658bf3c7cce675804 (patch)
tree84f7665179d2aac1cbc2c6558dcf9ebffb25ea25
parent0cb676395d2ec2399ed55e11047b1e8a4787c8cc (diff)
downloadefl-9f9032befa7f99dee97b7b6658bf3c7cce675804.tar.gz
Edje_Edit: support image border_scale and border_scale_by setters and getters
-rw-r--r--src/lib/edje/Edje_Edit.h72
-rw-r--r--src/lib/edje/edje_edit.c67
2 files changed, 139 insertions, 0 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 34902602eb..3de71a21ca 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -5717,6 +5717,78 @@ EAPI void edje_edit_state_image_border_get(Evas_Object *obj, const char *part, c
*/
EAPI Eina_Bool edje_edit_state_image_border_set(Evas_Object *obj, const char *part, const char *state, double value, int l, int r, int t, int b);
+/** Get the border scale value of a part state.
+ *
+ * This value tells Edje if the border should be scaled by
+ * the object/global edje scale factors
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain state.
+ * @param state The name of the state to get the image border scale (not
+ * including the state value).
+ * @param value The state value.
+ *
+ * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_state_image_border_scale_get(Evas_Object *obj, const char *part, const char *state, double value);
+
+/** Set the border scale value of a part state.
+ *
+ * This value tells Edje if the border should be scaled by
+ * the object/global edje scale factors
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain state.
+ * @param state The name of the state to set the image border scale (not
+ * including the state value).
+ * @param value The state value.
+ * @param scale New image border scale value.
+ *
+ * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_state_image_border_scale_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool scale);
+
+/** Get the border scale by value of a part state.
+ *
+ * Valid values are: 0.0 or bigger (0.0 or 1.0 to turn it off)
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain state.
+ * @param state The name of the state to get the image border scale by (not
+ * including the state value).
+ * @param value The state value.
+ *
+ * @return border scaling value.
+ *
+ * @since 1.18
+ */
+EAPI double
+edje_edit_state_image_border_scale_by_get(Evas_Object *obj, const char *part, const char *state, double value);
+
+/** Set the border scale by value of a part state.
+ *
+ * Valid values are: 0.0 or bigger (0.0 or 1.0 to turn it off)
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain state.
+ * @param state The name of the state to set the image border scale by (not
+ * including the state value).
+ * @param value The state value.
+ * @param scale New image border scale value.
+ *
+ * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
+ *
+ * @since 1.18
+ */
+EAPI Eina_Bool
+edje_edit_state_image_border_scale_by_set(Evas_Object *obj, const char *part, const char *state, double value, double scale);
+
/** Get if the image center should be draw.
*
* 1 or 2 means to draw the center, 0 to don't draw it.
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 3e58451f68..9c0a49525f 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -9211,6 +9211,73 @@ edje_edit_state_image_border_set(Evas_Object *obj, const char *part, const char
return EINA_TRUE;
}
+EAPI Eina_Bool
+edje_edit_state_image_border_scale_get(Evas_Object *obj, const char *part, const char *state, double value)
+{
+ Edje_Part_Description_Image *img;
+
+ GET_PD_OR_RETURN(EINA_FALSE);
+
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return EINA_FALSE;
+
+ img = (Edje_Part_Description_Image *)pd;
+
+ return img->image.border.scale;
+}
+
+EAPI Eina_Bool
+edje_edit_state_image_border_scale_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool scale)
+{
+ Edje_Part_Description_Image *img;
+
+ GET_PD_OR_RETURN(EINA_FALSE);
+
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return EINA_FALSE;
+
+ img = (Edje_Part_Description_Image *)pd;
+
+ img->image.border.scale = scale;
+
+ return EINA_TRUE;
+}
+
+EAPI double
+edje_edit_state_image_border_scale_by_get(Evas_Object *obj, const char *part, const char *state, double value)
+{
+ Edje_Part_Description_Image *img;
+
+ GET_PD_OR_RETURN(EINA_FALSE);
+
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return EINA_FALSE;
+
+ img = (Edje_Part_Description_Image *)pd;
+
+ return TO_DOUBLE(img->image.border.scale_by);
+}
+
+EAPI Eina_Bool
+edje_edit_state_image_border_scale_by_set(Evas_Object *obj, const char *part, const char *state, double value, double border_scale)
+{
+ Edje_Part_Description_Image *img;
+
+ GET_PD_OR_RETURN(EINA_FALSE);
+
+ if (border_scale < 0.0)
+ return EINA_FALSE;
+
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return EINA_FALSE;
+
+ img = (Edje_Part_Description_Image *)pd;
+
+ img->image.border.scale_by = FROM_DOUBLE(border_scale);
+
+ return EINA_TRUE;
+}
+
EAPI unsigned char
edje_edit_state_image_border_fill_get(Evas_Object *obj, const char *part, const char *state, double value)
{