Remove duplicate code.

SVN revision: 14329
devs/princeamd/enlightenment-0.17-elive
sebastid 18 years ago committed by sebastid
parent 19cba77f5b
commit 11cec998a6
  1. 4
      src/bin/Makefile.am
  2. 130
      src/bin/e_border.c
  3. 3
      src/bin/e_dnd.c
  4. 277
      src/bin/e_gadman.c
  5. 1
      src/bin/e_includes.h
  6. 131
      src/bin/e_moveresize.c
  7. 13
      src/bin/e_moveresize.h

@ -47,7 +47,8 @@ e_test.h \
e_font.h \
e_intl.h \
e_theme.h \
e_dnd.h
e_dnd.h \
e_moveresize.h
enlightenment_SOURCES = \
e_main.c \
@ -88,6 +89,7 @@ e_font.c \
e_intl.c \
e_theme.c \
e_dnd.c \
e_moveresize.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@

@ -112,12 +112,7 @@ static Evas_List *borders = NULL;
static E_Border *focused = NULL;
static E_Border *resize = NULL;
static Ecore_Evas *resize_ee = NULL;
static Evas_Object *resize_obj = NULL;
static E_Border *move = NULL;
static Ecore_Evas *move_ee = NULL;
static Evas_Object *move_obj = NULL;
int E_EVENT_BORDER_ADD = 0;
int E_EVENT_BORDER_REMOVE = 0;
@ -610,8 +605,8 @@ e_border_raise(E_Border *bd)
ev->above = NULL;
ecore_event_add(E_EVENT_BORDER_RAISE, ev, _e_border_event_border_raise_free, NULL);
}
if (move_ee) ecore_evas_raise(move_ee);
if (resize_ee) ecore_evas_raise(resize_ee);
/* FIXME, ugly hack! */
e_moveresize_raise();
}
void
@ -1958,7 +1953,7 @@ _e_border_cb_signal_drag(void *data, Evas_Object *obj, const char *emission, con
bd = data;
printf("drag_start\n");
printf("drag_start %s %s\n", emission, source);
if ((bd->client.icccm.name) && (bd->client.icccm.class))
{
E_App *a;
@ -2749,8 +2744,10 @@ _e_border_eval(E_Border *bd)
_e_border_cb_signal_resize_stop, bd);
edje_object_signal_callback_add(o, "action", "*",
_e_border_cb_signal_action, bd);
#if 0
edje_object_signal_callback_add(o, "drag", "*",
_e_border_cb_signal_drag, bd);
#endif
if (bd->focused)
edje_object_signal_emit(bd->bg_object, "active", "");
evas_object_move(o, 0, 0);
@ -3895,134 +3892,67 @@ _e_border_desk_update(E_Border *bd)
static void
_e_border_resize_begin(E_Border *bd)
{
Evas_Coord w, h;
char buf[40];
int w, h;
if (resize_ee)
if ((bd->client.icccm.base_w >= 0) &&
(bd->client.icccm.base_h >= 0))
{
e_canvas_del(resize_ee);
ecore_evas_free(resize_ee);
w = (bd->client.w - bd->client.icccm.base_w) / bd->client.icccm.step_w;
h = (bd->client.h - bd->client.icccm.base_h) / bd->client.icccm.step_h;
}
resize_ee = ecore_evas_software_x11_new(NULL, bd->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(resize_ee, 1);
ecore_evas_software_x11_direct_resize_set(resize_ee, 1);
e_canvas_add(resize_ee);
ecore_evas_borderless_set(resize_ee, 1);
ecore_evas_layer_set(resize_ee, 255);
ecore_evas_show(resize_ee);
resize_obj = edje_object_add(ecore_evas_get(resize_ee));
e_theme_edje_object_set(resize_obj, "base/theme/borders",
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999x9999");
edje_object_part_text_set(resize_obj, "text", buf);
edje_object_size_min_calc(resize_obj, &w, &h);
evas_object_move(resize_obj, 0, 0);
evas_object_resize(resize_obj, w, h);
evas_object_show(resize_obj);
_e_border_resize_update(bd);
ecore_evas_move(resize_ee, (bd->zone->w - w) / 2, (bd->zone->h - h) / 2);
ecore_evas_resize(resize_ee, w, h);
ecore_evas_show(resize_ee);
else
{
w = (bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w;
h = (bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h;
}
e_resize_begin(bd->zone, w, h);
resize = bd;
}
static void
_e_border_resize_end(E_Border *bd)
{
evas_object_del(resize_obj);
if (resize_ee)
{
e_canvas_del(resize_ee);
ecore_evas_free(resize_ee);
resize_ee = NULL;
}
e_resize_end();
resize = NULL;
}
static void
_e_border_resize_update(E_Border *bd)
{
char buf[40];
if (!resize_ee) return;
int w, h;
if ((bd->client.icccm.base_w >= 0) &&
(bd->client.icccm.base_h >= 0))
snprintf(buf, sizeof(buf), "%ix%i",
(bd->client.w - bd->client.icccm.base_w) / bd->client.icccm.step_w,
(bd->client.h - bd->client.icccm.base_h) / bd->client.icccm.step_h);
{
w = (bd->client.w - bd->client.icccm.base_w) / bd->client.icccm.step_w;
h = (bd->client.h - bd->client.icccm.base_h) / bd->client.icccm.step_h;
}
else
snprintf(buf, sizeof(buf), "%ix%i",
(bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w,
(bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h);
edje_object_part_text_set(resize_obj, "text", buf);
{
w = (bd->client.w - bd->client.icccm.min_w) / bd->client.icccm.step_w;
h = (bd->client.h - bd->client.icccm.min_h) / bd->client.icccm.step_h;
}
e_resize_update(w, h);
}
static void
_e_border_move_begin(E_Border *bd)
{
Evas_Coord w, h;
char buf[40];
if (move_ee)
{
e_canvas_del(move_ee);
ecore_evas_free(move_ee);
}
move_ee = ecore_evas_software_x11_new(NULL, bd->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(move_ee, 1);
ecore_evas_software_x11_direct_resize_set(move_ee, 1);
e_canvas_add(move_ee);
ecore_evas_borderless_set(move_ee, 1);
ecore_evas_layer_set(move_ee, 255);
move_obj = edje_object_add(ecore_evas_get(move_ee));
e_theme_edje_object_set(move_obj, "base/theme/borders",
"widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(move_obj, "text", buf);
edje_object_size_min_calc(move_obj, &w, &h);
evas_object_move(move_obj, 0, 0);
evas_object_resize(move_obj, w, h);
ecore_evas_move(move_ee, (bd->zone->w - w) / 2, (bd->zone->h - h) / 2);
ecore_evas_resize(move_ee, w, h);
e_move_begin(bd->zone, bd->x, bd->y);
move = bd;
}
static void
_e_border_move_end(E_Border *bd)
{
evas_object_del(move_obj);
if (move_ee)
{
e_canvas_del(move_ee);
ecore_evas_free(move_ee);
move_ee = NULL;
}
e_move_end();
move = NULL;
}
static void
_e_border_move_update(E_Border *bd)
{
char buf[40];
if (!move_ee) return;
evas_object_show(move_obj);
ecore_evas_show(move_ee);
snprintf(buf, sizeof(buf) - 1, "%i %i", bd->x, bd->y);
edje_object_part_text_set(move_obj, "text", buf);
e_move_update(bd->x, bd->y);
}
static void

@ -152,9 +152,6 @@ e_drag_end(int x, int y)
h = l->data;
printf("pos: %d %d\n", x, y);
printf("pos: %d %d %d %d", h->x, h->y, h->w, h->y);
printf("data: %s %s\n", h->type, drag_type);
if ((x >= h->x) && (x < h->x + h->w) && (y >= h->y) && (y < h->y + h->h)
&& (!strcmp(h->type, drag_type)))
{

@ -69,21 +69,6 @@ static void _e_gadman_cb_end_edit_mode(void *data, E_Menu *m, E_Menu_Item *mi);
static E_Config_DD *gadman_config_edd = NULL;
static Ecore_Evas *move_gm_ee = NULL;
static Evas_Object *move_gm_obj = NULL;
static Ecore_Evas *resize_left_gm_ee = NULL;
static Evas_Object *resize_left_gm_obj = NULL;
static Ecore_Evas *resize_right_gm_ee = NULL;
static Evas_Object *resize_right_gm_obj = NULL;
static Ecore_Evas *resize_up_gm_ee = NULL;
static Evas_Object *resize_up_gm_obj = NULL;
static Ecore_Evas *resize_down_gm_ee = NULL;
static Evas_Object *resize_down_gm_obj = NULL;
/* externally accessible functions */
int
e_gadman_init(void)
@ -1068,10 +1053,7 @@ static void
_e_gadman_cb_signal_move_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord w, h;
char buf[40];
gmc = data;
if (_e_gadman_client_is_being_modified(gmc)) return;
_e_gadman_client_down_store(gmc);
@ -1080,39 +1062,7 @@ _e_gadman_cb_signal_move_start(void *data, Evas_Object *obj, const char *emissio
evas_object_raise(gmc->event_object);
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_RAISE);
if (move_gm_ee)
{
e_canvas_del(move_gm_ee);
ecore_evas_free(move_gm_ee);
}
move_gm_ee = ecore_evas_software_x11_new(NULL,
gmc->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(move_gm_ee, 1);
ecore_evas_software_x11_direct_resize_set(move_gm_ee, 1);
e_canvas_add(move_gm_ee);
ecore_evas_borderless_set(move_gm_ee, 1);
ecore_evas_layer_set(move_gm_ee, 999);
ecore_evas_show(move_gm_ee);
move_gm_obj = edje_object_add(ecore_evas_get(move_gm_ee));
edje_object_file_set(move_gm_obj, e_path_find(path_themes, "default.edj"),
"widgets/border/default/move");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(move_gm_obj, "text", buf);
edje_object_size_min_calc(move_gm_obj, &w, &h);
evas_object_move(move_gm_obj, 0, 0);
evas_object_resize(move_gm_obj, w, h);
evas_object_show(move_gm_obj);
snprintf(buf, sizeof(buf), "%i %i", gmc->x, gmc->y);
edje_object_part_text_set(move_gm_obj, "text", buf);
ecore_evas_move(move_gm_ee, (gmc->zone->w - w) / 2, (gmc->zone->h - h) / 2);
ecore_evas_resize(move_gm_ee, w, h);
ecore_evas_show(move_gm_ee);
e_move_begin(gmc->zone, gmc->x, gmc->y);
}
static void
@ -1125,13 +1075,7 @@ _e_gadman_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission
_e_gadman_client_geometry_to_align(gmc);
e_gadman_client_save(gmc);
evas_object_del(move_gm_obj);
if (move_gm_ee)
{
e_canvas_del(move_gm_ee);
ecore_evas_hide(move_gm_ee);
move_gm_ee = NULL;
}
e_move_end();
}
static void
@ -1143,7 +1087,6 @@ _e_gadman_cb_signal_move_go(void *data, Evas_Object *obj, const char *emission,
int nx, ny, nxx, nyy;
int new_zone = 0;
Evas_List *skiplist = NULL;
char buf[40];
gmc = data;
@ -1293,57 +1236,21 @@ _e_gadman_cb_signal_move_go(void *data, Evas_Object *obj, const char *emission,
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
e_object_unref(E_OBJECT(gmc));
snprintf(buf, sizeof(buf) - 1, "%i %i", gmc->x, gmc->y);
edje_object_part_text_set(move_gm_obj, "text", buf);
e_move_update(gmc->x, gmc->y);
}
static void
_e_gadman_cb_signal_resize_left_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord w, h;
char buf[40];
gmc = data;
if (_e_gadman_client_is_being_modified(gmc)) return;
_e_gadman_client_down_store(gmc);
gmc->use_autow = 0;
gmc->resizing_l = 1;
if (resize_left_gm_ee)
{
e_canvas_del(resize_left_gm_ee);
ecore_evas_free(resize_left_gm_ee);
}
resize_left_gm_ee = ecore_evas_software_x11_new(NULL,
gmc->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(resize_left_gm_ee, 1);
ecore_evas_software_x11_direct_resize_set(resize_left_gm_ee, 1);
e_canvas_add(resize_left_gm_ee);
ecore_evas_borderless_set(resize_left_gm_ee, 1);
ecore_evas_layer_set(resize_left_gm_ee, 999);
ecore_evas_show(resize_left_gm_ee);
resize_left_gm_obj = edje_object_add(ecore_evas_get(resize_left_gm_ee));
edje_object_file_set(resize_left_gm_obj, e_path_find(path_themes, "default.edj"),
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(resize_left_gm_obj, "text", buf);
edje_object_size_min_calc(resize_left_gm_obj, &w, &h);
evas_object_move(resize_left_gm_obj, 0, 0);
evas_object_resize(resize_left_gm_obj, w, h);
evas_object_show(resize_left_gm_obj);
snprintf(buf, sizeof(buf), "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_left_gm_obj, "text", buf);
ecore_evas_move(resize_left_gm_ee, (gmc->zone->w - w) / 2, (gmc->zone->h - h) / 2);
ecore_evas_resize(resize_left_gm_ee, w, h);
ecore_evas_show(resize_left_gm_ee);
e_resize_begin(gmc->zone, gmc->w, gmc->h);
}
static void
@ -1355,13 +1262,7 @@ _e_gadman_cb_signal_resize_left_stop(void *data, Evas_Object *obj, const char *e
gmc->resizing_l = 0;
e_gadman_client_save(gmc);
evas_object_del(resize_left_gm_obj);
if (resize_left_gm_ee)
{
e_canvas_del(resize_left_gm_ee);
ecore_evas_hide(resize_left_gm_ee);
resize_left_gm_ee = NULL;
}
e_resize_end();
}
static void
@ -1369,7 +1270,6 @@ _e_gadman_cb_signal_resize_left_go(void *data, Evas_Object *obj, const char *emi
{
E_Gadman_Client *gmc;
Evas_Coord x, y;
char buf[40];
gmc = data;
if (!gmc->resizing_l) return;
@ -1419,56 +1319,21 @@ _e_gadman_cb_signal_resize_left_go(void *data, Evas_Object *obj, const char *emi
_e_gadman_client_geometry_apply(gmc);
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
snprintf(buf, sizeof(buf) - 1, "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_left_gm_obj, "text", buf);
e_resize_update(gmc->w, gmc->h);
}
static void
_e_gadman_cb_signal_resize_right_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord w, h;
char buf[40];
gmc = data;
if (_e_gadman_client_is_being_modified(gmc)) return;
_e_gadman_client_down_store(gmc);
gmc->use_autow = 0;
gmc->resizing_r = 1;
if (resize_right_gm_ee)
{
e_canvas_del(resize_right_gm_ee);
ecore_evas_free(resize_right_gm_ee);
}
resize_right_gm_ee = ecore_evas_software_x11_new(NULL,
gmc->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(resize_right_gm_ee, 1);
ecore_evas_software_x11_direct_resize_set(resize_right_gm_ee, 1);
e_canvas_add(resize_right_gm_ee);
ecore_evas_borderless_set(resize_right_gm_ee, 1);
ecore_evas_layer_set(resize_right_gm_ee, 999);
ecore_evas_show(resize_right_gm_ee);
resize_right_gm_obj = edje_object_add(ecore_evas_get(resize_right_gm_ee));
edje_object_file_set(resize_right_gm_obj, e_path_find(path_themes, "default.edj"),
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(resize_right_gm_obj, "text", buf);
edje_object_size_min_calc(resize_right_gm_obj, &w, &h);
evas_object_move(resize_right_gm_obj, 0, 0);
evas_object_resize(resize_right_gm_obj, w, h);
evas_object_show(resize_right_gm_obj);
snprintf(buf, sizeof(buf), "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_right_gm_obj, "text", buf);
ecore_evas_move(resize_right_gm_ee, (gmc->zone->w - w) / 2, (gmc->zone->h - h) / 2);
ecore_evas_resize(resize_right_gm_ee, w, h);
ecore_evas_show(resize_right_gm_ee);
e_resize_begin(gmc->zone, gmc->w, gmc->h);
}
static void
@ -1480,22 +1345,15 @@ _e_gadman_cb_signal_resize_right_stop(void *data, Evas_Object *obj, const char *
gmc->resizing_r = 0;
e_gadman_client_save(gmc);
evas_object_del(resize_right_gm_obj);
if (resize_right_gm_ee)
{
e_canvas_del(resize_right_gm_ee);
ecore_evas_hide(resize_right_gm_ee);
resize_right_gm_ee = NULL;
}
e_resize_end();
}
static void
_e_gadman_cb_signal_resize_right_go(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord x, y;
char buf[40];
Evas_Coord x, y;
gmc = data;
if (!gmc->resizing_r) return;
if (!(gmc->policy & E_GADMAN_POLICY_HSIZE)) return;
@ -1540,56 +1398,21 @@ _e_gadman_cb_signal_resize_right_go(void *data, Evas_Object *obj, const char *em
_e_gadman_client_geometry_apply(gmc);
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
snprintf(buf, sizeof(buf) - 1, "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_right_gm_obj, "text", buf);
e_resize_update(gmc->w, gmc->h);
}
static void
_e_gadman_cb_signal_resize_up_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord w, h;
char buf[40];
gmc = data;
if (_e_gadman_client_is_being_modified(gmc)) return;
_e_gadman_client_down_store(gmc);
gmc->use_autoh = 0;
gmc->resizing_u = 1;
if (resize_up_gm_ee)
{
e_canvas_del (resize_up_gm_ee);
ecore_evas_free(resize_up_gm_ee);
}
resize_up_gm_ee = ecore_evas_software_x11_new(NULL,
gmc->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(resize_up_gm_ee, 1);
ecore_evas_software_x11_direct_resize_set(resize_up_gm_ee, 1);
e_canvas_add(resize_up_gm_ee);
ecore_evas_borderless_set(resize_up_gm_ee, 1);
ecore_evas_layer_set(resize_up_gm_ee, 999);
ecore_evas_show(resize_up_gm_ee);
resize_up_gm_obj = edje_object_add(ecore_evas_get(resize_up_gm_ee));
edje_object_file_set(resize_up_gm_obj, e_path_find(path_themes, "default.edj"),
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(resize_up_gm_obj, "text", buf);
edje_object_size_min_calc(resize_up_gm_obj, &w, &h);
evas_object_move(resize_up_gm_obj, 0, 0);
evas_object_resize(resize_up_gm_obj, w, h);
evas_object_show(resize_up_gm_obj);
snprintf(buf, sizeof(buf), "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_up_gm_obj, "text", buf);
ecore_evas_move(resize_up_gm_ee, (gmc->zone->w - w) / 2, (gmc->zone->h - h) / 2);
ecore_evas_resize(resize_up_gm_ee, w, h);
ecore_evas_show(resize_up_gm_ee);
e_resize_begin(gmc->zone, gmc->w, gmc->h);
}
static void
@ -1601,22 +1424,15 @@ _e_gadman_cb_signal_resize_up_stop(void *data, Evas_Object *obj, const char *emi
gmc->resizing_u = 0;
e_gadman_client_save(gmc);
evas_object_del(resize_up_gm_obj);
if (resize_up_gm_ee)
{
e_canvas_del (resize_up_gm_ee);
ecore_evas_hide(resize_up_gm_ee);
resize_up_gm_ee = NULL;
}
e_resize_end();
}
static void
_e_gadman_cb_signal_resize_up_go(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord x, y;
char buf[40];
Evas_Coord x, y;
gmc = data;
if (!gmc->resizing_u) return;
if (!(gmc->policy & E_GADMAN_POLICY_VSIZE)) return;
@ -1665,16 +1481,13 @@ _e_gadman_cb_signal_resize_up_go(void *data, Evas_Object *obj, const char *emiss
_e_gadman_client_geometry_apply(gmc);
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
snprintf(buf, sizeof(buf) - 1, "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_up_gm_obj, "text", buf);
e_resize_update(gmc->w, gmc->h);
}
static void
_e_gadman_cb_signal_resize_down_start(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord w, h;
char buf[40];
gmc = data;
if (_e_gadman_client_is_being_modified(gmc)) return;
@ -1682,39 +1495,7 @@ _e_gadman_cb_signal_resize_down_start(void *data, Evas_Object *obj, const char *
gmc->use_autoh = 0;
gmc->resizing_d = 1;
if (resize_down_gm_ee)
{
e_canvas_del(resize_down_gm_ee);
ecore_evas_free(resize_down_gm_ee);
}
resize_down_gm_ee = ecore_evas_software_x11_new(NULL,
gmc->zone->container->manager->win,
0, 0, 10, 10);
ecore_evas_override_set(resize_down_gm_ee, 1);
ecore_evas_software_x11_direct_resize_set(resize_down_gm_ee, 1);
e_canvas_add(resize_down_gm_ee);
ecore_evas_borderless_set(resize_down_gm_ee, 1);
ecore_evas_layer_set(resize_down_gm_ee, 999);
ecore_evas_show(resize_down_gm_ee);
resize_down_gm_obj = edje_object_add(ecore_evas_get(resize_down_gm_ee));
edje_object_file_set(resize_down_gm_obj, e_path_find(path_themes, "default.edj"),
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999 9999");
edje_object_part_text_set(resize_down_gm_obj, "text", buf);
edje_object_size_min_calc(resize_down_gm_obj, &w, &h);
evas_object_move(resize_down_gm_obj, 0, 0);
evas_object_resize(resize_down_gm_obj, w, h);
evas_object_show(resize_down_gm_obj);
snprintf(buf, sizeof(buf), "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_down_gm_obj, "text", buf);
ecore_evas_move(resize_down_gm_ee, (gmc->zone->w - w) / 2, (gmc->zone->h - h) / 2);
ecore_evas_resize(resize_down_gm_ee, w, h);
ecore_evas_show(resize_down_gm_ee);
e_resize_begin(gmc->zone, gmc->w, gmc->h);
}
static void
@ -1726,22 +1507,15 @@ _e_gadman_cb_signal_resize_down_stop(void *data, Evas_Object *obj, const char *e
gmc->resizing_d = 0;
e_gadman_client_save(gmc);
evas_object_del(resize_down_gm_obj);
if (resize_down_gm_ee)
{
e_canvas_del(resize_down_gm_ee);
ecore_evas_hide(resize_down_gm_ee);
resize_down_gm_ee = NULL;
}
e_resize_end();
}
static void
_e_gadman_cb_signal_resize_down_go(void *data, Evas_Object *obj, const char *emission, const char *source)
{
E_Gadman_Client *gmc;
Evas_Coord x, y;
char buf[40];
Evas_Coord x, y;
gmc = data;
if (!gmc->resizing_d) return;
if (!(gmc->policy & E_GADMAN_POLICY_VSIZE)) return;
@ -1786,8 +1560,7 @@ _e_gadman_cb_signal_resize_down_go(void *data, Evas_Object *obj, const char *emi
_e_gadman_client_geometry_apply(gmc);
_e_gadman_client_callback_call(gmc, E_GADMAN_CHANGE_MOVE_RESIZE);
snprintf(buf, sizeof(buf) - 1, "(%i,%i)", gmc->w, gmc->h);
edje_object_part_text_set(resize_down_gm_obj, "text", buf);
e_resize_update(gmc->w, gmc->h);
}
static void

@ -37,3 +37,4 @@
#include "e_intl.h"
#include "e_theme.h"
#include "e_dnd.h"
#include "e_moveresize.h"

@ -0,0 +1,131 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
Ecore_Evas *_ee = NULL;
Evas_Object *_obj = NULL;
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->manager->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);
ecore_evas_layer_set(_ee, 255);
ecore_evas_show(_ee);
_obj = edje_object_add(ecore_evas_get(_ee));
e_theme_edje_object_set(_obj, "base/theme/borders",
"widgets/border/default/resize");
snprintf(buf, sizeof(buf), "9999x9999");
edje_object_part_text_set(_obj, "text", buf);
edje_object_size_min_calc(_obj, &ew, &eh);
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, ew, eh);
evas_object_show(_obj);
e_resize_update(w, h);
ecore_evas_move(_ee, (zone->w - ew) / 2, (zone->h - eh) / 2);
ecore_evas_resize(_ee, ew, eh);
ecore_evas_show(_ee);
}
void e_resize_end(void)
{
evas_object_del(_obj);
if (_ee)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
_ee = NULL;
}
}
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);
edje_object_part_text_set(_obj, "text", buf);
}
void e_move_begin(E_Zone *zone, int x, int y)
{
Evas_Coord w, h;
char buf[40];
if (_ee)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
}
_ee = ecore_evas_software_x11_new(NULL, zone->container->manager->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);
ecore_evas_layer_set(_ee, 255);
_obj = edje_object_add(ecore_evas_get(_ee));
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);
evas_object_move(_obj, 0, 0);
evas_object_resize(_obj, w, h);
ecore_evas_move(_ee, (zone->w - w) / 2, (zone->h - h) / 2);
ecore_evas_resize(_ee, w, h);
}
void e_move_end(void)
{
evas_object_del(_obj);
if (_ee)
{
e_canvas_del(_ee);
ecore_evas_free(_ee);
_ee = NULL;
}
}
void e_move_update(int x, int y)
{
char buf[40];
if (!_ee) return;
evas_object_show(_obj);
ecore_evas_show(_ee);
snprintf(buf, sizeof(buf) - 1, "%i %i", x, y);
edje_object_part_text_set(_obj, "text", buf);
}
void
e_moveresize_raise(void)
{
if (_ee) ecore_evas_raise(_ee);
}

@ -0,0 +1,13 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
EAPI void e_resize_begin(E_Zone *zone, int w, int h);
EAPI void e_resize_end(void);
EAPI void e_resize_update(int w, int h);
EAPI void e_move_begin(E_Zone *zone, int x, int y);
EAPI void e_move_end(void);
EAPI void e_move_update(int x, int y);
EAPI void e_moveresize_raise(void);
Loading…
Cancel
Save