forked from enlightenment/efl
Edje_Edit: support image border_scale and border_scale_by setters and getters
This commit is contained in:
parent
0cb676395d
commit
9f9032befa
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue