if (ed->update_hints && ed->recalc_hints && !ed->calc_only)
{
- Evas_Coord w, h;
+ Eina_Size2D min;
ed->recalc_hints = EINA_FALSE;
- edje_object_size_min_calc(ed->obj, &w, &h);
- efl_gfx_size_hint_restricted_min_set(ed->obj, w, h);
+ edje_object_size_min_calc(ed->obj, &min.w, &min.h);
+ efl_gfx_size_hint_restricted_min_set(ed->obj, min);
}
if (!ed->collection) return;
(((((Edje_Part_Description_Table *)chosen_desc)->table.min.h) ||
(((Edje_Part_Description_Table *)chosen_desc)->table.min.v))))
{
- Evas_Coord lminw = 0, lminh = 0;
+ Eina_Size2D lmin;
efl_canvas_group_need_recalculate_set(ep->object, 1);
efl_canvas_group_calculate(ep->object);
- efl_gfx_size_hint_restricted_min_get(ep->object, &lminw, &lminh);
+ lmin = efl_gfx_size_hint_restricted_min_get(ep->object);
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.h)
{
- if (lminw > minw) minw = lminw;
+ if (lmin.w > minw) minw = lmin.w;
}
if (((Edje_Part_Description_Table *)chosen_desc)->table.min.v)
{
- if (lminh > minh) minh = lminh;
+ if (lmin.h > minh) minh = lmin.h;
}
}
else if ((ep->part->type == EDJE_PART_TYPE_BOX) &&
((((Edje_Part_Description_Box *)chosen_desc)->box.min.h) ||
(((Edje_Part_Description_Box *)chosen_desc)->box.min.v)))
{
- Evas_Coord lminw = 0, lminh = 0;
+ Eina_Size2D lmin;
efl_canvas_group_need_recalculate_set(ep->object, 1);
efl_canvas_group_calculate(ep->object);
- efl_gfx_size_hint_restricted_min_get(ep->object, &lminw, &lminh);
+ lmin = efl_gfx_size_hint_restricted_min_get(ep->object);
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.h)
{
- if (lminw > minw) minw = lminw;
+ if (lmin.w > minw) minw = lmin.w;
}
if (((Edje_Part_Description_Box *)chosen_desc)->box.min.v)
{
- if (lminh > minh) minh = lminh;
+ if (lmin.h > minh) minh = lmin.h;
}
}
else if (ep->part->type == EDJE_PART_TYPE_IMAGE)
this size internally, so any change to it from an application
might be ignored. Use @.hint_min instead.
]]
- set @protected {}
- get {}
+ set @protected {
+ [[This function is protected as it is meant for widgets to indicate
+ their "intrinsic" minimum size.
+ ]]
+ }
+ get {
+ [[Get the "intrinsic" minimum size of this object.]]
+ }
values {
- w: int; [[Integer to use as the minimum width hint.]]
- h: int; [[Integer to use as the minimum height hint.]]
+ sz: Eina.Size2D; [[Minimum size (hint) in pixels.]]
}
}
@property hint_combined_min {
{
Evas_Object_Box_Option *opt;
Evas_Object_Box_Data *bd;
- int minw = 0, minh = 0;
+ Eina_Size2D min = { 0, 0 };
Eina_List *l;
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(obj, EFL_UI_BOX_CLASS));
int mw = 0, mh = 0;
efl_gfx_size_hint_combined_min_get(child, &mw, &mh);
- if (mw > minw) minw = mw;
- if (mh > minh) minh = mh;
+ if (mw > min.w) min.w = mw;
+ if (mh > min.h) min.h = mh;
}
- efl_gfx_size_hint_restricted_min_set(obj, minw, minh);
+ efl_gfx_size_hint_restricted_min_set(obj, min);
}
#include "efl_ui_box_stack.eo.c"
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
Eo *first_content, *second_content;
- int minw, minh;
+ Eina_Size2D min;
first_content = efl_content_get(efl_part(obj, "first"));
second_content = efl_content_get(efl_part(obj, "second"));
if (sd->dir == EFL_UI_DIR_HORIZONTAL)
{
- minw = MAX(sd->first_min.w, sd->second_min.w);
- minh = sd->first_min.h + sd->second_min.h;
+ min.w = MAX(sd->first_min.w, sd->second_min.w);
+ min.h = sd->first_min.h + sd->second_min.h;
}
else
{
- minw = sd->first_min.w + sd->second_min.w;
- minh = MAX(sd->first_min.h, sd->second_min.h);
+ min.w = sd->first_min.w + sd->second_min.w;
+ min.h = MAX(sd->first_min.h, sd->second_min.h);
}
- efl_gfx_size_hint_restricted_min_set(obj, minw, minh);
+ efl_gfx_size_hint_restricted_min_set(obj, min);
_set_min_size_new(obj);
}
}
if (ch_wm_rotation)
{
- efl_gfx_size_hint_restricted_min_set(obj, -1, -1);
+ efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(-1, -1));
efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, -1));
#ifdef HAVE_ELEMENTARY_X
ELM_WIN_DATA_ALIVE_CHECK(obj, sd);
}
sd->tmp_updating_hints = 1;
- efl_gfx_size_hint_restricted_min_set(obj, minw, minh);
+ efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(maxw, maxh));
sd->tmp_updating_hints = 0;
_elm_win_size_hints_update(obj, sd);
sd->rot = rotation;
if (resize) TRAP(sd, rotation_with_resize_set, rotation);
else TRAP(sd, rotation_set, rotation);
- efl_gfx_size_hint_restricted_min_set(obj, -1, -1);
+ efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(-1, -1));
efl_gfx_size_hint_max_set(obj, EINA_SIZE2D(-1, -1));
_elm_win_resize_objects_eval(obj, EINA_FALSE);
#ifdef HAVE_ELEMENTARY_X
}
if (minw < menuw) minw = menuw;
- efl_gfx_size_hint_restricted_min_set(o, minw, minh);
+ efl_gfx_size_hint_restricted_min_set(o, EINA_SIZE2D(minw, minh));
evas_object_geometry_get(o, &x, &y, &w, &h);
if (w < minw) w = minw;
if (h < minh) h = minh;
evas_object_inform_call_changed_size_hints(eo_obj);
}
-EOLIAN static void
-_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Evas_Coord *w, Evas_Coord *h)
+EOLIAN static Eina_Size2D
+_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
if ((!obj->size_hints) || obj->delete_me)
- {
- if (w) *w = 0;
- if (h) *h = 0;
- return;
- }
- if (w) *w = obj->size_hints->min.w;
- if (h) *h = obj->size_hints->min.h;
+ return EINA_SIZE2D(0, 0);
+
+ return obj->size_hints->min;
}
EOLIAN static void
-_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Coord w, Evas_Coord h)
+_efl_canvas_object_efl_gfx_size_hint_hint_restricted_min_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Size2D sz)
{
if (obj->delete_me)
return;
evas_object_async_block(obj);
if (EINA_UNLIKELY(!obj->size_hints))
{
- if (!w && !h) return;
+ if (!sz.w && !sz.h) return;
_evas_object_size_hint_alloc(eo_obj, obj);
}
- if ((obj->size_hints->min.w == w) && (obj->size_hints->min.h == h)) return;
- obj->size_hints->min.w = w;
- obj->size_hints->min.h = h;
+ if ((obj->size_hints->min.w == sz.w) && (obj->size_hints->min.h == sz.h)) return;
+ obj->size_hints->min = sz;
evas_object_inform_call_changed_size_hints(eo_obj);
}
unsigned int m;
int r, g, b, a;
//int requestw, requesth;
- int minw, minh;
Eina_Rect geom;
- Eina_Size2D max;
+ Eina_Size2D max, min;
short layer;
Eina_Bool focus;
Eina_Bool visible;
name = efl_name_get(eo_obj); // evas_object_name_get(eo_obj);
geom = efl_gfx_geometry_get(eo_obj);
scale = efl_canvas_object_scale_get(eo_obj);
- efl_gfx_size_hint_restricted_min_get(eo_obj, &minw, &minh);
+ min = efl_gfx_size_hint_restricted_min_get(eo_obj);
max = efl_gfx_size_hint_max_get(eo_obj);
//efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth);
efl_gfx_size_hint_align_get(eo_obj, &dblx, &dbly);
EFL_DBG_INFO_APPEND(group, "Scale", EINA_VALUE_TYPE_DOUBLE, scale);
node = EFL_DBG_INFO_LIST_APPEND(group, "Min size");
- EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, minw);
- EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, minh);
+ EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, min.w);
+ EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_INT, min.h);
node = EFL_DBG_INFO_LIST_APPEND(group, "Max size");
EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_INT, max.w);
EAPI void
evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
- efl_gfx_size_hint_restricted_min_set(obj, w, h);
+ efl_gfx_size_hint_restricted_min_set(obj, EINA_SIZE2D(w, h));
}
EAPI void
evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
{
- efl_gfx_size_hint_restricted_min_get(obj, w, h);
+ Eina_Size2D sz;
+ sz = efl_gfx_size_hint_restricted_min_get(obj);
+ if (w) *w = sz.w;
+ if (h) *h = sz.h;
}
EAPI void
struct _Evas_Size_Hints
{
- Evas_Size min, request;
- Eina_Size2D user_min, max;
+ Evas_Size request;
+ Eina_Size2D min, user_min, max;
Evas_Aspect aspect;
Evas_Double_Pair align, weight;
Evas_Border padding;