jpeg pushed a commit to branch master.

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

commit f53fe993a6a285ddb49aa69d6c6856169f37ec63
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Mon Sep 18 17:31:54 2017 +0900

    edje: Merge calc_size_min_restricted & calc_size_min
    
    calc_size_min was just a helper passing 0,0 to the restricted form.
    Let's not duplicate APIs in EO and use an optional argument instead.
    Bindings should be nicer and C could use a macro if it's too cumbersome
    to pass in 0,0.
---
 src/lib/edje/edje_legacy.c             |  7 ++-----
 src/lib/edje/edje_object.eo            |  1 -
 src/lib/edje/edje_util.c               |  8 +-------
 src/lib/edje/efl_canvas_layout_calc.eo | 18 ++++--------------
 src/lib/elementary/efl_ui_image.c      |  9 ++++++---
 5 files changed, 13 insertions(+), 30 deletions(-)

diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index 78fef003e9..1f64609ea6 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -1089,17 +1089,14 @@ edje_object_update_hints_get(const Edje_Object *obj)
 EAPI void
 edje_object_size_min_calc(Edje_Object *obj, int *minw, int *minh)
 {
-   Eina_Size2D sz;
-   sz = efl_canvas_layout_calc_size_min(obj);
-   if (minw) *minw = sz.w;
-   if (minh) *minh = sz.h;
+   edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0);
 }
 
 EAPI void
 edje_object_size_min_restricted_calc(Edje_Object *obj, int *minw, int *minh, 
int restrictedw, int restrictedh)
 {
    Eina_Size2D sz;
-   sz = efl_canvas_layout_calc_size_min_restricted(obj, 
EINA_SIZE2D(restrictedw, restrictedh));
+   sz = efl_canvas_layout_calc_size_min(obj, EINA_SIZE2D(restrictedw, 
restrictedh));
    if (minw) *minw = sz.w;
    if (minh) *minh = sz.h;
 }
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 19528b1b27..13293c7d5d 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -770,7 +770,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, 
Efl.Container, Efl.Part,
       Efl.Canvas.Group.group_calculate;
       Efl.Canvas.Layout_Calc.calc_auto_update_hints { get; set; }
       Efl.Canvas.Layout_Calc.calc_size_min;
-      Efl.Canvas.Layout_Calc.calc_size_min_restricted;
       Efl.Canvas.Layout_Calc.calc_parts_extends;
       Efl.Canvas.Layout_Calc.calc_freeze;
       Efl.Canvas.Layout_Calc.calc_thaw;
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index d931f7bcc0..99acd13ea2 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3147,12 +3147,6 @@ _edje_object_efl_canvas_layout_calc_calc_force(Eo *obj 
EINA_UNUSED, Edje *ed)
    _edje_util_freeze_val = pf2;
 }
 
-EOLIAN Eina_Size2D
-_edje_object_efl_canvas_layout_calc_calc_size_min(Eo *obj, Edje *_pd 
EINA_UNUSED)
-{
-   return efl_canvas_layout_calc_size_min_restricted(obj, EINA_SIZE2D(0, 0));
-}
-
 EOLIAN Eina_Rectangle
 _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, 
Edje *ed)
 {
@@ -3191,7 +3185,7 @@ _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo 
*obj EINA_UNUSED, Edje
 }
 
 EOLIAN Eina_Size2D
-_edje_object_efl_canvas_layout_calc_calc_size_min_restricted(Eo *obj 
EINA_UNUSED, Edje *ed, Eina_Size2D restricted)
+_edje_object_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Edje 
*ed, Eina_Size2D restricted)
 {
    const int CALC_COUNT_LIMIT = 255;
 
diff --git a/src/lib/edje/efl_canvas_layout_calc.eo 
b/src/lib/edje/efl_canvas_layout_calc.eo
index 017c5f6c98..1ed6fdf86b 100644
--- a/src/lib/edje/efl_canvas_layout_calc.eo
+++ b/src/lib/edje/efl_canvas_layout_calc.eo
@@ -21,8 +21,8 @@ interface Efl.Canvas.Layout_Calc
            will be notified of the size hints changes.
 
            A layout recalculation can be triggered by @.calc_size_min(),
-           @.calc_size_min_restricted(), @.calc_parts_extends() or even any
-           other internal event.
+           @.calc_size_min(), @.calc_parts_extends() or even any other internal
+           event.
          ]]
          set {
             [[Enable or disable auto-update of size hints.]]
@@ -35,23 +35,13 @@ interface Efl.Canvas.Layout_Calc
          }
       }
       calc_size_min {
-         [[Calculates the minimum required size for a given Edje object.
-
-           This call works exactly as edje_object_size_min_restricted_calc(),
-           with the last two arguments set to 0. Please refer to its
-           documentation, then.
-         ]]
-         return: Eina.Size2D; [[The minimum required size.]]
-      }
-      calc_size_min_restricted {
          [[Calculates the minimum required size for a given layout object.
 
            This call will trigger an internal recalculation of all parts of
            the object, in order to return its minimum required dimensions for
            width and height. The user might choose to impose those minimum
-           sizes, making the resulting calculation to get to values equal or
-           larger than $restrictedw and $restrictedh, for width and height,
-           respectively.
+           sizes, making the resulting calculation to get to values greater or
+           equal than $restricted in both directions.
 
            Note: At the end of this call, the object won't be automatically
            resized to the new dimensions, but just return the calculated sizes.
diff --git a/src/lib/elementary/efl_ui_image.c 
b/src/lib/elementary/efl_ui_image.c
index db7298fd4b..a750327d5c 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -1191,12 +1191,15 @@ _efl_ui_image_efl_canvas_layout_calc_calc_force(Eo *obj 
EINA_UNUSED, Efl_Ui_Imag
 }
 
 EOLIAN static Eina_Size2D
-_efl_ui_image_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, 
Efl_Ui_Image_Data *sd)
+_efl_ui_image_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, 
Efl_Ui_Image_Data *sd, Eina_Size2D restricted)
 {
    if (sd->edje)
-     return efl_gfx_size_hint_min_get(sd->img);
+     return efl_canvas_layout_calc_size_min(sd->img, restricted);
    else
-     return efl_gfx_size_hint_combined_min_get(sd->img);
+     {
+        // Ignore restricted here? Combine with min? Hmm...
+        return efl_gfx_size_hint_combined_min_get(sd->img);
+     }
 }
 
 EOLIAN static void

-- 


Reply via email to