cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=873eb4151f6c17d11f7a42dc907343e595af189c

commit 873eb4151f6c17d11f7a42dc907343e595af189c
Author: Igor Gala <[email protected]>
Date:   Thu Jun 12 02:20:57 2014 +0200

    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 <[email protected]>
---
 src/lib/edje/Edje_Edit.h | 30 ++++++++++++++++++++++++++++++
 src/lib/edje/edje_edit.c | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index cd35600..0c22157 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -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.
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 3f6ad76..49e1045 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -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  */
 /****************/

-- 


Reply via email to