cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9fc79298293e15074b8e92bd700883a2dbb4de18

commit 9fc79298293e15074b8e92bd700883a2dbb4de18
Author: Vorobiov Vitalii <[email protected]>
Date:   Mon Jul 7 15:23:50 2014 +0200

    edje: Edje_Edit - add edje_edit_part_item_weight functions.
    
    Summary:
    Add four main functions to deal with TABLE or BOX items:
    - edje_edit_part_item_weight_x_get
    - edje_edit_part_item_weight_x_set
    - edje_edit_part_item_weight_y_get
    - edje_edit_part_item_weight_y_set
    
    @feature
    
    Reviewers: cedric, raster, seoz, Hermet
    
    CC: reutskiy.v.v, cedric
    
    Differential Revision: https://phab.enlightenment.org/D1131
    
    Signed-off-by: Cedric BAIL <[email protected]>
---
 src/lib/edje/Edje_Edit.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 src/lib/edje/edje_edit.c | 10 ++++++----
 2 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 7868ca5..cd35c4f 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -2114,6 +2114,52 @@ EAPI double edje_edit_part_item_align_y_get(Evas_Object 
*obj, const char *part,
  */
 EAPI Eina_Bool edje_edit_part_item_align_y_set(Evas_Object *obj, const char 
*part, const char *item, double align_y);
 
+/** Get the horizontal weight value of a part item.
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain item.
+ * @param item The name of the item to get horizontal weight value.
+ *
+ * @return The horizontal weight value for the given item (value is between 
-1.0 and 1.0)
+ * @since 1.11
+ */
+EAPI double edje_edit_part_item_weight_x_get(Evas_Object *obj, const char 
*part, const char *item);
+
+/** Set the horizontal we value of a part item.
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain itemf
+ * @param item The name of the item to set horizontal weight value.
+ * @param weight_x New value of the horizontal weight.
+ *
+ * @return @c EINA_TRUE If successfull, @c EINA_FALSE otherwise.
+ * @since 1.11
+ */
+EAPI Eina_Bool edje_edit_part_item_weight_x_set(Evas_Object *obj, const char 
*part, const char *item, double weight_x);
+
+/** Get the vertical weight value of a part item.
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain item.
+ * @param item The name of the item to get vertical weight value.
+ *
+ * @return The vertical weight value for the given item (value is between -1.0 
and 1.0)
+ * @since 1.11
+ */
+EAPI double edje_edit_part_item_weight_y_get(Evas_Object *obj, const char 
*part, const char *item);
+
+/** Set the vertical weight value of a part item.
+ *
+ * @param obj Object being edited.
+ * @param part Part that contain item.
+ * @param item The name of the item to set vertical weight value.
+ * @param weight_y New value of the vertical weight.
+ *
+ * @return @c EINA_TRUE If successfull, @c EINA_FALSE otherwise.
+ * @since 1.11
+ */
+EAPI Eina_Bool edje_edit_part_item_weight_y_set(Evas_Object *obj, const char 
*part, const char *item, double weight_y);
+
 /** Get column/row position of the part's item.
  *
  * @param obj Object being edited.
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 91947bc..6924b91 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -4372,7 +4372,7 @@ edje_edit_part_item_padding_set(Evas_Object *obj, const 
char *part, const char *
    return EINA_TRUE;
 }
 
-#define FUNC_PART_ITEM_DOUBLE(Name, Value)                             \
+#define FUNC_PART_ITEM_DOUBLE(Name, Value, Min, Max)                   \
   EAPI double                                                          \
   edje_edit_part_item_##Name##_get(Evas_Object *obj, const char *part, const 
char *item_name) \
   {                                                                    \
@@ -4402,7 +4402,7 @@ edje_edit_part_item_padding_set(Evas_Object *obj, const 
char *part, const char *
      Edje_Pack_Element *item = NULL;                                   \
      if ((!obj) || (!part) || (!item_name))                            \
        return EINA_FALSE;                                              \
-     if ((v < -1.0) || (v > 1.0))                                      \
+     if ((v < Min) || (v > Max))                                       \
        return EINA_FALSE;                                              \
      GET_RP_OR_RETURN(EINA_FALSE);                                     \
      ep = rp->part;                                                    \
@@ -4422,8 +4422,10 @@ edje_edit_part_item_padding_set(Evas_Object *obj, const 
char *part, const char *
      return EINA_TRUE;                                                  \
   }
 
-FUNC_PART_ITEM_DOUBLE(align_x, align.x);
-FUNC_PART_ITEM_DOUBLE(align_y, align.y);
+FUNC_PART_ITEM_DOUBLE(align_x, align.x, -1.0, 1.0);
+FUNC_PART_ITEM_DOUBLE(align_y, align.y, -1.0, 1.0);
+FUNC_PART_ITEM_DOUBLE(weight_x, weight.x, 0.0, 99999.990);
+FUNC_PART_ITEM_DOUBLE(weight_y, weight.y, 0.0, 99999.990);
 
 #undef FUNC_PART_ITEM_DOUBLE
 

-- 


Reply via email to