edje: Edje_Edit - edje_edit_state_text_size_range_min_max_xet()

Summary:
There are new 'get and set' API for block 'text.size_range'.
Those functions return or set the min and max font size for a given text part.
@feature

Reviewers: seoz, Hermet, cedric, raster

CC: reutskiy.v.v, cedric

Differential Revision: https://phab.enlightenment.org/D997

Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
Igor Gala 2014-06-12 02:20:57 +02:00 committed by Cedric BAIL
parent 206722a6e9
commit 873eb4151f
2 changed files with 63 additions and 0 deletions

View File

@ -3130,6 +3130,7 @@ edje_edit_state_text_text_source_set(Evas_Object *obj, const char *part, const c
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to set the the maximum vertical size of
* @param value Value of the state.
* the container to be equal (not including the state value).
*
* @return The name of part or NULL, if text_source param not a setted.
@ -3145,6 +3146,7 @@ edje_edit_state_text_source_get(Evas_Object *obj, const char *part, const char *
* @param part Part that contain state.
* @param state The name of the state to set the the maximum vertical size of
* the container to be equal (not including the state value).
* @param value Value of the state.
* @param source The text source part name.
*
* @return EINA_TRUE if successful, EINA_FALSE - otherwise.
@ -3204,6 +3206,34 @@ edje_edit_state_text_repch_get(Evas_Object *obj, const char *part, const char *s
EAPI Eina_Bool
edje_edit_state_text_repch_set(Evas_Object *obj, const char *part, const char *state, double value, const char *repch);
/** Get the min and max font size allowed for the text part.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state State in which the part is set.
* @param value Value of the state.
* @param min Minimal value of the font size in points (pt).
* @param max Maximum value of the font size in points (pt).
*
* @return EINA_TRUE if successful, EINA_FALSE - otherwise.
*/
EAPI Eina_Bool
edje_edit_state_text_size_range_min_max_get(Evas_Object *obj, const char *part, const char *state, double value, int *min, int *max);
/** Set the min and max font size allowed for the text part.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state State in which the part is set.
* @param value Value of the state.
* @param min Minimal value of the font size in points (pt).
* @param max Maximum value of the font size in points (pt).
*
* @return EINA_TRUE if successful, EINA_FALSE - otherwise.
*/
EAPI Eina_Bool
edje_edit_state_text_size_range_min_max_set(Evas_Object *obj, const char *part, const char *state, double value, int min, int max);
/** Get the list of all the fonts in the given edje.
*
* Use edje_edit_string_list_free() when you don't need the list anymore.

View File

@ -5612,6 +5612,39 @@ edje_edit_state_text_repch_set(Evas_Object *obj, const char *part, const char *s
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_text_size_range_min_max_get(Evas_Object *obj, const char *part, const char *state, double value, int *min, int *max)
{
Edje_Part_Description_Text *txt;
GET_PD_OR_RETURN(EINA_FALSE);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
return EINA_FALSE;
txt = (Edje_Part_Description_Text *) pd;
if (min) *min = txt->text.size_range_min;
if (max) *max = txt->text.size_range_max;
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_text_size_range_min_max_set(Evas_Object *obj, const char *part, const char *state, double value, int min, int max)
{
Edje_Part_Description_Text *txt;
GET_PD_OR_RETURN(EINA_FALSE);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
return EINA_FALSE;
txt = (Edje_Part_Description_Text *) pd;
txt->text.size_range_min = min;
txt->text.size_range_max = max;
edje_object_calc_force(obj);
return EINA_TRUE;
}
/****************/
/* IMAGES API */
/****************/