Beispiel #1
0
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 _changed_size_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
	Evas_Object *map;
	Evas_Coord w, h;

	evas_object_size_hint_min_get(obj, &w, &h);

	map = mapbuf_get_mapbuf(obj);
	if (map) {
		evas_object_size_hint_min_set(map, w, h);
	}
}
static void
_sizing_eval(Evas_Object *obj)
{
   Widget_Data *wd = elm_widget_data_get(obj);
   Evas_Coord minw = -1, minh = -1;
   Evas_Coord cminw = -1, cminh = -1;
   if (!wd) return;
   edje_object_size_min_calc(wd->frm, &minw, &minh);
   evas_object_size_hint_min_get(obj, &cminw, &cminh);
   if ((minw == cminw) && (minh == cminh)) return;
   evas_object_size_hint_min_set(obj, minw, minh);
   evas_object_size_hint_max_set(obj, -1, -1);
}
Beispiel #4
0
static void
_update_sizing(Evas_Object *term)
{
   Evas_Coord mw = 1, mh = 1, w, h;

   termio_config_update(term);
   evas_object_size_hint_min_get(term, &mw, &mh);
   if (mw < 1) mw = 1;
   if (mh < 1) mh = 1;
   w = tsize_w / mw;
   h = tsize_h / mh;
   evas_object_size_hint_request_set(term, w * mw, h * mh);
   expecting_resize = 1;
}
Beispiel #5
0
static void
_sizing_eval(Evas_Object *obj)
{
   Widget_Data *wd = elm_widget_data_get(obj);
   Evas_Coord minw = -1, minh = -1;
   Evas_Coord maxw = -1, maxh = -1;
   if (!wd) return;
   if (wd->content)
     {
        evas_object_size_hint_min_get(wd->content, &minw, &minh);
        evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
     }
   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;
   Evas_Coord maxw = -1, maxh = -1;

   ELM_MAPBUF_DATA_GET(obj, sd);
   if (sd->content)
     {
        evas_object_size_hint_min_get(sd->content, &minw, &minh);
        evas_object_size_hint_max_get(sd->content, &maxw, &maxh);
     }
   evas_object_size_hint_min_set(obj, minw, minh);
   evas_object_size_hint_max_set(obj, maxw, maxh);
}
Beispiel #7
0
static void
_update_sizing(Font_Ctx *ctx)
{
   Evas_Coord mw = 1, mh = 1, w, h;

   termio_config_update(ctx->term);
   evas_object_size_hint_min_get(ctx->term, &mw, &mh);
   if (mw < 1)
     mw = 1;
   if (mh < 1)
     mh = 1;
   w = ctx->tsize_w / mw;
   h = ctx->tsize_h / mh;
   evas_object_size_hint_request_set(ctx->term, w * mw, h * mh);
   ctx->expecting_resize = 1;
}
Beispiel #8
0
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);
}
Beispiel #9
0
static void
_sizing_eval(Evas_Object *obj)
{
   Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
   Evas_Coord w, h;

   ELM_TABLE_DATA_GET(obj, sd);

   evas_object_size_hint_min_get(sd->resize_obj, &minw, &minh);
   evas_object_size_hint_max_get(sd->resize_obj, &maxw, &maxh);
   evas_object_size_hint_min_set(obj, minw, minh);
   evas_object_size_hint_max_set(obj, maxw, maxh);
   evas_object_geometry_get(obj, NULL, NULL, &w, &h);
   if (w < minw) w = minw;
   if (h < minh) h = minh;
   if ((maxw >= 0) && (w > maxw)) w = maxw;
   if ((maxh >= 0) && (h > maxh)) h = maxh;
   evas_object_resize(obj, w, h);
}
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);
}
Beispiel #11
0
static void
_print_rect_stats(Evas_Object *rect)
{
   Evas_Coord w, h, l, r, t, b;
   double x, y;

   evas_object_size_hint_align_get(rect, &x, &y);
   fprintf(stdout, "\talign hints: h(%f), v(%f)\n", x, y);

   evas_object_size_hint_min_get(rect, &w, &h);
   fprintf(stdout, "\tmin. size hints: h(%d), v(%d)\n", w, h);

   evas_object_size_hint_max_get(rect, &w, &h);
   fprintf(stdout, "\tmax. size hints: h(%d), v(%d)\n", w, h);

   evas_object_size_hint_padding_get(rect, &l, &r, &t, &b);
   fprintf(stdout, "\tpadding hints: l(%d), r(%d), t(%d), b(%d)\n",
           l, r, t, b);

   evas_object_size_hint_weight_get(rect, &x, &y);
   fprintf(stdout, "\tweight hints: h(%f), v(%f)\n", x, y);
}
Beispiel #12
0
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;
   if (!wd->content) return;
   evas_object_size_hint_min_get(wd->content, &minw, &minh);
   evas_object_size_hint_max_get(wd->content, &maxw, &maxh);
   if (wd->maxmin)
     {
        if (minw > wd->maxminw) wd->maxminw = minw;
        if (minh > wd->maxminh) wd->maxminh = minh;
        evas_object_size_hint_min_set(obj, wd->maxminw, wd->maxminh);
     }
   else
     {
        evas_object_size_hint_min_set(obj, minw, minh);
     }
   evas_object_size_hint_max_set(obj, maxw, maxh);
//   DBG("FAC SZ: %i %i | %i %i", minw, minh, maxw, maxh);
}
Beispiel #13
0
E_API void
e_util_win_auto_resize_fill(Evas_Object *win)
{
   E_Zone *zone = NULL;
   E_Client *ec;

   ec = e_win_client_get(win);
   if (ec)
     zone = ec->zone;
   if (!zone)
     zone = e_zone_current_get();

   if (zone)
     {
        int w, h, mw, mh;

        e_zone_useful_geometry_get(zone, NULL, NULL, &w, &h);

        evas_object_size_hint_min_get(win, &mw, &mh);
        w = _win_auto_size_calc(w, mw);
        h = _win_auto_size_calc(h, mh);
        evas_object_resize(win, w, h);
     }
}
const Size Object::getSizeHintMin () const
{
  Evas_Coord w, h;
  evas_object_size_hint_min_get (o, &w, &h);
  return Size (w, h);
}
Beispiel #15
0
static Eina_Bool
_e_elm_win_trap_show(void *data, Evas_Object *o)
{
   Elm_Win_Trap_Ctx *ctx = data;
   Evas *e = evas_object_evas_get(o);
   Ecore_Evas *ee = ecore_evas_ecore_evas_get(e);
   Eina_Bool borderless;

   EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_TRUE);
   borderless = elm_win_borderless_get(o);
   if (!ctx->client)
     {
        E_Client *ec;
        Ecore_Window win;
#ifdef HAVE_WAYLAND
        int64_t wl_win_id = -1;
#endif
        E_Pixmap_Type type = E_PIXMAP_TYPE_X;

        win = elm_win_window_id_get(o);
#ifdef HAVE_WAYLAND
        if (!strncmp(ecore_evas_engine_name_get(ee), "wayland", 7))
          {
             Ecore_Wl2_Window *ewin = elm_win_wl_window_get(o);

             type = E_PIXMAP_TYPE_WL;
             ecore_evas_object_cursor_set(ee, NULL, 0, 0, 0);
             ctx->pointer = e_comp->pointer;
             elm_win_borderless_set(o, 1);
             wl_win_id = ecore_wl2_window_surface_id_get(ewin);
          }
        else
#endif
          {
             type = E_PIXMAP_TYPE_X;
             ctx->pointer = e_pointer_window_new(win, EINA_TRUE);
          }

        if (type == E_PIXMAP_TYPE_WL)
          ec = e_pixmap_find_client(type, (int64_t)win);
        else
          ec = e_pixmap_find_client(type, win);

        if (ec)
          ctx->client = ec;
        else
          {
             E_Pixmap *cp;
             const char *title, *name, *clas;

             ecore_evas_name_class_get(ee, &name, &clas);
             if (!name) name = "E";
             if (!clas) clas = "_e_internal_window";
             ecore_evas_name_class_set(ee, name, clas);
             title = elm_win_title_get(o);
             if ((!title) || (!title[0]))
               title = "E";
             ecore_evas_title_set(ee, title);

             if (type == E_PIXMAP_TYPE_WL)
               cp = e_pixmap_new(type, (int64_t)win);
             else
               cp = e_pixmap_new(type, win);

             EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_TRUE);
#ifdef HAVE_WAYLAND
             if (wl_win_id >= 0)
               e_pixmap_alias(cp, type, wl_win_id);
#endif

             current_win = ctx;
             ctx->client = e_client_new(cp, 0, 1);
             current_win = NULL;
             EINA_SAFETY_ON_NULL_RETURN_VAL(ctx->client, EINA_TRUE);
             eina_stringshare_replace(&ctx->client->icccm.name, name);
             eina_stringshare_replace(&ctx->client->icccm.class, clas);
             eina_stringshare_replace(&ctx->client->icccm.title, title);
          }
        ctx->client->placed = ctx->placed | ctx->centered;
        ctx->client->internal_no_remember = ctx->internal_no_remember;
        ctx->client->internal_no_reopen = ctx->internal_no_reopen;
        ctx->client->internal_elm_win = o;
        elm_win_autodel_set(o, 1);
        evas_object_data_set(o, "E_Client", ctx->client);
        ctx->client->dialog = elm_win_type_get(o) == ELM_WIN_DIALOG_BASIC;
        ctx->client->tooltip = elm_win_type_get(o) == ELM_WIN_TOOLTIP;

        evas_object_size_hint_min_get(o, &ctx->client->icccm.min_w, &ctx->client->icccm.min_h);
        ctx->client->icccm.min_w = MAX(ctx->client->icccm.min_w, 0);
        ctx->client->icccm.min_h = MAX(ctx->client->icccm.min_h, 0);
        evas_object_size_hint_max_get(o, &ctx->client->icccm.max_w, &ctx->client->icccm.max_h);
        ctx->client->icccm.max_w = MAX(ctx->client->icccm.max_w, 0);
        ctx->client->icccm.max_h = MAX(ctx->client->icccm.max_h, 0);
     }