summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 17:31:54 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 17:37:23 +0900
commitf53fe993a6a285ddb49aa69d6c6856169f37ec63 (patch)
tree2646b7cc283dbc93174075fd26f12faa206182ba /src/lib
parent641a58f735e93fb9e70dc85c006b3da09645bae7 (diff)
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.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/edje_legacy.c7
-rw-r--r--src/lib/edje/edje_object.eo1
-rw-r--r--src/lib/edje/edje_util.c8
-rw-r--r--src/lib/edje/efl_canvas_layout_calc.eo18
-rw-r--r--src/lib/elementary/efl_ui_image.c9
5 files changed, 13 insertions, 30 deletions
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index 78fef00..1f64609 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)
1089EAPI void 1089EAPI void
1090edje_object_size_min_calc(Edje_Object *obj, int *minw, int *minh) 1090edje_object_size_min_calc(Edje_Object *obj, int *minw, int *minh)
1091{ 1091{
1092 Eina_Size2D sz; 1092 edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0);
1093 sz = efl_canvas_layout_calc_size_min(obj);
1094 if (minw) *minw = sz.w;
1095 if (minh) *minh = sz.h;
1096} 1093}
1097 1094
1098EAPI void 1095EAPI void
1099edje_object_size_min_restricted_calc(Edje_Object *obj, int *minw, int *minh, int restrictedw, int restrictedh) 1096edje_object_size_min_restricted_calc(Edje_Object *obj, int *minw, int *minh, int restrictedw, int restrictedh)
1100{ 1097{
1101 Eina_Size2D sz; 1098 Eina_Size2D sz;
1102 sz = efl_canvas_layout_calc_size_min_restricted(obj, EINA_SIZE2D(restrictedw, restrictedh)); 1099 sz = efl_canvas_layout_calc_size_min(obj, EINA_SIZE2D(restrictedw, restrictedh));
1103 if (minw) *minw = sz.w; 1100 if (minw) *minw = sz.w;
1104 if (minh) *minh = sz.h; 1101 if (minh) *minh = sz.h;
1105} 1102}
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 19528b1..13293c7 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,
770 Efl.Canvas.Group.group_calculate; 770 Efl.Canvas.Group.group_calculate;
771 Efl.Canvas.Layout_Calc.calc_auto_update_hints { get; set; } 771 Efl.Canvas.Layout_Calc.calc_auto_update_hints { get; set; }
772 Efl.Canvas.Layout_Calc.calc_size_min; 772 Efl.Canvas.Layout_Calc.calc_size_min;
773 Efl.Canvas.Layout_Calc.calc_size_min_restricted;
774 Efl.Canvas.Layout_Calc.calc_parts_extends; 773 Efl.Canvas.Layout_Calc.calc_parts_extends;
775 Efl.Canvas.Layout_Calc.calc_freeze; 774 Efl.Canvas.Layout_Calc.calc_freeze;
776 Efl.Canvas.Layout_Calc.calc_thaw; 775 Efl.Canvas.Layout_Calc.calc_thaw;
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index d931f7b..99acd13 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)
3147 _edje_util_freeze_val = pf2; 3147 _edje_util_freeze_val = pf2;
3148} 3148}
3149 3149
3150EOLIAN Eina_Size2D
3151_edje_object_efl_canvas_layout_calc_calc_size_min(Eo *obj, Edje *_pd EINA_UNUSED)
3152{
3153 return efl_canvas_layout_calc_size_min_restricted(obj, EINA_SIZE2D(0, 0));
3154}
3155
3156EOLIAN Eina_Rectangle 3150EOLIAN Eina_Rectangle
3157_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed) 3151_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed)
3158{ 3152{
@@ -3191,7 +3185,7 @@ _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje
3191} 3185}
3192 3186
3193EOLIAN Eina_Size2D 3187EOLIAN Eina_Size2D
3194_edje_object_efl_canvas_layout_calc_calc_size_min_restricted(Eo *obj EINA_UNUSED, Edje *ed, Eina_Size2D restricted) 3188_edje_object_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Edje *ed, Eina_Size2D restricted)
3195{ 3189{
3196 const int CALC_COUNT_LIMIT = 255; 3190 const int CALC_COUNT_LIMIT = 255;
3197 3191
diff --git a/src/lib/edje/efl_canvas_layout_calc.eo b/src/lib/edje/efl_canvas_layout_calc.eo
index 017c5f6..1ed6fdf 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
21 will be notified of the size hints changes. 21 will be notified of the size hints changes.
22 22
23 A layout recalculation can be triggered by @.calc_size_min(), 23 A layout recalculation can be triggered by @.calc_size_min(),
24 @.calc_size_min_restricted(), @.calc_parts_extends() or even any 24 @.calc_size_min(), @.calc_parts_extends() or even any other internal
25 other internal event. 25 event.
26 ]] 26 ]]
27 set { 27 set {
28 [[Enable or disable auto-update of size hints.]] 28 [[Enable or disable auto-update of size hints.]]
@@ -35,23 +35,13 @@ interface Efl.Canvas.Layout_Calc
35 } 35 }
36 } 36 }
37 calc_size_min { 37 calc_size_min {
38 [[Calculates the minimum required size for a given Edje object.
39
40 This call works exactly as edje_object_size_min_restricted_calc(),
41 with the last two arguments set to 0. Please refer to its
42 documentation, then.
43 ]]
44 return: Eina.Size2D; [[The minimum required size.]]
45 }
46 calc_size_min_restricted {
47 [[Calculates the minimum required size for a given layout object. 38 [[Calculates the minimum required size for a given layout object.
48 39
49 This call will trigger an internal recalculation of all parts of 40 This call will trigger an internal recalculation of all parts of
50 the object, in order to return its minimum required dimensions for 41 the object, in order to return its minimum required dimensions for
51 width and height. The user might choose to impose those minimum 42 width and height. The user might choose to impose those minimum
52 sizes, making the resulting calculation to get to values equal or 43 sizes, making the resulting calculation to get to values greater or
53 larger than $restrictedw and $restrictedh, for width and height, 44 equal than $restricted in both directions.
54 respectively.
55 45
56 Note: At the end of this call, the object won't be automatically 46 Note: At the end of this call, the object won't be automatically
57 resized to the new dimensions, but just return the calculated sizes. 47 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 db7298f..a750327 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
1191} 1191}
1192 1192
1193EOLIAN static Eina_Size2D 1193EOLIAN static Eina_Size2D
1194_efl_ui_image_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) 1194_efl_ui_image_efl_canvas_layout_calc_calc_size_min(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Size2D restricted)
1195{ 1195{
1196 if (sd->edje) 1196 if (sd->edje)
1197 return efl_gfx_size_hint_min_get(sd->img); 1197 return efl_canvas_layout_calc_size_min(sd->img, restricted);
1198 else 1198 else
1199 return efl_gfx_size_hint_combined_min_get(sd->img); 1199 {
1200 // Ignore restricted here? Combine with min? Hmm...
1201 return efl_gfx_size_hint_combined_min_get(sd->img);
1202 }
1200} 1203}
1201 1204
1202EOLIAN static void 1205EOLIAN static void