fix shape cutting for frames which are larger than their object size implies

requires border themes to have data.item "frame_extends" set
This commit is contained in:
Mike Blumenkrantz 2014-06-04 08:55:06 -04:00
parent d8aa488096
commit dbce413b42
3 changed files with 41 additions and 17 deletions

View File

@ -577,27 +577,28 @@ _e_comp_shapes_update_comp_client_shape_comp_helper(E_Client *ec, Eina_Tiler *tb
/* add the frame */ /* add the frame */
e_comp_object_frame_geometry_get(ec->frame, &l, &r, &t, &b); e_comp_object_frame_geometry_get(ec->frame, &l, &r, &t, &b);
if (l || r || t || b) e_comp_object_frame_extends_get(ec->frame, &x, &y, &w, &h);
if ((l + x) || (r + (w - ec->w + x)) || (t - y) || (b + (h - ec->h + y)))
{ {
if (t) if (t - y)
{ {
eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x, ec->y, ec->w, t}); eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x + x, ec->y + y, w, t - y});
SHAPE_INF("ADD: %d,%d@%dx%d", ec->x, ec->y, ec->w, t); SHAPE_INF("ADD: %d,%d@%dx%d", ec->x + x, ec->y + y, w, t - y);
} }
if (l) if (l - x)
{ {
eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x, ec->y, l, ec->h}); eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x + x, ec->y + y, l - x, h});
SHAPE_INF("ADD: %d,%d@%dx%d", ec->x, ec->y, l, ec->h); SHAPE_INF("ADD: %d,%d@%dx%d", ec->x + x, ec->y + y, l - x, h);
} }
if (r) if (r + (w - ec->w + x))
{ {
eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x + l + ec->client.w, ec->y, r, ec->h}); eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x + l + ec->client.w + x, ec->y + y, r + (w - ec->w + x), h});
SHAPE_INF("ADD: %d,%d@%dx%d", ec->client.x + ec->client.w, ec->y, r, ec->h); SHAPE_INF("ADD: %d,%d@%dx%d", ec->x + l + ec->client.w + x, ec->y + y, r + (w - ec->w + x), h);
} }
if (b) if (b + (h - ec->h + y))
{ {
eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x, ec->y + t + ec->client.h, ec->w, b}); eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x + x, ec->y + t + ec->client.h + y, w, b + (h - ec->h + y)});
SHAPE_INF("ADD: %d,%d@%dx%d", ec->x, ec->client.y + ec->client.h, ec->w, b); SHAPE_INF("ADD: %d,%d@%dx%d", ec->x + x, ec->y + t + ec->client.h + y, w, b + (h - ec->h + y));
} }
} }
rects = ec->shape_rects ?: ec->shape_input_rects; rects = ec->shape_rects ?: ec->shape_input_rects;
@ -631,9 +632,10 @@ _e_comp_shapes_update_comp_client_shape_comp_helper(E_Client *ec, Eina_Tiler *tb
if (!e_client_util_borderless(ec)) if (!e_client_util_borderless(ec))
{ {
e_comp_object_frame_extends_get(ec->frame, &x, &y, &w, &h);
/* add the frame */ /* add the frame */
eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x, ec->y, ec->w, ec->h}); eina_tiler_rect_add(tb, &(Eina_Rectangle){ec->x + x, ec->y + y, w, h});
SHAPE_INF("ADD: %d,%d@%dx%d", ec->x, ec->y, ec->w, ec->h); SHAPE_INF("ADD: %d,%d@%dx%d", ec->x + x, ec->y + y, w, h);
} }
if ((!ec->shaded) && (!ec->shading)) if ((!ec->shaded) && (!ec->shading))

View File

@ -97,6 +97,7 @@ typedef struct _E_Comp_Object
Eina_Bool updates_full : 1; // entire object will be updated Eina_Bool updates_full : 1; // entire object will be updated
Eina_Bool force_move : 1; Eina_Bool force_move : 1;
Eina_Bool frame_extends : 1; //frame may extend beyond object size
} E_Comp_Object; } E_Comp_Object;
@ -2473,6 +2474,21 @@ e_comp_object_client_get(Evas_Object *obj)
return cw ? cw->ec : NULL; return cw ? cw->ec : NULL;
} }
EAPI void
e_comp_object_frame_extends_get(Evas_Object *obj, int *x, int *y, int *w, int *h)
{
API_ENTRY;
if (cw->frame_extends)
edje_object_parts_extends_calc(cw->frame_object, x, y, w, h);
else
{
if (x) *x = 0;
if (y) *y = 0;
if (w) *w = cw->ec->w;
if (h) *h = cw->ec->h;
}
}
EAPI E_Zone * EAPI E_Zone *
e_comp_object_util_zone_get(Evas_Object *obj) e_comp_object_util_zone_get(Evas_Object *obj)
{ {
@ -2812,8 +2828,13 @@ reshadow:
} }
evas_object_smart_callback_call(cw->smart_obj, "frame_changed", NULL); evas_object_smart_callback_call(cw->smart_obj, "frame_changed", NULL);
if (cw->frame_object) if (cw->frame_object)
edje_object_signal_callback_add(cw->frame_object, "*", "*", {
_e_comp_object_cb_signal_bind, cw); cw->frame_extends = !!edje_object_data_get(cw->frame_object, "frame_extends");
edje_object_signal_callback_add(cw->frame_object, "*", "*",
_e_comp_object_cb_signal_bind, cw);
}
else
cw->frame_extends = 0;
evas_object_del(pbg); evas_object_del(pbg);
return EINA_TRUE; return EINA_TRUE;
} }

View File

@ -43,6 +43,7 @@ EAPI void e_comp_object_frame_xy_adjust(Evas_Object *obj, int x, int y, int *ax,
EAPI void e_comp_object_frame_xy_unadjust(Evas_Object *obj, int x, int y, int *ax, int *ay); EAPI void e_comp_object_frame_xy_unadjust(Evas_Object *obj, int x, int y, int *ax, int *ay);
EAPI void e_comp_object_frame_wh_adjust(Evas_Object *obj, int w, int h, int *aw, int *ah); EAPI void e_comp_object_frame_wh_adjust(Evas_Object *obj, int w, int h, int *aw, int *ah);
EAPI void e_comp_object_frame_wh_unadjust(Evas_Object *obj, int w, int h, int *aw, int *ah); EAPI void e_comp_object_frame_wh_unadjust(Evas_Object *obj, int w, int h, int *aw, int *ah);
EAPI void e_comp_object_frame_extends_get(Evas_Object *obj, int *x, int *y, int *w, int *h);
EAPI E_Client *e_comp_object_client_get(Evas_Object *obj); EAPI E_Client *e_comp_object_client_get(Evas_Object *obj);
EAPI E_Zone *e_comp_object_util_zone_get(Evas_Object *obj); EAPI E_Zone *e_comp_object_util_zone_get(Evas_Object *obj);
EAPI void e_comp_object_util_del_list_append(Evas_Object *obj, Evas_Object *to_del); EAPI void e_comp_object_util_del_list_append(Evas_Object *obj, Evas_Object *to_del);