static void _sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); Evas_Coord obj_minw = -1, obj_minh = -1; Evas_Coord text_minw = -1, text_minh = -1; Eina_Size2D text_min; //Calculate popup's min size including scroller's min size { elm_label_line_wrap_set(pd->message, ELM_WRAP_NONE); text_min = efl_gfx_hint_size_combined_min_get(pd->message); elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED); elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); elm_coords_finger_size_adjust(1, &text_minw, 1, &text_minh); edje_object_size_min_restricted_calc (wd->resize_obj, &text_minw, &text_minh, text_minw, text_minh); } //Calculate popup's min size except scroller's min size { elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); elm_coords_finger_size_adjust(1, &obj_minw, 1, &obj_minh); edje_object_size_min_restricted_calc (wd->resize_obj, &obj_minw, &obj_minh, obj_minw, obj_minh); } text_min.h = text_minh; _scroller_sizing_eval(obj, pd, EINA_SIZE2D(obj_minw, obj_minh), text_min); }
/** * Moves notification to orientation. * * This function moves notification to orientation * according to object RTL orientation. * * @param obj notification object. * * @param orient notification orientation. * * @internal **/ static void _notify_move_to_orientation(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1; Evas_Coord x, y, w, h; double ax, ay; ELM_NOTIFY_DATA_GET(obj, sd); evas_object_geometry_get(obj, &x, &y, &w, &h); edje_object_size_min_get(sd->notify, &minw, &minh); edje_object_size_min_restricted_calc(sd->notify, &minw, &minh, minw, minh); ax = sd->horizontal_align; ay = sd->vertical_align; if ((elm_widget_mirrored_get(obj)) && (ax != ELM_NOTIFY_ALIGN_FILL)) ax = 1.0 - ax; if (ax == ELM_NOTIFY_ALIGN_FILL) minw = w; if (ay == ELM_NOTIFY_ALIGN_FILL) minh = h; x = x + ((w - minw) * ax); y = y + ((h - minh) * ay); evas_object_move(sd->notify, x, y); }
EAPI void e_obj_dialog_show(E_Obj_Dialog *od) { Evas_Coord w, h, mw, mh; const char *s; E_OBJECT_CHECK(od); E_OBJECT_TYPE_CHECK(od, E_OBJ_DIALOG_TYPE); edje_object_size_min_get(od->bg_object, &mw, &mh); edje_object_size_min_restricted_calc(od->bg_object, &mw, &mh, mw, mh); evas_object_resize(od->bg_object, mw, mh); e_win_resize(od->win, mw, mh); e_win_size_min_set(od->win, mw, mh); edje_object_size_max_get(od->bg_object, &w, &h); if ((w > 0) && (h > 0)) { if (w < mw) w = mw; if (h < mh) h = mh; e_win_size_max_set(od->win, w, h); } s = edje_object_data_get(od->bg_object, "borderless"); if (s && (!strcmp(s, "1"))) e_win_borderless_set(od->win, 1); s = edje_object_data_get(od->bg_object, "shaped"); if (s && (!strcmp(s, "1"))) e_win_shaped_set(od->win, 1); e_win_show(od->win); }
static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1; int i; if (!wd) return; elm_coords_finger_size_adjust(1, &minw, 1, &minh); for (i = 0; i < 4; i++) { if (wd->cp[i]->bg_rect) _colorselector_set_size_hints(wd->cp[i]->bg_rect, 1, 1); _colorselector_set_size_hints(wd->cp[i]->bar, 1, 1); _colorselector_set_size_hints(wd->cp[i]->rbt, 1, 1); _colorselector_set_size_hints(wd->cp[i]->lbt, 1, 1); _colorselector_set_size_hints(wd->cp[i]->colorbar, 4, 1); } elm_coords_finger_size_adjust(4, &minw, 4, &minh); edje_object_size_min_restricted_calc(wd->base, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); }
static void _recalc(void *data) { ELM_LABEL_DATA_GET(data, sd); Evas_Coord minw = -1, minh = -1; Evas_Coord resw; evas_event_freeze(evas_object_evas_get(data)); evas_object_geometry_get (ELM_WIDGET_DATA(sd)->resize_obj, NULL, NULL, &resw, NULL); if (sd->wrap_w > resw) resw = sd->wrap_w; edje_object_size_min_restricted_calc (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, resw, 0); /* This is a hack to workaround the way min size hints are treated. * If the minimum width is smaller than the restricted width, it means * the mininmum doesn't matter. */ if ((minw <= resw) && (minw != sd->wrap_w)) { Evas_Coord ominw = -1; evas_object_size_hint_min_get(data, &ominw, NULL); minw = ominw; } evas_object_size_hint_min_set(data, minw, minh); evas_event_thaw(evas_object_evas_get(data)); evas_event_thaw_eval(evas_object_evas_get(data)); }
static void _sizing_eval(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; if (!wd) return; elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc(wd->bbl, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); }
static void _colorselector_set_size_hints(Evas_Object *obj, int timesw, int timesh) { Evas_Coord minw = -1, minh = -1; elm_coords_finger_size_adjust(timesw, &minw, timesh, &minh); edje_object_size_min_restricted_calc(obj, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); }
static void _elm_fileselector_smart_sizing_eval(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1; ELM_FILESELECTOR_DATA_GET(obj, sd); elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); }
static void _elm_bubble_smart_sizing_eval(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; ELM_BUBBLE_DATA_GET(obj, sd); elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); }
EOLIAN static void _jk_spinner_elm_layout_sizing_eval(Eo *obj, Jk_Spinner_Data *pd) { Evas_Coord minw = -1, minh = -1; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc (wd->resize_obj, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); }
static void _elm_calendar_smart_sizing_eval(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1; ELM_CALENDAR_DATA_GET(obj, sd); elm_coords_finger_size_adjust(8, &minw, ELM_DAY_LAST, &minh); edje_object_size_min_restricted_calc (ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); }
/** * Moves notification to orientation. * * This fucntion moves notification to orientation * according to object RTL orientation. * * @param obj notification object. * * @param orient notification orientation. * * @internal **/ static void _notify_move_to_orientation(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); int offx; int offy; Evas_Coord minw = -1, minh = -1; Evas_Coord x, y, w, h; if (!wd) return; evas_object_geometry_get(obj, &x, &y, &w, &h); edje_object_size_min_get(wd->notify, &minw, &minh); edje_object_size_min_restricted_calc(wd->notify, &minw, &minh, minw, minh); offx = (w - minw) / 2; offy = (h - minh) / 2; switch (_notify_orientation_with_rtl(obj, wd->orient)) { case ELM_NOTIFY_ORIENT_TOP: evas_object_move(wd->notify, x + offx, y); break; case ELM_NOTIFY_ORIENT_CENTER: evas_object_move(wd->notify, x + offx, y + offy); break; case ELM_NOTIFY_ORIENT_BOTTOM: evas_object_move(wd->notify, x + offx, y + h - minh); break; case ELM_NOTIFY_ORIENT_LEFT: evas_object_move(wd->notify, x, y + offy); break; case ELM_NOTIFY_ORIENT_RIGHT: evas_object_move(wd->notify, x + w - minw, y + offy); break; case ELM_NOTIFY_ORIENT_TOP_LEFT: evas_object_move(wd->notify, x, y); break; case ELM_NOTIFY_ORIENT_TOP_RIGHT: evas_object_move(wd->notify, x + w - minw, y); break; case ELM_NOTIFY_ORIENT_BOTTOM_LEFT: evas_object_move(wd->notify, x, y + h - minh); break; case ELM_NOTIFY_ORIENT_BOTTOM_RIGHT: evas_object_move(wd->notify, x + w - minw, y + h - minh); break; case ELM_NOTIFY_ORIENT_LAST: break; } }
/* callbacks */ static void _recalc_job(void *data) { Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; Evas_Coord resw, resh, minminw; Eina_List *l; Evas_Object *child; Smart_Data *sd; sd = evas_object_smart_data_get(data); if (!sd) return; sd->deferred_recalc_job = NULL; if (sd->w != sd->w_view) { // Width has changed, recalc of all list entries needed resh = 0; int i = 0; for (l = sd->children; l; l = l->next) { child = l->data; edje_object_size_min_restricted_calc(child, &minw, &minh, sd->w_view, 0); evas_object_resize(child, sd->w_view, minh); evas_object_move(child, sd->x, sd->y + resh); resh = resh + minh; } if (resh < sd->h_view) resh = sd->h_view; sd->w = sd->w_view; sd->h = resh; } if (sd->overlay_visible) { evas_object_resize(sd->clip, sd->w_view, sd->h_view); evas_object_resize(sd->overlay, sd->w_view, sd->h_view); evas_object_size_hint_max_set(sd->obj, sd->w_view, sd->h_view); } else { evas_object_resize(sd->bg, sd->w, sd->h); evas_object_resize(sd->clip, sd->w, sd->h); evas_object_size_hint_min_set(sd->obj, 0, sd->h); evas_object_size_hint_max_set(sd->obj, maxw, sd->h); } }
EOLIAN static void _elm_actionslider_elm_layout_sizing_eval(Eo *obj, Elm_Actionslider_Data *sd) { Evas_Coord minw = -1, minh = -1; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); elm_coords_finger_size_adjust(1, &minw, 1, &minh); evas_object_size_hint_min_set(sd->drag_button_base, minw, minh); evas_object_size_hint_max_set(sd->drag_button_base, -1, -1); minw = -1; minh = -1; elm_coords_finger_size_adjust(3, &minw, 1, &minh); edje_object_size_min_restricted_calc (wd->resize_obj, &minw, &minh, minw, minh); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); }
static void _e_gadcon_popup_size_recalc(E_Gadcon_Popup *pop, Evas_Object *obj) { Evas_Coord w = 0, h = 0; e_widget_size_min_get(obj, &w, &h); if ((!w) || (!h)) evas_object_size_hint_min_get(obj, &w, &h); if ((!w) || (!h)) { edje_object_size_min_get(obj, &w, &h); edje_object_size_min_restricted_calc(obj, &w, &h, w, h); } edje_extern_object_min_size_set(obj, w, h); edje_object_size_min_calc(pop->o_bg, &pop->w, &pop->h); evas_object_resize(pop->o_bg, pop->w, pop->h); if (pop->win->visible) _e_gadcon_popup_position(pop); }
EOLIAN static void _elm_flipselector_elm_layout_sizing_eval(Eo *obj, Elm_Flipselector_Data *sd) { char *tmp = NULL; Evas_Coord minw = -1, minh = -1, w, h; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->evaluating) return; elm_coords_finger_size_adjust(1, &minw, 2, &minh); sd->evaluating = EINA_TRUE; if (sd->sentinel) { const char *label = elm_object_item_text_get(DATA_GET(sd->sentinel)); const char *src = elm_layout_text_get(obj, "elm.top"); if (src) tmp = strdup(src); elm_layout_text_set(obj, "elm.top", label); } edje_object_size_min_restricted_calc (wd->resize_obj, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 2, &minh); evas_object_size_hint_min_get(obj, &w, &h); if (sd->sentinel) { elm_layout_text_set(obj, "elm.top", tmp); free(tmp); } if (w > minw) minw = w; if (h > minh) minh = h; sd->evaluating = EINA_FALSE; evas_object_size_hint_min_set(obj, minw, minh); }
static void _sizing_eval(Evas_Object *obj) { Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1; double scale; ELM_PHOTO_DATA_GET(obj, sd); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->size <= 0) return; scale = (sd->size * efl_gfx_entity_scale_get(obj) * elm_config_scale_get()); evas_object_size_hint_min_set(sd->icon, scale, scale); elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc (wd->resize_obj, &minw, &minh, minw, minh); maxw = minw; maxh = minh; evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); }
static void _sizing_eval(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; double scale; ELM_PHOTO_DATA_GET(obj, sd); Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS); if (sd->size <= 0) return; scale = (sd->size * elm_widget_scale_get(obj) * elm_config_scale_get()); evas_object_size_hint_min_set(sd->icon, scale, scale); elm_coords_finger_size_adjust(1, &minw, 1, &minh); edje_object_size_min_restricted_calc (wd->resize_obj, &minw, &minh, minw, minh); elm_coords_finger_size_adjust(1, &minw, 1, &minh); maxw = minw; maxh = minh; evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, maxw, maxh); }
static void _calc(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1; Evas_Coord x, y, w, h; ELM_NOTIFY_DATA_GET(obj, sd); _sizing_eval(obj); evas_object_geometry_get(obj, &x, &y, &w, &h); edje_object_size_min_get(sd->notify, &minw, &minh); edje_object_size_min_restricted_calc(sd->notify, &minw, &minh, minw, minh); if (sd->horizontal_align == ELM_NOTIFY_ALIGN_FILL) minw = w; if (sd->vertical_align == ELM_NOTIFY_ALIGN_FILL) minh = h; if (sd->content) { _notify_move_to_orientation(obj); evas_object_resize(sd->notify, minw, minh); } }