SVN revision: 73612
devs/princeamd/enlightenment-0.17-elive
Mike Blumenkrantz 11 years ago
parent 55de2e2b43
commit ad11feb626
  1. 127
      src/bin/e_moveresize.c

@ -77,7 +77,7 @@ _e_resize_begin(void *data __UNUSED__, void *border)
e_popup_layer_set(_disp_pop, 255);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
"e/widgets/border/default/resize");
"e/widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999x9999");
edje_object_part_text_set(_obj, "e.text.label", buf);
@ -89,19 +89,19 @@ _e_resize_begin(void *data __UNUSED__, void *border)
if (!visible)
{
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
}
snprintf(buf, sizeof(buf), "%ix%i", w, h);
edje_object_part_text_set(_obj, "e.text.label", buf);
e_popup_move_resize(_disp_pop,
(obj_x - _disp_pop->zone->x) +
((obj_w - ew) / 2),
(obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
(obj_x - _disp_pop->zone->x) +
((obj_w - ew) / 2),
(obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
e_popup_show(_disp_pop);
@ -113,16 +113,16 @@ _e_resize_end(void *data __UNUSED__, void *border __UNUSED__)
{
if (e_config->resize_info_visible)
{
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_disp_pop)
{
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_disp_pop)
{
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
}
visible = 0;
@ -146,9 +146,9 @@ _e_resize_update(void *data __UNUSED__, void *border)
if (!visible)
{
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
}
snprintf(buf, sizeof(buf), "%ix%i", w, h);
edje_object_part_text_set(_obj, "e.text.label", buf);
@ -160,25 +160,25 @@ _e_resize_border_extents(E_Border *bd, int *w, int *h)
if ((bd->client.icccm.base_w >= 0) &&
(bd->client.icccm.base_h >= 0))
{
if (bd->client.icccm.step_w > 0)
*w = (bd->client.w - bd->client.icccm.base_w) / bd->client.icccm.step_w;
else
*w = bd->client.w;
if (bd->client.icccm.step_h > 0)
*h = (bd->client.h - bd->client.icccm.base_h) / bd->client.icccm.step_h;
else
*h = bd->client.h;
if (bd->client.icccm.step_w > 0)
*w = (bd->client.w - bd->client.icccm.base_w) / bd->client.icccm.step_w;
else
*w = bd->client.w;
if (bd->client.icccm.step_h > 0)
*h = (bd->client.h - bd->client.icccm.base_h) / bd->client.icccm.step_h;
else
*h = bd->client.h;
}
else
{
if (bd->client.icccm.step_w > 0)
*w = (bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w;
else
*w = bd->client.w;
if (bd->client.icccm.step_h > 0)
*h = (bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h;
else
*h = bd->client.h;
if (bd->client.icccm.step_w > 0)
*w = (bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w;
else
*w = bd->client.w;
if (bd->client.icccm.step_h > 0)
*h = (bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h;
else
*h = bd->client.h;
}
}
@ -204,7 +204,7 @@ _e_move_begin(void *data __UNUSED__, void *border)
_disp_pop = e_popup_new(bd->zone, 0, 0, 1, 1);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
"e/widgets/border/default/move");
"e/widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(_obj, "e.text.label", buf);
@ -215,11 +215,11 @@ _e_move_begin(void *data __UNUSED__, void *border)
e_popup_edje_bg_object_set(_disp_pop, _obj);
e_popup_move_resize(_disp_pop,
(obj_x - _disp_pop->zone->x) +
((obj_w - ew) / 2),
(obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
(obj_x - _disp_pop->zone->x) +
((obj_w - ew) / 2),
(obj_y - _disp_pop->zone->y) +
((obj_h - eh) / 2),
ew, eh);
}
static void
@ -227,16 +227,16 @@ _e_move_end(void *data __UNUSED__, void *border __UNUSED__)
{
if (e_config->move_info_visible)
{
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_disp_pop)
{
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_disp_pop)
{
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
}
visible = 0;
@ -257,9 +257,9 @@ _e_move_update(void *data __UNUSED__, void *border)
if (!visible)
{
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
evas_object_show(_obj);
e_popup_show(_disp_pop);
visible = 1;
}
snprintf(buf, sizeof(buf), "%i %i", bd->x, bd->y);
edje_object_part_text_set(_obj, "e.text.label", buf);
@ -274,11 +274,12 @@ _e_move_resize_object_coords_set(int x, int y, int w, int h)
obj_h = h;
if ((_disp_pop) && (e_config->move_info_visible) && (visible))
{
e_popup_move(_disp_pop,
(obj_x - _disp_pop->zone->x) +
((obj_w - _disp_pop->w) / 2),
(obj_y - _disp_pop->zone->y) +
((obj_h - _disp_pop->h) / 2)
);
e_popup_move(_disp_pop,
(obj_x - _disp_pop->zone->x) +
((obj_w - _disp_pop->w) / 2),
(obj_y - _disp_pop->zone->y) +
((obj_h - _disp_pop->h) / 2)
);
}
}

Loading…
Cancel
Save