summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-08-12 11:14:49 -0400
committerCedric BAIL <cedric.bail@free.fr>2019-08-14 12:08:13 -0700
commite1fda2cbdb435c251ced9843bc87dd7f99639fb7 (patch)
treee911e9ef240517ad1be322300a50955ce3f689cf
parentc3f78d8b4f860956943d8fa9714b1ae13c48febe (diff)
efl/hints: add restricted and combined max size hints
these function the same as the min size hint versions and enable distinction between internally-set max size hints and user-set max size hints @feature ref T8122 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D9553
-rw-r--r--src/lib/ecore_evas/ecore_evas_util.c2
-rw-r--r--src/lib/edje/edje_util.c2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_hint.eo49
-rw-r--r--src/lib/elementary/efl_ui_container_layout.c2
-rw-r--r--src/lib/elementary/efl_ui_flip.c12
-rw-r--r--src/lib/elementary/efl_ui_frame.c5
-rw-r--r--src/lib/elementary/efl_ui_image.c2
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c7
-rw-r--r--src/lib/elementary/efl_ui_list_view_precise_layouter.c2
-rw-r--r--src/lib/elementary/efl_ui_relative_layout.c2
-rw-r--r--src/lib/elementary/efl_ui_scroller.c2
-rw-r--r--src/lib/elementary/efl_ui_win.c8
-rw-r--r--src/lib/evas/Evas_Internal.h9
-rw-r--r--src/lib/evas/canvas/efl_canvas_object.eo2
-rw-r--r--src/lib/evas/canvas/evas_object_main.c98
-rw-r--r--src/lib/evas/include/evas_private.h2
16 files changed, 170 insertions, 36 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_util.c b/src/lib/ecore_evas/ecore_evas_util.c
index fb4a9aa7a5..4f3e9c4baa 100644
--- a/src/lib/ecore_evas/ecore_evas_util.c
+++ b/src/lib/ecore_evas/ecore_evas_util.c
@@ -136,7 +136,7 @@ _ecore_evas_object_callback_changed_size_hints(void *data, Evas *e EINA_UNUSED,
136 evas_object_size_hint_combined_min_get(obj, &w, &h); 136 evas_object_size_hint_combined_min_get(obj, &w, &h);
137 ecore_evas_size_min_set(ee, w, h); 137 ecore_evas_size_min_set(ee, w, h);
138 138
139 evas_object_size_hint_max_get(obj, &w, &h); 139 evas_object_size_hint_combined_max_get(obj, &w, &h);
140 if (w < 1) w = -1; 140 if (w < 1) w = -1;
141 if (h < 1) h = -1; 141 if (h < 1) h = -1;
142 ecore_evas_size_max_set(ee, w, h); 142 ecore_evas_size_max_set(ee, w, h);
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index ec6b841985..2f6c5b2d22 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -6021,7 +6021,7 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp)
6021 Evas_Aspect_Control am = EVAS_ASPECT_CONTROL_NONE; 6021 Evas_Aspect_Control am = EVAS_ASPECT_CONTROL_NONE;
6022 6022
6023 evas_object_size_hint_combined_min_get(rp->typedata.swallow->swallowed_object, &w1, &h1); 6023 evas_object_size_hint_combined_min_get(rp->typedata.swallow->swallowed_object, &w1, &h1);
6024 evas_object_size_hint_max_get(rp->typedata.swallow->swallowed_object, &w2, &h2); 6024 evas_object_size_hint_combined_max_get(rp->typedata.swallow->swallowed_object, &w2, &h2);
6025 evas_object_size_hint_aspect_get(rp->typedata.swallow->swallowed_object, &am, &aw, &ah); 6025 evas_object_size_hint_aspect_get(rp->typedata.swallow->swallowed_object, &am, &aw, &ah);
6026 rp->typedata.swallow->swallow_params.min.w = w1; 6026 rp->typedata.swallow->swallow_params.min.w = w1;
6027 rp->typedata.swallow->swallow_params.min.h = h1; 6027 rp->typedata.swallow->swallow_params.min.h = h1;
diff --git a/src/lib/efl/interfaces/efl_gfx_hint.eo b/src/lib/efl/interfaces/efl_gfx_hint.eo
index 42d1b7a7f2..d00c83e246 100644
--- a/src/lib/efl/interfaces/efl_gfx_hint.eo
+++ b/src/lib/efl/interfaces/efl_gfx_hint.eo
@@ -75,6 +75,51 @@ interface Efl.Gfx.Hint
75 default for canvas objects).]] 75 default for canvas objects).]]
76 } 76 }
77 } 77 }
78 @property hint_size_restricted_max {
79 [[Internal hints for an object's maximum size.
80
81 This is not a size enforcement in any way, it's just a hint
82 that should be used whenever appropriate.
83
84 Values -1 will be treated as unset hint components, when
85 queried by managers.
86
87 Note: This property is internal and meant for widget developers to
88 define the absolute maximum size of the object. EFL itself sets
89 this size internally, so any change to it from an application
90 might be ignored. Applications should use @.hint_size_max instead.
91
92 Note: It is an error for the @.hint_size_restricted_max to be smaller in either axis
93 than @.hint_size_restricted_min. In this scenario, the max size hint will be
94 prioritized over the user min size hint.
95 ]]
96 set @protected {
97 [[This function is protected as it is meant for widgets to indicate
98 their "intrinsic" maximum size.
99 ]]
100 }
101 get {
102 [[Get the "intrinsic" maximum size of this object.]]
103 }
104 values {
105 sz: Eina.Size2D; [[Maximum size (hint) in pixels.]]
106 }
107 }
108 @property hint_size_combined_max {
109 [[Read-only maximum size combining both @.hint_size_restricted_max and
110 @.hint_size_max hints.
111
112 @.hint_size_restricted_max is intended for mostly internal usage
113 and widget developers, and @.hint_size_max is intended to be
114 set from application side. @.hint_size_combined_max combines both values
115 by taking their repective maximum (in both width and height), and
116 is used internally to get an object's maximum size.
117 ]]
118 get {}
119 values {
120 sz: Eina.Size2D; [[Maximum size (hint) in pixels.]]
121 }
122 }
78 @property hint_size_min { 123 @property hint_size_min {
79 [[Hints on the object's minimum size. 124 [[Hints on the object's minimum size.
80 125
@@ -111,6 +156,10 @@ interface Efl.Gfx.Hint
111 define the absolute minimum size of the object. EFL itself sets 156 define the absolute minimum size of the object. EFL itself sets
112 this size internally, so any change to it from an application 157 this size internally, so any change to it from an application
113 might be ignored. Use @.hint_size_min instead. 158 might be ignored. Use @.hint_size_min instead.
159
160 Note: It is an error for the @.hint_size_restricted_max to be smaller in either axis
161 than @.hint_size_restricted_min. In this scenario, the max size hint will be
162 prioritized over the user min size hint.
114 ]] 163 ]]
115 set @protected { 164 set @protected {
116 [[This function is protected as it is meant for widgets to indicate 165 [[This function is protected as it is meant for widgets to indicate
diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c
index 770e55a5dc..34a8bbb49b 100644
--- a/src/lib/elementary/efl_ui_container_layout.c
+++ b/src/lib/elementary/efl_ui_container_layout.c
@@ -53,7 +53,7 @@ _efl_ui_container_layout_item_init(Eo* o, Efl_Ui_Container_Item_Hints *item)
53 efl_gfx_hint_margin_get(o, &item[0].margin[0], &item[0].margin[1], 53 efl_gfx_hint_margin_get(o, &item[0].margin[0], &item[0].margin[1],
54 &item[1].margin[0], &item[1].margin[1]); 54 &item[1].margin[0], &item[1].margin[1]);
55 efl_gfx_hint_fill_get(o, &item[0].fill, &item[1].fill); 55 efl_gfx_hint_fill_get(o, &item[0].fill, &item[1].fill);
56 max = efl_gfx_hint_size_max_get(o); 56 max = efl_gfx_hint_size_combined_max_get(o);
57 min = efl_gfx_hint_size_combined_min_get(o); 57 min = efl_gfx_hint_size_combined_min_get(o);
58 efl_gfx_hint_aspect_get(o, &aspect_type, &aspect); 58 efl_gfx_hint_aspect_get(o, &aspect_type, &aspect);
59 item[0].aspect = aspect.w; 59 item[0].aspect = aspect.w;
diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c
index e24583796d..26f8d848bf 100644
--- a/src/lib/elementary/efl_ui_flip.c
+++ b/src/lib/elementary/efl_ui_flip.c
@@ -67,8 +67,8 @@ static void
67_sizing_eval(Evas_Object *obj) 67_sizing_eval(Evas_Object *obj)
68{ 68{
69 Evas_Coord minw = -1, minh = -1, minw2 = -1, minh2 = -1; 69 Evas_Coord minw = -1, minh = -1, minw2 = -1, minh2 = -1;
70 Evas_Coord maxw = -1, maxh = -1, maxw2 = -1, maxh2 = -1;
71 int fingx = 0, fingy = 0; 70 int fingx = 0, fingy = 0;
71 Eina_Size2D max = EINA_SIZE2D(-1, -1), max2 = EINA_SIZE2D(-1, -1);
72 72
73 EFL_UI_FLIP_DATA_GET(obj, sd); 73 EFL_UI_FLIP_DATA_GET(obj, sd);
74 74
@@ -77,14 +77,14 @@ _sizing_eval(Evas_Object *obj)
77 if (sd->back.content) 77 if (sd->back.content)
78 evas_object_size_hint_combined_min_get(sd->back.content, &minw2, &minh2); 78 evas_object_size_hint_combined_min_get(sd->back.content, &minw2, &minh2);
79 if (sd->front.content) 79 if (sd->front.content)
80 evas_object_size_hint_max_get(sd->front.content, &maxw, &maxh); 80 max = efl_gfx_hint_size_combined_max_get(sd->front.content);
81 if (sd->back.content) 81 if (sd->back.content)
82 evas_object_size_hint_max_get(sd->back.content, &maxw2, &maxh2); 82 max2 = efl_gfx_hint_size_combined_max_get(sd->back.content);
83 83
84 if (minw2 > minw) minw = minw2; 84 if (minw2 > minw) minw = minw2;
85 if (minh2 > minh) minh = minh2; 85 if (minh2 > minh) minh = minh2;
86 if ((maxw2 >= 0) && (maxw2 < maxw)) maxw = maxw2; 86 if ((max2.w >= 0) && (max2.w < max.w)) max.w = max2.w;
87 if ((maxh2 >= 0) && (maxh2 < maxh)) maxh = maxh2; 87 if ((max2.h >= 0) && (max2.h < max.h)) max.h = max2.h;
88 88
89 if (sd->dir_enabled[ELM_FLIP_DIRECTION_UP]) fingy++; 89 if (sd->dir_enabled[ELM_FLIP_DIRECTION_UP]) fingy++;
90 if (sd->dir_enabled[ELM_FLIP_DIRECTION_DOWN]) fingy++; 90 if (sd->dir_enabled[ELM_FLIP_DIRECTION_DOWN]) fingy++;
@@ -94,7 +94,7 @@ _sizing_eval(Evas_Object *obj)
94 elm_coords_finger_size_adjust(fingx, &minw, fingy, &minh); 94 elm_coords_finger_size_adjust(fingx, &minw, fingy, &minh);
95 95
96 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); 96 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
97 evas_object_size_hint_max_set(obj, maxw, maxh); 97 efl_gfx_hint_size_restricted_max_set(obj, max);
98} 98}
99 99
100EOLIAN static Eina_Error 100EOLIAN static Eina_Error
diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c
index 5680fdf901..0e6f230d5b 100644
--- a/src/lib/elementary/efl_ui_frame.c
+++ b/src/lib/elementary/efl_ui_frame.c
@@ -39,7 +39,10 @@ _sizing_eval(Evas_Object *obj,
39 if ((minw == cminw) && (minh == cminh)) return; 39 if ((minw == cminw) && (minh == cminh)) return;
40 40
41 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); 41 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
42 evas_object_size_hint_max_set(obj, -1, -1); 42 if (elm_widget_is_legacy(obj))
43 evas_object_size_hint_max_set(obj, -1, -1);
44 else
45 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
43} 46}
44 47
45static void 48static void
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index c07f2b2ca4..916eb2bb6e 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -803,7 +803,7 @@ _efl_ui_image_sizing_eval(Evas_Object *obj)
803 } 803 }
804 804
805 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); 805 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
806 evas_object_size_hint_max_set(obj, maxw, maxh); 806 efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(maxw, maxh));
807 807
808 if (sd->img) 808 if (sd->img)
809 { 809 {
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 64eda7a52d..88824c3985 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -111,13 +111,12 @@ _photocam_image_file_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd)
111static void 111static void
112_sizing_eval(Evas_Object *obj) 112_sizing_eval(Evas_Object *obj)
113{ 113{
114 Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1; 114 Evas_Coord minw = 0, minh = 0;
115 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 115 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
116 Eina_Size2D max = efl_gfx_hint_size_combined_max_get(wd->resize_obj);
116 117
117 evas_object_size_hint_max_get
118 (wd->resize_obj, &maxw, &maxh);
119 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); 118 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
120 evas_object_size_hint_max_set(obj, maxw, maxh); 119 efl_gfx_hint_size_restricted_max_set(obj, max);
121} 120}
122 121
123static void 122static void
diff --git a/src/lib/elementary/efl_ui_list_view_precise_layouter.c b/src/lib/elementary/efl_ui_list_view_precise_layouter.c
index d20d706d3f..a7ee6ec102 100644
--- a/src/lib/elementary/efl_ui_list_view_precise_layouter.c
+++ b/src/lib/elementary/efl_ui_list_view_precise_layouter.c
@@ -65,7 +65,7 @@ _item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Lay
65 efl_gfx_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb); 65 efl_gfx_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb);
66 efl_gfx_hint_align_get(item->layout, &align[0], &align[1]); 66 efl_gfx_hint_align_get(item->layout, &align[0], &align[1]);
67 efl_gfx_hint_fill_get(item->layout, &fill[0], &fill[1]); 67 efl_gfx_hint_fill_get(item->layout, &fill[0], &fill[1]);
68 max = efl_gfx_hint_size_max_get(item->layout); 68 max = efl_gfx_hint_size_combined_max_get(item->layout);
69 69
70 // box outer margin 70 // box outer margin
71 boxw -= boxl + boxr; 71 boxw -= boxl + boxr;
diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c
index 983a507e71..c591c154c8 100644
--- a/src/lib/elementary/efl_ui_relative_layout.c
+++ b/src/lib/elementary/efl_ui_relative_layout.c
@@ -497,7 +497,7 @@ _hash_child_init_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E
497 calc->aspect[1] = aspect.h; 497 calc->aspect[1] = aspect.h;
498 efl_gfx_hint_margin_get(child->obj, &calc->margin[LEFT], &calc->margin[RIGHT], 498 efl_gfx_hint_margin_get(child->obj, &calc->margin[LEFT], &calc->margin[RIGHT],
499 &calc->margin[TOP], &calc->margin[BOTTOM]); 499 &calc->margin[TOP], &calc->margin[BOTTOM]);
500 max = efl_gfx_hint_size_max_get(child->obj); 500 max = efl_gfx_hint_size_combined_max_get(child->obj);
501 min = efl_gfx_hint_size_combined_min_get(child->obj); 501 min = efl_gfx_hint_size_combined_min_get(child->obj);
502 calc->max[0] = max.w; 502 calc->max[0] = max.w;
503 calc->max[1] = max.h; 503 calc->max[1] = max.h;
diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c
index 56adea8332..cbcb2c97f2 100644
--- a/src/lib/elementary/efl_ui_scroller.c
+++ b/src/lib/elementary/efl_ui_scroller.c
@@ -302,7 +302,7 @@ _efl_ui_scroller_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Scroller_Data
302 if (sd->content) 302 if (sd->content)
303 { 303 {
304 min = efl_gfx_hint_size_combined_min_get(sd->content); 304 min = efl_gfx_hint_size_combined_min_get(sd->content);
305 max = efl_gfx_hint_size_max_get(sd->content); 305 max = efl_gfx_hint_size_combined_max_get(sd->content);
306 efl_gfx_hint_weight_get(sd->content, &xw, &yw); 306 efl_gfx_hint_weight_get(sd->content, &xw, &yw);
307 } 307 }
308 308
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 32f0ded966..c50ec79fa7 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -963,7 +963,7 @@ _elm_win_size_hints_update(Efl_Ui_Win *win, Efl_Ui_Win_Data *sd)
963 Eina_Size2D min, max; 963 Eina_Size2D min, max;
964 964
965 min = efl_gfx_hint_size_combined_min_get(win); 965 min = efl_gfx_hint_size_combined_min_get(win);
966 max = efl_gfx_hint_size_max_get(win); 966 max = efl_gfx_hint_size_combined_max_get(win);
967 if (max.w < 1) max.w = -1; 967 if (max.w < 1) max.w = -1;
968 if (max.h < 1) max.h = -1; 968 if (max.h < 1) max.h = -1;
969 969
@@ -1637,7 +1637,7 @@ _win_rotate(Evas_Object *obj, Efl_Ui_Win_Data *sd, int rotation, Eina_Bool resiz
1637 if (resize) TRAP(sd, rotation_with_resize_set, rotation); 1637 if (resize) TRAP(sd, rotation_with_resize_set, rotation);
1638 else TRAP(sd, rotation_set, rotation); 1638 else TRAP(sd, rotation_set, rotation);
1639 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(-1, -1)); 1639 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(-1, -1));
1640 efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(-1, -1)); 1640 efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(-1, -1));
1641 _elm_win_resize_objects_eval(obj, EINA_FALSE); 1641 _elm_win_resize_objects_eval(obj, EINA_FALSE);
1642#ifdef HAVE_ELEMENTARY_X 1642#ifdef HAVE_ELEMENTARY_X
1643 _elm_win_xwin_update(sd); 1643 _elm_win_xwin_update(sd);
@@ -3701,6 +3701,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
3701 evas_object_size_hint_combined_min_get(sd->legacy.edje, &minw, &minh); 3701 evas_object_size_hint_combined_min_get(sd->legacy.edje, &minw, &minh);
3702 if ((!minw) && (!minh) && (!sd->deferred_resize_job)) return; 3702 if ((!minw) && (!minh) && (!sd->deferred_resize_job)) return;
3703 3703
3704 efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(-1, -1));
3704 // If content has a weight, make resizable 3705 // If content has a weight, make resizable
3705 efl_gfx_hint_weight_get(sd->legacy.edje, &wx, &wy); 3706 efl_gfx_hint_weight_get(sd->legacy.edje, &wx, &wy);
3706 3707
@@ -3722,6 +3723,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
3722 if (maxh > 32767) maxh = 32767; 3723 if (maxh > 32767) maxh = 32767;
3723 3724
3724 unresizable = ((minw == maxw) && (minh == maxh)); 3725 unresizable = ((minw == maxw) && (minh == maxh));
3726
3725 if (sd->csd.need_unresizable != unresizable) 3727 if (sd->csd.need_unresizable != unresizable)
3726 { 3728 {
3727 sd->csd.need_unresizable = unresizable; 3729 sd->csd.need_unresizable = unresizable;
@@ -3741,7 +3743,7 @@ _elm_win_resize_objects_eval(Evas_Object *obj, Eina_Bool force_resize)
3741 3743
3742 sd->tmp_updating_hints = 1; 3744 sd->tmp_updating_hints = 1;
3743 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh)); 3745 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
3744 efl_gfx_hint_size_max_set(obj, EINA_SIZE2D(maxw, maxh)); 3746 efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(maxw, maxh));
3745 sd->tmp_updating_hints = 0; 3747 sd->tmp_updating_hints = 0;
3746 _elm_win_size_hints_update(obj, sd); 3748 _elm_win_size_hints_update(obj, sd);
3747 3749
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index 48b7928014..2958977275 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -61,6 +61,15 @@ evas_object_size_hint_combined_min_get(const Eo *obj, int *w, int *h)
61 if (h) *h = sz.h; 61 if (h) *h = sz.h;
62} 62}
63 63
64static inline void
65evas_object_size_hint_combined_max_get(const Eo *obj, int *w, int *h)
66{
67 Eina_Size2D sz;
68 sz = efl_gfx_hint_size_combined_max_get(obj);
69 if (w) *w = sz.w;
70 if (h) *h = sz.h;
71}
72
64/* Internal EO APIs */ 73/* Internal EO APIs */
65EAPI Eo *evas_find(const Eo *obj); 74EAPI Eo *evas_find(const Eo *obj);
66EOAPI void efl_canvas_object_legacy_ctor(Eo *obj); 75EOAPI void efl_canvas_object_legacy_ctor(Eo *obj);
diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo
index ff4703e25a..51154068f9 100644
--- a/src/lib/evas/canvas/efl_canvas_object.eo
+++ b/src/lib/evas/canvas/efl_canvas_object.eo
@@ -540,7 +540,9 @@ abstract Efl.Canvas.Object extends Efl.Loop_Consumer implements Efl.Gfx.Entity,
540 Efl.Gfx.Hint.hint_aspect { get; set; } 540 Efl.Gfx.Hint.hint_aspect { get; set; }
541 Efl.Gfx.Hint.hint_align { get; set; } 541 Efl.Gfx.Hint.hint_align { get; set; }
542 Efl.Gfx.Hint.hint_size_combined_min { get; } 542 Efl.Gfx.Hint.hint_size_combined_min { get; }
543 Efl.Gfx.Hint.hint_size_combined_max { get; }
543 Efl.Gfx.Hint.hint_size_restricted_min { get; set; } 544 Efl.Gfx.Hint.hint_size_restricted_min { get; set; }
545 Efl.Gfx.Hint.hint_size_restricted_max { get; set; }
544 Efl.Gfx.Hint.hint_size_min { get; set; } 546 Efl.Gfx.Hint.hint_size_min { get; set; }
545 Efl.Gfx.Hint.hint_size_max { get; set; } 547 Efl.Gfx.Hint.hint_size_max { get; set; }
546 Efl.Gfx.Hint.hint_margin { get; set; } 548 Efl.Gfx.Hint.hint_margin { get; set; }
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 257d4ff1b9..1280cce9ec 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -1405,6 +1405,8 @@ _evas_object_size_hint_alloc(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protec
1405 obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints); 1405 obj->size_hints = EVAS_MEMPOOL_ALLOC(_mp_sh, Evas_Size_Hints);
1406 if (!obj->size_hints) return; 1406 if (!obj->size_hints) return;
1407 EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints); 1407 EVAS_MEMPOOL_PREP(_mp_sh, obj->size_hints, Evas_Size_Hints);
1408 obj->size_hints->user_max.w = -1;
1409 obj->size_hints->user_max.h = -1;
1408 obj->size_hints->max.w = -1; 1410 obj->size_hints->max.w = -1;
1409 obj->size_hints->max.h = -1; 1411 obj->size_hints->max.h = -1;
1410 obj->size_hints->align.x = 0.5; 1412 obj->size_hints->align.x = 0.5;
@@ -1444,6 +1446,37 @@ evas_object_size_hint_display_mode_set(Eo *eo_obj, Evas_Display_Mode dispmode)
1444} 1446}
1445 1447
1446EOLIAN static Eina_Size2D 1448EOLIAN static Eina_Size2D
1449_efl_canvas_object_efl_gfx_hint_hint_size_restricted_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
1450{
1451 if ((!obj->size_hints) || obj->delete_me)
1452 return EINA_SIZE2D(0, 0);
1453
1454 return obj->size_hints->max;
1455}
1456
1457EOLIAN static void
1458_efl_canvas_object_efl_gfx_hint_hint_size_restricted_max_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz)
1459{
1460 if (obj->delete_me)
1461 return;
1462
1463 EVAS_OBJECT_DATA_VALID_CHECK(obj);
1464 evas_object_async_block(obj);
1465 if (EINA_UNLIKELY(!obj->size_hints))
1466 {
1467 if (!sz.w && !sz.h) return;
1468 _evas_object_size_hint_alloc(eo_obj, obj);
1469 }
1470 if ((obj->size_hints->max.w == sz.w) && (obj->size_hints->max.h == sz.h)) return;
1471 obj->size_hints->max = sz;
1472 if ((obj->size_hints->max.w != -1) && (obj->size_hints->max.w < obj->size_hints->min.w))
1473 ERR("restricted max width hint is now smaller than restricted min width hint! (%d < %d)", obj->size_hints->max.w, obj->size_hints->min.w);
1474 if ((obj->size_hints->max.h != -1) && (obj->size_hints->max.h < obj->size_hints->min.h))
1475 ERR("restricted max height hint is now smaller than restricted min height hint! (%d < %d)", obj->size_hints->max.h, obj->size_hints->min.h);
1476 evas_object_inform_call_changed_size_hints(eo_obj, obj);
1477}
1478
1479EOLIAN static Eina_Size2D
1447_efl_canvas_object_efl_gfx_hint_hint_size_restricted_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 1480_efl_canvas_object_efl_gfx_hint_hint_size_restricted_min_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
1448{ 1481{
1449 if ((!obj->size_hints) || obj->delete_me) 1482 if ((!obj->size_hints) || obj->delete_me)
@@ -1467,7 +1500,10 @@ _efl_canvas_object_efl_gfx_hint_hint_size_restricted_min_set(Eo *eo_obj, Evas_Ob
1467 } 1500 }
1468 if ((obj->size_hints->min.w == sz.w) && (obj->size_hints->min.h == sz.h)) return; 1501 if ((obj->size_hints->min.w == sz.w) && (obj->size_hints->min.h == sz.h)) return;
1469 obj->size_hints->min = sz; 1502 obj->size_hints->min = sz;
1470 1503 if ((obj->size_hints->max.w != -1) && (obj->size_hints->max.w < obj->size_hints->min.w))
1504 ERR("restricted max width hint is now smaller than restricted min width hint! (%d < %d)", obj->size_hints->max.w, obj->size_hints->min.w);
1505 if ((obj->size_hints->max.h != -1) && (obj->size_hints->max.h < obj->size_hints->min.h))
1506 ERR("restricted max height hint is now smaller than restricted min height hint! (%d < %d)", obj->size_hints->max.h, obj->size_hints->min.h);
1471 evas_object_inform_call_changed_size_hints(eo_obj, obj); 1507 evas_object_inform_call_changed_size_hints(eo_obj, obj);
1472} 1508}
1473 1509
@@ -1486,19 +1522,53 @@ _efl_canvas_object_efl_gfx_hint_hint_size_combined_min_get(const Eo *eo_obj EINA
1486 if (obj->size_hints->max.h != -1) 1522 if (obj->size_hints->max.h != -1)
1487 sz.h = obj->size_hints->max.h; 1523 sz.h = obj->size_hints->max.h;
1488 1524
1489 /* clamp user min to user max here */ 1525 /* clamp user min to restricted max here */
1490 sz.w = MAX(obj->size_hints->min.w, MIN(sz.w, obj->size_hints->user_min.w)); 1526 sz.w = MAX(obj->size_hints->min.w, MIN(sz.w, obj->size_hints->user_min.w));
1491 sz.h = MAX(obj->size_hints->min.h, MIN(sz.h, obj->size_hints->user_min.h)); 1527 sz.h = MAX(obj->size_hints->min.h, MIN(sz.h, obj->size_hints->user_min.h));
1492 return sz; 1528 return sz;
1493} 1529}
1494 1530
1495EOLIAN static Eina_Size2D 1531EOLIAN static Eina_Size2D
1532_efl_canvas_object_efl_gfx_hint_hint_size_combined_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
1533{
1534 Eina_Size2D sz = { -1, -1 };
1535
1536 if ((!obj->size_hints) || obj->delete_me)
1537 return sz;
1538
1539 sz.w = obj->size_hints->user_max.w;
1540 sz.h = obj->size_hints->user_max.h;
1541
1542 /* clamp user max to restricted max here */
1543 if (obj->size_hints->max.w != -1)
1544 {
1545 if (sz.w == -1)
1546 sz.w = obj->size_hints->max.w;
1547 else
1548 sz.w = MIN(obj->size_hints->max.w, sz.w);
1549 }
1550 if (obj->size_hints->max.h != -1)
1551 {
1552 if (sz.h == -1)
1553 sz.h = obj->size_hints->max.h;
1554 else
1555 sz.h = MIN(obj->size_hints->max.h, sz.h);
1556 }
1557 /* then clamp to restricted min */
1558 if ((sz.w != -1) && obj->size_hints->min.w > 0)
1559 sz.w = MAX(sz.w, obj->size_hints->min.w);
1560 if ((sz.h != -1) && obj->size_hints->min.h > 0)
1561 sz.h = MAX(sz.h, obj->size_hints->min.h);
1562 return sz;
1563}
1564
1565EOLIAN static Eina_Size2D
1496_efl_canvas_object_efl_gfx_hint_hint_size_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 1566_efl_canvas_object_efl_gfx_hint_hint_size_max_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
1497{ 1567{
1498 if ((!obj->size_hints) || obj->delete_me) 1568 if ((!obj->size_hints) || obj->delete_me)
1499 return EINA_SIZE2D(-1, -1); 1569 return EINA_SIZE2D(-1, -1);
1500 1570
1501 return obj->size_hints->max; 1571 return obj->size_hints->user_max;
1502} 1572}
1503 1573
1504EOLIAN static void 1574EOLIAN static void
@@ -1514,13 +1584,13 @@ _efl_canvas_object_efl_gfx_hint_hint_size_max_set(Eo *eo_obj, Evas_Object_Protec
1514 if ((sz.w == -1) && (sz.h == -1)) return; 1584 if ((sz.w == -1) && (sz.h == -1)) return;
1515 _evas_object_size_hint_alloc(eo_obj, obj); 1585 _evas_object_size_hint_alloc(eo_obj, obj);
1516 } 1586 }
1517 if ((obj->size_hints->max.w == sz.w) && (obj->size_hints->max.h == sz.h)) return; 1587 if ((obj->size_hints->user_max.w == sz.w) && (obj->size_hints->user_max.h == sz.h)) return;
1518 obj->size_hints->max.w = sz.w; 1588 obj->size_hints->user_max.w = sz.w;
1519 obj->size_hints->max.h = sz.h; 1589 obj->size_hints->user_max.h = sz.h;
1520 if ((obj->size_hints->max.w != -1) && (obj->size_hints->max.w < obj->size_hints->user_min.w)) 1590 if ((obj->size_hints->user_max.w != -1) && (obj->size_hints->user_max.w < obj->size_hints->user_min.w))
1521 ERR("max width hint is now smaller than user_min width hint! (%d < %d)", obj->size_hints->max.w, obj->size_hints->user_min.w); 1591 ERR("user_max width hint is now smaller than user_min width hint! (%d < %d)", obj->size_hints->user_max.w, obj->size_hints->user_min.w);
1522 if ((obj->size_hints->max.h != -1) && (obj->size_hints->max.h < obj->size_hints->user_min.h)) 1592 if ((obj->size_hints->user_max.h != -1) && (obj->size_hints->user_max.h < obj->size_hints->user_min.h))
1523 ERR("max height hint is now smaller than user_min height hint! (%d < %d)", obj->size_hints->max.h, obj->size_hints->user_min.h); 1593 ERR("user_max height hint is now smaller than user_min height hint! (%d < %d)", obj->size_hints->user_max.h, obj->size_hints->user_min.h);
1524 1594
1525 evas_object_inform_call_changed_size_hints(eo_obj, obj); 1595 evas_object_inform_call_changed_size_hints(eo_obj, obj);
1526} 1596}
@@ -1584,10 +1654,10 @@ _efl_canvas_object_efl_gfx_hint_hint_size_min_set(Eo *eo_obj, Evas_Object_Protec
1584 } 1654 }
1585 if ((obj->size_hints->user_min.w == sz.w) && (obj->size_hints->user_min.h == sz.h)) return; 1655 if ((obj->size_hints->user_min.w == sz.w) && (obj->size_hints->user_min.h == sz.h)) return;
1586 obj->size_hints->user_min = sz; 1656 obj->size_hints->user_min = sz;
1587 if ((obj->size_hints->max.w != -1) && (obj->size_hints->max.w < obj->size_hints->user_min.w)) 1657 if ((obj->size_hints->user_max.w != -1) && (obj->size_hints->max.w < obj->size_hints->user_min.w))
1588 ERR("max width hint is now smaller than user_min width hint! (%d < %d)", obj->size_hints->max.w, obj->size_hints->user_min.w); 1658 ERR("max width hint is now smaller than min width hint! (%d < %d)", obj->size_hints->user_max.w, obj->size_hints->user_min.w);
1589 if ((obj->size_hints->max.h != -1) && (obj->size_hints->max.h < obj->size_hints->user_min.h)) 1659 if ((obj->size_hints->user_max.h != -1) && (obj->size_hints->max.h < obj->size_hints->user_min.h))
1590 ERR("max height hint is now smaller than user_min height hint! (%d < %d)", obj->size_hints->max.h, obj->size_hints->user_min.h); 1660 ERR("max height hint is now smaller than min height hint! (%d < %d)", obj->size_hints->user_max.h, obj->size_hints->user_min.h);
1591 evas_object_inform_call_changed_size_hints(eo_obj, obj); 1661 evas_object_inform_call_changed_size_hints(eo_obj, obj);
1592} 1662}
1593 1663
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 4c22706c4a..a5ea99e958 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -959,7 +959,7 @@ struct _Evas_Double_Pair
959struct _Evas_Size_Hints 959struct _Evas_Size_Hints
960{ 960{
961 Evas_Size request; 961 Evas_Size request;
962 Eina_Size2D min, user_min, max; 962 Eina_Size2D min, user_min, max, user_max;
963 Evas_Aspect aspect; 963 Evas_Aspect aspect;
964 Evas_Double_Pair align, weight; 964 Evas_Double_Pair align, weight;
965 Evas_Border padding; 965 Evas_Border padding;