move resize use popup...


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 18 years ago
parent 51e37d3be5
commit 7d1af2368e
  1. 122
      src/bin/e_moveresize.c

@ -3,29 +3,20 @@
*/
#include "e.h"
static Ecore_Evas *_ee = NULL;
static E_Popup *_disp_pop = NULL;
static Evas_Object *_obj = NULL;
static int visible = 0;
void e_resize_begin(E_Zone *zone, int w, int h)
void
e_resize_begin(E_Zone *zone, int w, int h)
{
Evas_Coord ew, eh;
char buf[40];
if (_ee)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
}
_ee = ecore_evas_software_x11_new(NULL, zone->container->win,
0, 0, 10, 10);
ecore_evas_override_set(_ee, 1);
ecore_evas_software_x11_direct_resize_set(_ee, 1);
e_canvas_add(_ee);
ecore_evas_borderless_set(_ee, 1);
_obj = edje_object_add(ecore_evas_get(_ee));
if (_disp_pop) e_object_del(E_OBJECT(_disp_pop));
_disp_pop = e_popup_new(zone, 0, 0, 1, 1);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999x9999");
@ -35,109 +26,108 @@ void e_resize_begin(E_Zone *zone, int w, int h)
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_resize_update(w, h);
e_popup_edje_bg_object_set(_disp_pop, _obj);
ecore_evas_move(_ee, (zone->w - ew) / 2, (zone->h - eh) / 2);
ecore_evas_resize(_ee, ew, eh);
ecore_evas_show(_ee);
ecore_evas_raise(_ee);
e_resize_update(w, h);
e_popup_move_resize(_disp_pop,
(_disp_pop->zone->w - ew) / 2,
(_disp_pop->zone->h - eh) / 2,
ew, eh);
e_popup_show(_disp_pop);
visible = 1;
}
void e_resize_end(void)
void
e_resize_end(void)
{
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_ee)
if (_disp_pop)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
_ee = NULL;
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
visible = 0;
}
void e_resize_update(int w, int h)
void
e_resize_update(int w, int h)
{
char buf[40];
if (!_ee) return;
if ((w >= 0) &&
(h >= 0))
snprintf(buf, sizeof(buf), "%ix%i", w, h);
else
snprintf(buf, sizeof(buf), "%ix%i", w, h);
if (!_disp_pop) return;
if (!visible)
{
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, "text", buf);
}
void e_move_begin(E_Zone *zone, int x, int y)
void
e_move_begin(E_Zone *zone, int x, int y)
{
Evas_Coord w, h;
Evas_Coord ew, eh;
char buf[40];
if (_ee)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
}
_ee = ecore_evas_software_x11_new(NULL, zone->container->win,
0, 0, 10, 10);
ecore_evas_override_set(_ee, 1);
ecore_evas_software_x11_direct_resize_set(_ee, 1);
e_canvas_add(_ee);
ecore_evas_borderless_set(_ee, 1);
_obj = edje_object_add(ecore_evas_get(_ee));
if (_disp_pop) e_object_del(E_OBJECT(_disp_pop));
_disp_pop = e_popup_new(zone, 0, 0, 1, 1);
_obj = edje_object_add(_disp_pop->evas);
e_theme_edje_object_set(_obj, "base/theme/borders",
"widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(_obj, "text", buf);
edje_object_size_min_calc(_obj, &w, &h);
edje_object_size_min_calc(_obj, &ew, &eh);
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, w, h);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_popup_edje_bg_object_set(_disp_pop, _obj);
e_move_update(x, y);
ecore_evas_move(_ee, (zone->w - w) / 2, (zone->h - h) / 2);
ecore_evas_resize(_ee, w, h);
e_popup_move_resize(_disp_pop,
(_disp_pop->zone->w - ew) / 2,
(_disp_pop->zone->h - eh) / 2,
ew, eh);
// e_popup_show(_disp_pop);
// visible = 1;
}
void e_move_end(void)
void
e_move_end(void)
{
if (_obj)
{
evas_object_del(_obj);
_obj = NULL;
}
if (_ee)
if (_disp_pop)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
_ee = NULL;
e_object_del(E_OBJECT(_disp_pop));
_disp_pop = NULL;
}
visible = 0;
}
void e_move_update(int x, int y)
void
e_move_update(int x, int y)
{
char buf[40];
if (!_ee) return;
if (!_disp_pop) return;
if (!visible)
{
evas_object_show(_obj);
ecore_evas_show(_ee);
ecore_evas_raise(_ee);
e_popup_show(_disp_pop);
visible = 1;
}
snprintf(buf, sizeof(buf) - 1, "%i %i", x, y);
snprintf(buf, sizeof(buf), "%i %i", x, y);
edje_object_part_text_set(_obj, "text", buf);
}

Loading…
Cancel
Save