Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_border.c e_dnd.c e_fm.c e_fm.h e_gadcon.c e_int_config_wallpaper_import.c e_shelf.c e_utils.c e_utils.h e_widget_fsel.c e_widget_fsel.h Log Message: i'm cleaning up dnd. fixed leaks. made dnd more convenient - less work to do (it returns x,y coords relative to the drop target geom, not the screen, start putting in all the necessary stuff in fm2 - can dnd 2 file now (drop has no effect though)... =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.545 retrieving revision 1.546 diff -u -3 -r1.545 -r1.546 --- e_border.c 17 Sep 2006 02:50:17 -0000 1.545 +++ e_border.c 18 Sep 2006 03:49:44 -0000 1.546 @@ -4719,9 +4719,10 @@ e_drag_resize(drag, w, h); e_drag_start(drag, bd->drag.x, bd->drag.y); - evas_event_feed_mouse_up(bd->bg_evas, 1, - EVAS_BUTTON_NONE, ev->time, - NULL); + e_util_evas_fake_mouse_up_later(bd->bg_evas, 1); +// evas_event_feed_mouse_up(bd->bg_evas, 1, +// EVAS_BUTTON_NONE, ev->time, +// NULL); } bd->drag.start = 0; } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_dnd.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -3 -r1.49 -r1.50 --- e_dnd.c 17 Sep 2006 06:12:48 -0000 1.49 +++ e_dnd.c 18 Sep 2006 03:49:44 -0000 1.50 @@ -509,30 +509,14 @@ case E_WIN_TYPE: px = ((E_Win *)(h->obj))->x; py = ((E_Win *)(h->obj))->y; - if ((((E_Win *)(h->obj))->border) && - (((E_Win *)(h->obj))->border->zone)) - { - px -= ((E_Win *)(h->obj))->border->zone->x; - py -= ((E_Win *)(h->obj))->border->zone->y; - } break; case E_BORDER_TYPE: px = ((E_Border *)(h->obj))->x + ((E_Border *)(h->obj))->fx.x; py = ((E_Border *)(h->obj))->y + ((E_Border *)(h->obj))->fx.y; - if (((E_Border *)(h->obj))->zone) - { - px -= ((E_Border *)(h->obj))->zone->x; - py -= ((E_Border *)(h->obj))->zone->y; - } break; case E_POPUP_TYPE: px = ((E_Popup *)(h->obj))->x; py = ((E_Popup *)(h->obj))->y; - if (((E_Popup *)(h->obj))->zone) - { - px -= ((E_Popup *)(h->obj))->zone->x; - py -= ((E_Popup *)(h->obj))->zone->y; - } break; /* FIXME: add mroe types as needed */ default: @@ -577,9 +561,9 @@ _e_drag_update(int x, int y) { Evas_List *l; - E_Event_Dnd_Enter *enter_ev; - E_Event_Dnd_Move *move_ev; - E_Event_Dnd_Leave *leave_ev; + E_Event_Dnd_Enter enter_ev; + E_Event_Dnd_Move move_ev; + E_Event_Dnd_Leave leave_ev; int dx, dy, dw, dh; Ecore_X_Window win, ignore_win[2]; @@ -588,7 +572,7 @@ ignore_win[0] = _drag_current->evas_win; ignore_win[1] = _drag_win; /* this is nasty - but necessary to get the window stacking */ - win = ecore_x_window_at_xy_with_skip_get(x, y, &ignore_win, 2); + win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2); } else win = ecore_x_window_at_xy_with_skip_get(x, y, NULL, 0); @@ -599,18 +583,6 @@ _e_drag_move(_drag_current, x, y); } - enter_ev = E_NEW(E_Event_Dnd_Enter, 1); - enter_ev->x = x; - enter_ev->y = y; - - move_ev = E_NEW(E_Event_Dnd_Move, 1); - move_ev->x = x; - move_ev->y = y; - - leave_ev = E_NEW(E_Event_Dnd_Leave, 1); - leave_ev->x = x; - leave_ev->y = y; - if ((_drag_current) && (_drag_current->types)) { for (l = _drop_handlers; l; l = l->next) @@ -620,24 +592,30 @@ h = l->data; if (!h->active) continue; _e_drag_coords_update(h, &dx, &dy, &dw, &dh); + enter_ev.x = x - dx; + enter_ev.y = y - dy; + move_ev.x = x - dx; + move_ev.y = y - dy; + leave_ev.x = x - dx; + leave_ev.y = y - dy; if ((_e_drag_win_matches(h, win)) && (E_INSIDE(x, y, dx, dy, dw, dh))) { if (!h->entered) { if (h->cb.enter) - h->cb.enter(h->cb.data, _drag_current->types[0], enter_ev); + h->cb.enter(h->cb.data, _drag_current->types[0], &enter_ev); h->entered = 1; } if (h->cb.move) - h->cb.move(h->cb.data, _drag_current->types[0], move_ev); + h->cb.move(h->cb.data, _drag_current->types[0], &move_ev); } else { if (h->entered) { if (h->cb.leave) - h->cb.leave(h->cb.data, _drag_current->types[0], leave_ev); + h->cb.leave(h->cb.data, _drag_current->types[0], &leave_ev); h->entered = 0; } } @@ -652,32 +630,35 @@ h = l->data; if (!h->active) continue; _e_drag_coords_update(h, &dx, &dy, &dw, &dh); + enter_ev.x = x - dx; + enter_ev.y = y - dy; + move_ev.x = x - dx; + move_ev.y = y - dy; + leave_ev.x = x - dx; + leave_ev.y = y - dy; if ((_e_drag_win_matches(h, win)) && (E_INSIDE(x, y, dx, dy, dw, dh))) { if (!h->entered) { if (h->cb.enter) - h->cb.enter(h->cb.data, _xdnd->type, enter_ev); + h->cb.enter(h->cb.data, _xdnd->type, &enter_ev); h->entered = 1; } if (h->cb.move) - h->cb.move(h->cb.data, _xdnd->type, move_ev); + h->cb.move(h->cb.data, _xdnd->type, &move_ev); } else { if (h->entered) { if (h->cb.leave) - h->cb.leave(h->cb.data, _xdnd->type, leave_ev); + h->cb.leave(h->cb.data, _xdnd->type, &leave_ev); h->entered = 0; } } } } - free(enter_ev); - free(move_ev); - free(leave_ev); } static void @@ -685,7 +666,7 @@ { E_Zone *zone; Evas_List *l; - E_Event_Dnd_Drop *ev; + E_Event_Dnd_Drop ev; const char *type = NULL; int dx, dy, dw, dh; Ecore_X_Window win, ignore_win[2]; @@ -694,7 +675,7 @@ ignore_win[0] = _drag_current->evas_win; ignore_win[1] = _drag_win; /* this is nasty - but necessary to get the window stacking */ - win = ecore_x_window_at_xy_with_skip_get(x, y, &ignore_win, 2); + win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2); zone = e_container_zone_at_point_get(_drag_current->container, x, y); /* Pass -1, -1, so that it is possible to drop at the edge. */ if (zone) e_zone_flip_coords_handle(zone, -1, -1); @@ -717,13 +698,9 @@ ecore_x_window_del(_drag_win); _drag_win = 0; - ev = E_NEW(E_Event_Dnd_Drop, 1); - ev->data = _drag_current->data; + ev.data = _drag_current->data; type = _drag_current->types[0]; - ev->x = x; - ev->y = y; - - if (ev->data) + if (ev.data) { int dropped; @@ -735,11 +712,13 @@ h = l->data; if (!h->active) continue; _e_drag_coords_update(h, &dx, &dy, &dw, &dh); + ev.x = x - dx; + ev.y = y - dy; if ((_e_drag_win_matches(h, win)) && ((h->cb.drop) && (E_INSIDE(x, y, dx, dy, dw, dh)))) { - h->cb.drop(h->cb.data, type, ev); + h->cb.drop(h->cb.data, type, &ev); dropped = 1; } } @@ -751,12 +730,11 @@ else { /* Just leave */ - E_Event_Dnd_Leave *leave_ev; + E_Event_Dnd_Leave leave_ev; - leave_ev = E_NEW(E_Event_Dnd_Leave, 1); /* FIXME: We don't need x and y in leave */ - leave_ev->x = 0; - leave_ev->y = 0; + leave_ev.x = 0; + leave_ev.y = 0; for (l = _drop_handlers; l; l = l->next) { @@ -770,20 +748,18 @@ if (h->entered) { if (h->cb.leave) - h->cb.leave(h->cb.data, type, leave_ev); + h->cb.leave(h->cb.data, type, &leave_ev); h->entered = 0; } } } - - free(ev); } static void _e_drag_xdnd_end(int x, int y) { Evas_List *l; - E_Event_Dnd_Drop *ev; + E_Event_Dnd_Drop ev; const char *type = NULL; int dx, dy, dw, dh; Ecore_X_Window win, ignore_win[2]; @@ -794,18 +770,15 @@ ignore_win[0] = _drag_current->evas_win; ignore_win[1] = _drag_win; /* this is nasty - but necessary to get the window stacking */ - win = ecore_x_window_at_xy_with_skip_get(x, y, &ignore_win, 2); + win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2); } else win = ecore_x_window_at_xy_with_skip_get(x, y, NULL, 0); - ev = E_NEW(E_Event_Dnd_Drop, 1); - ev->data = _xdnd->data; + ev.data = _xdnd->data; type = _xdnd->type; - ev->x = x; - ev->y = y; - if (ev->data) + if (ev.data) { int dropped; @@ -817,11 +790,13 @@ h = l->data; if (!h->active) continue; _e_drag_coords_update(h, &dx, &dy, &dw, &dh); + ev.x = x - dx; + ev.y = y - dy; if ((_e_drag_win_matches(h, win)) && ((h->cb.drop) && (E_INSIDE(x, y, dx, dy, dw, dh)))) { - h->cb.drop(h->cb.data, type, ev); + h->cb.drop(h->cb.data, type, &ev); dropped = 1; } } @@ -829,12 +804,11 @@ else { /* Just leave */ - E_Event_Dnd_Leave *leave_ev; + E_Event_Dnd_Leave leave_ev; - leave_ev = E_NEW(E_Event_Dnd_Leave, 1); /* FIXME: We don't need x and y in leave */ - leave_ev->x = 0; - leave_ev->y = 0; + leave_ev.x = 0; + leave_ev.y = 0; for (l = _drop_handlers; l; l = l->next) { @@ -848,13 +822,11 @@ if (h->entered) { if (h->cb.leave) - h->cb.leave(h->cb.data, type, leave_ev); + h->cb.leave(h->cb.data, type, &leave_ev); h->entered = 0; } } } - - free(ev); } static void @@ -872,8 +844,7 @@ evas_object_del(drag->object); e_canvas_del(drag->ecore_evas); ecore_evas_free(drag->ecore_evas); - for (i = 0; i < drag->num_types; i++) - free(drag->types[i]); + for (i = 0; i < drag->num_types; i++) free(drag->types[i]); free(drag->types); free(drag); } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -3 -r1.64 -r1.65 --- e_fm.c 17 Sep 2006 23:13:10 -0000 1.64 +++ e_fm.c 18 Sep 2006 03:49:44 -0000 1.65 @@ -71,8 +71,11 @@ struct { char *buf; } typebuf; + + E_Object *eobj; + E_Drop_Handler *drop_handler; }; - + struct _E_Fm2_Region { E_Fm2_Smart_Data *sd; @@ -95,6 +98,12 @@ E_Fm2_Icon_Info info; + struct { + Evas_Coord x, y; + unsigned char start : 1; + unsigned char dnd : 1; + } drag; + unsigned char realized : 1; unsigned char selected : 1; unsigned char last_selected : 1; @@ -123,6 +132,7 @@ static void _e_fm2_icon_unrealize(E_Fm2_Icon *ic); static int _e_fm2_icon_visible(E_Fm2_Icon *ic); static void _e_fm2_icon_label_set(E_Fm2_Icon *ic, Evas_Object *obj); +static Evas_Object *_e_fm2_icon_icon_direct_set(E_Fm2_Icon *ic, Evas_Object *o, void (*gen_func) (void *data, Evas_Object *obj, void *event_info), void *data); static void _e_fm2_icon_icon_set(E_Fm2_Icon *ic); static void _e_fm2_icon_thumb(E_Fm2_Icon *ic); static void _e_fm2_icon_select(E_Fm2_Icon *ic); @@ -135,9 +145,31 @@ static void _e_fm2_region_unrealize(E_Fm2_Region *rg); static int _e_fm2_region_visible(E_Fm2_Region *rg); +static void _e_fm2_icon_make_visible(E_Fm2_Icon *ic); +static void _e_fm2_icon_desel_any(Evas_Object *obj); +static E_Fm2_Icon *_e_fm2_icon_first_selected_find(Evas_Object *obj); +static void _e_fm2_icon_sel_first(Evas_Object *obj); +static void _e_fm2_icon_sel_last(Evas_Object *obj); +static void _e_fm2_icon_sel_prev(Evas_Object *obj); +static void _e_fm2_icon_sel_next(Evas_Object *obj); +static void _e_fm2_typebuf_show(Evas_Object *obj); +static void _e_fm2_typebuf_hide(Evas_Object *obj); +static void _e_fm2_typebuf_history_prev(Evas_Object *obj); +static void _e_fm2_typebuf_history_next(Evas_Object *obj); +static void _e_fm2_typebuf_run(Evas_Object *obj); +static void _e_fm2_typebuf_match(Evas_Object *obj); +static void _e_fm2_typebuf_complete(Evas_Object *obj); +static void _e_fm2_typebuf_char_append(Evas_Object *obj, char *ch); +static void _e_fm2_typebuf_char_backspace(Evas_Object *obj); + +static void _e_fm2_cb_dnd_enter(void *data, const char *type, void *event); +static void _e_fm2_cb_dnd_move(void *data, const char *type, void *event); +static void _e_fm2_cb_dnd_leave(void *data, const char *type, void *event); +static void _e_fm2_cb_dnd_drop(void *data, const char *type, void *event); static void _e_fm2_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _e_fm2_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _e_fm2_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _e_fm2_cb_icon_thumb_dnd_gen(void *data, Evas_Object *obj, void *event_info); static void _e_fm2_cb_icon_thumb_gen(void *data, Evas_Object *obj, void *event_info); static void _e_fm2_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _e_fm2_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -489,8 +521,7 @@ ic = l->data; if (!strcmp(ic->info.file, file)) { - e_fm2_pan_set(obj, ic->x, ic->y); - evas_object_smart_callback_call(obj, "pan_changed", NULL); + _e_fm2_icon_make_visible(ic); return; } } @@ -522,6 +553,26 @@ sd->icon_menu.end.data = data; } +EAPI void +e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj) +{ + E_Fm2_Smart_Data *sd; + const char *drop[] = { "enlightenment/eapp", "enlightenment/border", "text/uri-list" }; + + sd = evas_object_smart_data_get(obj); + if (!sd) return; // safety + if (!evas_object_type_get(obj)) return; // safety + if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety + sd->eobj = eobj; + if (sd->drop_handler) e_drop_handler_del(sd->drop_handler); + sd->drop_handler = e_drop_handler_add(sd->eobj, + sd, + _e_fm2_cb_dnd_enter, + _e_fm2_cb_dnd_move, + _e_fm2_cb_dnd_leave, + _e_fm2_cb_dnd_drop, + drop, 3, sd->x, sd->y, sd->w, sd->h); +} EAPI void e_fm2_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y) @@ -1530,9 +1581,10 @@ } } -static void -_e_fm2_icon_icon_set(E_Fm2_Icon *ic) +static Evas_Object * +_e_fm2_icon_icon_direct_set(E_Fm2_Icon *ic, Evas_Object *o, void (*gen_func) (void *data, Evas_Object *obj, void *event_info), void *data) { + Evas_Object *oic; char buf[4096], *p; if (!ic->realized) return; @@ -1549,27 +1601,27 @@ if (ic->info.icon[0] == '/') { /* path to icon file */ - ic->obj_icon = e_icon_add(evas_object_evas_get(ic->sd->obj)); - e_icon_file_set(ic->obj_icon, ic->info.icon); - e_icon_fill_inside_set(ic->obj_icon, 1); + oic = e_icon_add(evas_object_evas_get(o)); + e_icon_file_set(oic, ic->info.icon); + e_icon_fill_inside_set(oic, 1); } else { /* theme icon */ - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - e_util_edje_icon_set(ic->obj_icon, ic->info.icon); + oic = edje_object_add(evas_object_evas_get(o)); + e_util_edje_icon_set(oic, ic->info.icon); } - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); - return; + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); + return oic; } if (S_ISDIR(ic->info.statinfo.st_mode)) { - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + oic = edje_object_add(evas_object_evas_get(o)); + e_theme_edje_object_set(oic, "base/theme/fileman", "e/icons/fileman/folder"); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); } else { @@ -1581,8 +1633,8 @@ /* use mime type to select icon */ if (!icon) { - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + oic = edje_object_add(evas_object_evas_get(o)); + e_theme_edje_object_set(oic, "base/theme/fileman", "e/icons/fileman/file"); } else if (!strcmp(icon, "THUMB")) @@ -1591,10 +1643,11 @@ snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); else snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); - ic->obj_icon = e_thumb_icon_add(evas_object_evas_get(ic->sd->obj)); - e_thumb_icon_file_set(ic->obj_icon, buf, NULL); - e_thumb_icon_size_set(ic->obj_icon, 128, 128); - evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic); + oic = e_thumb_icon_add(evas_object_evas_get(o)); + e_thumb_icon_file_set(oic, buf, NULL); + e_thumb_icon_size_set(oic, 128, 128); + evas_object_smart_callback_add(oic, "e_thumb_gen", + gen_func, data); _e_fm2_icon_thumb(ic); } else if (!strcmp(icon, "DESKTOP")) @@ -1603,19 +1656,20 @@ snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); else snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); - ic->obj_icon = e_thumb_icon_add(evas_object_evas_get(ic->sd->obj)); - e_thumb_icon_file_set(ic->obj_icon, buf, e_config->icon_theme); - e_thumb_icon_size_set(ic->obj_icon, 128, 128); - evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic); + oic = e_thumb_icon_add(evas_object_evas_get(o)); + e_thumb_icon_file_set(oic, buf, e_config->icon_theme); + e_thumb_icon_size_set(oic, 128, 128); + evas_object_smart_callback_add(oic, "e_thumb_gen", + gen_func, data); _e_fm2_icon_thumb(ic); } else if (!strncmp(icon, "e/icons/fileman/mime/", 21)) { - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - if (!e_theme_edje_object_set(ic->obj_icon, + oic = edje_object_add(evas_object_evas_get(o)); + if (!e_theme_edje_object_set(oic, "base/theme/fileman", icon)) - e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + e_theme_edje_object_set(oic, "base/theme/fileman", "e/icons/fileman/file"); } else @@ -1623,22 +1677,21 @@ p = strrchr(icon, '.'); if ((p) && (!strcmp(p, ".edj"))) { - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - if (!e_theme_edje_object_set(ic->obj_icon, + oic = edje_object_add(evas_object_evas_get(o)); + if (!e_theme_edje_object_set(oic, "base/theme/fileman", icon)) - e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + e_theme_edje_object_set(oic, "base/theme/fileman", "e/icons/fileman/file"); } else { - ic->obj_icon = e_icon_add(evas_object_evas_get(ic->sd->obj)); - e_icon_file_set(ic->obj_icon, icon); + oic = e_icon_add(evas_object_evas_get(o)); + e_icon_file_set(oic, icon); } } - edje_object_part_swallow(ic->obj, "e.swallow.icon", - ic->obj_icon); - evas_object_show(ic->obj_icon); + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); return; } else @@ -1652,24 +1705,25 @@ snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); else snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); - ic->obj_icon = e_thumb_icon_add(evas_object_evas_get(ic->sd->obj)); + oic = e_thumb_icon_add(evas_object_evas_get(o)); if (ic->sd->config->icon.key_hint) - e_thumb_icon_file_set(ic->obj_icon, buf, ic->sd->config->icon.key_hint); + e_thumb_icon_file_set(oic, buf, ic->sd->config->icon.key_hint); else - { - /* FIXME: There is probably a quicker way of doing this. */ - if (edje_file_group_exists(buf, "icon")) - e_thumb_icon_file_set(ic->obj_icon, buf, "icon"); - else if (edje_file_group_exists(buf, "e/desktop/background")) - e_thumb_icon_file_set(ic->obj_icon, buf, "e/desktop/background"); - else if (edje_file_group_exists(buf, "e/init/splash")) - e_thumb_icon_file_set(ic->obj_icon, buf, "e/init/splash"); - } - e_thumb_icon_size_set(ic->obj_icon, 128, 96); - evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic); + { + /* FIXME: There is probably a quicker way of doing this. */ + if (edje_file_group_exists(buf, "icon")) + e_thumb_icon_file_set(oic, buf, "icon"); + else if (edje_file_group_exists(buf, "e/desktop/background")) + e_thumb_icon_file_set(oic, buf, "e/desktop/background"); + else if (edje_file_group_exists(buf, "e/init/splash")) + e_thumb_icon_file_set(oic, buf, "e/init/splash"); + } + e_thumb_icon_size_set(oic, 128, 96); + evas_object_smart_callback_add(oic, "e_thumb_gen", + gen_func, data); _e_fm2_icon_thumb(ic); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); } else if ( (e_util_glob_case_match(ic->info.file, "*.eap")) @@ -1679,10 +1733,10 @@ snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); else snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - edje_object_file_set(ic->obj_icon, buf, "icon"); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + oic = edje_object_add(evas_object_evas_get(o)); + edje_object_file_set(oic, buf, "icon"); + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); } else if ( (e_util_glob_case_match(ic->info.file, "*.desktop")) @@ -1693,29 +1747,35 @@ else snprintf(buf, sizeof(buf), "%s/%s", ic->sd->realpath, ic->info.file); - ic->obj_icon = e_thumb_icon_add(evas_object_evas_get(ic->sd->obj)); -// FIXME: Dunno if key_hint is useful here, no one seems to use it. -// if (ic->sd->config->icon.key_hint) -// e_thumb_icon_file_set(ic->obj_icon, buf, ic->sd->config->icon.key_hint); -// else - e_thumb_icon_file_set(ic->obj_icon, buf, e_config->icon_theme); - e_thumb_icon_size_set(ic->obj_icon, 128, 96); - evas_object_smart_callback_add(ic->obj_icon, "e_thumb_gen", _e_fm2_cb_icon_thumb_gen, ic); + oic = e_thumb_icon_add(evas_object_evas_get(o)); + e_thumb_icon_file_set(oic, buf, e_config->icon_theme); + e_thumb_icon_size_set(oic, 128, 96); + evas_object_smart_callback_add(oic, "e_thumb_gen", + gen_func, data); _e_fm2_icon_thumb(ic); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); } else { - ic->obj_icon = edje_object_add(evas_object_evas_get(ic->sd->obj)); - e_theme_edje_object_set(ic->obj_icon, "base/theme/fileman", + oic = edje_object_add(evas_object_evas_get(o)); + e_theme_edje_object_set(oic, "base/theme/fileman", "e/icons/fileman/file"); - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - evas_object_show(ic->obj_icon); + edje_object_part_swallow(o, "e.swallow.icon", oic); + evas_object_show(oic); } } } + return oic; +} + +static void +_e_fm2_icon_icon_set(E_Fm2_Icon *ic) +{ + ic->obj_icon = _e_fm2_icon_icon_direct_set(ic, ic->obj, + _e_fm2_cb_icon_thumb_gen, + ic->obj); } static void @@ -1908,192 +1968,6 @@ return 0; } -/**************************/ - -static void -_e_fm2_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Down *ev; - E_Fm2_Icon *ic, *ic2; - int multi_sel = 0, range_sel = 0, seen = 0; - Evas_List *l; - - ic = data; - ev = event_info; - if ((ev->button == 1) && (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)) - { - /* if its a directory && open dirs in-place is set then change the dir - * to be the dir + file */ - if ((S_ISDIR(ic->info.statinfo.st_mode)) && - (ic->sd->config->view.open_dirs_in_place) && - (!ic->sd->config->view.no_subdir_jump) && - (!ic->sd->config->view.single_click) - ) - { - char buf[4096], *dev = NULL; - - if (ic->sd->dev) dev = strdup(ic->sd->dev); - if (ic->info.pseudo_link) - snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); - else - snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file); - e_fm2_path_set(ic->sd->obj, dev, buf); - E_FREE(dev); - } - else - { - evas_object_smart_callback_call(ic->sd->obj, "selected", NULL); - } - /* if its in file selector mode then signal that a selection has - * taken place and dont do anything more */ - - /* do the below per selected file */ - /* if its a directory and open dirs in-place is not set, then - * signal owner that a new dir should be opened */ - /* if its a normal file - do what the mime type says to do with - * that file type */ - } - else if (ev->button == 1) - { - if (ic->sd->config->selection.windows_modifiers) - { - if (evas_key_modifier_is_set(ev->modifiers, "Shift")) - range_sel = 1; - else if (evas_key_modifier_is_set(ev->modifiers, "Control")) - multi_sel = 1; - } - else - { - if (evas_key_modifier_is_set(ev->modifiers, "Control")) - range_sel = 1; - else if (evas_key_modifier_is_set(ev->modifiers, "Shift")) - multi_sel = 1; - } - if (ic->sd->config->selection.single) - { - multi_sel = 0; - range_sel = 0; - } - if (range_sel) - { - /* find last selected - if any, and select all icons between */ - for (l = ic->sd->icons; l; l = l->next) - { - ic2 = l->data; - if (ic2 == ic) seen = 1; - if (ic2->last_selected) - { - ic2->last_selected = 0; - if (seen) - { - for (; (l) && (l->data != ic); l = l->prev) - { - ic2 = l->data; - _e_fm2_icon_select(ic2); - ic2->last_selected = 0; - } - } - else - { - for (; (l) && (l->data != ic); l = l->next) - { - ic2 = l->data; - _e_fm2_icon_select(ic2); - ic2->last_selected = 0; - } - } - break; - } - } - } - else if (!multi_sel) - { - /* desel others */ - for (l = ic->sd->icons; l; l = l->next) - { - ic2 = l->data; - if (ic2 != ic) - { - if (ic2->selected) _e_fm2_icon_deselect(ic2); - } - } - } - else - { - for (l = ic->sd->icons; l; l = l->next) - { - ic2 = l->data; - ic2->last_selected = 0; - } - } - if ((multi_sel) && (ic->selected)) - _e_fm2_icon_deselect(ic); - else - _e_fm2_icon_select(ic); - evas_object_smart_callback_call(ic->sd->obj, "selection_change", NULL); - if ((!(S_ISDIR(ic->info.statinfo.st_mode)) || - (ic->sd->config->view.no_subdir_jump)) && - (ic->sd->config->view.single_click) - ) - { - evas_object_smart_callback_call(ic->sd->obj, "selected", NULL); - } - } - else if (ev->button == 3) - { - _e_fm2_icon_menu(ic, ic->sd->obj, ev->timestamp); - evas_event_feed_mouse_up(evas_object_evas_get(ic->sd->obj), ev->button, - EVAS_BUTTON_NONE, ev->timestamp, NULL); - } -} - -static void -_e_fm2_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Up *ev; - E_Fm2_Icon *ic; - - ic = data; - ev = event_info; -} - -static void -_e_fm2_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) -{ - Evas_Event_Mouse_Move *ev; - E_Fm2_Icon *ic; - - ic = data; - ev = event_info; -} - -static void -_e_fm2_cb_icon_thumb_gen(void *data, Evas_Object *obj, void *event_info) -{ - E_Fm2_Icon *ic; - - ic = data; - if (ic->realized) - { - Evas_Coord w = 0, h = 0; - int have_alpha; - - e_icon_size_get(ic->obj_icon, &w, &h); - have_alpha = e_icon_alpha_get(ic->obj_icon); - if (ic->sd->config->view.mode == E_FM2_VIEW_MODE_LIST) - { - edje_extern_object_aspect_set(ic->obj_icon, - EDJE_ASPECT_CONTROL_BOTH, w, h); - } - edje_object_part_swallow(ic->obj, "e.swallow.icon", ic->obj_icon); - if (have_alpha) - edje_object_signal_emit(ic->obj, "e,action,thumb,gen,alpha", "e"); - else - edje_object_signal_emit(ic->obj, "e,action,thumb,gen", "e"); - } -} - -/* FIXME: prototype */ static void _e_fm2_icon_make_visible(E_Fm2_Icon *ic) { @@ -2135,7 +2009,6 @@ evas_object_smart_callback_call(ic->sd->obj, "pan_changed", NULL); } -/* FIXME: prototype */ static void _e_fm2_icon_desel_any(Evas_Object *obj) { @@ -2152,7 +2025,6 @@ } } -/* FIXME: prototype */ static E_Fm2_Icon * _e_fm2_icon_first_selected_find(Evas_Object *obj) { @@ -2170,7 +2042,6 @@ return NULL; } -/* FIXME: prototype */ static void _e_fm2_icon_sel_first(Evas_Object *obj) { @@ -2187,7 +2058,6 @@ _e_fm2_icon_make_visible(ic); } -/* FIXME: prototype */ static void _e_fm2_icon_sel_last(Evas_Object *obj) { @@ -2204,7 +2074,6 @@ _e_fm2_icon_make_visible(ic); } -/* FIXME: prototype */ static void _e_fm2_icon_sel_prev(Evas_Object *obj) { @@ -2237,7 +2106,6 @@ _e_fm2_icon_make_visible(ic); } -/* FIXME: prototype */ static void _e_fm2_icon_sel_next(Evas_Object *obj) { @@ -2285,7 +2153,6 @@ sd->typebuf_visible = 1; } -/* FIXME: prototype */ static void _e_fm2_typebuf_hide(Evas_Object *obj) { @@ -2298,7 +2165,6 @@ sd->typebuf_visible = 0; } -/* FIXME: prototype */ static void _e_fm2_typebuf_history_prev(Evas_Object *obj) { @@ -2309,7 +2175,6 @@ /* FIXME: do */ } -/* FIXME: prototype */ static void _e_fm2_typebuf_history_next(Evas_Object *obj) { @@ -2320,7 +2185,6 @@ /* FIXME: do */ } -/* FIXME: prototype */ static void _e_fm2_typebuf_run(Evas_Object *obj) { @@ -2356,7 +2220,6 @@ } } -/* FIXME: prototype */ static void _e_fm2_typebuf_match(Evas_Object *obj) { @@ -2393,7 +2256,6 @@ free(tb); } -/* FIXME: prototype */ static void _e_fm2_typebuf_complete(Evas_Object *obj) { @@ -2405,7 +2267,6 @@ _e_fm2_typebuf_match(obj); } -/* FIXME: prototype */ static void _e_fm2_typebuf_char_append(Evas_Object *obj, char *ch) { @@ -2425,7 +2286,6 @@ edje_object_part_text_set(sd->overlay, "e.text.typebuf_label", sd->typebuf.buf); } -/* FIXME: prototype */ static void _e_fm2_typebuf_char_backspace(Evas_Object *obj) { @@ -2452,6 +2312,378 @@ edje_object_part_text_set(sd->overlay, "e.text.typebuf_label", sd->typebuf.buf); } +/**************************/ + +static void +_e_fm2_cb_dnd_enter(void *data, const char *type, void *event) +{ + E_Fm2_Smart_Data *sd; + E_Event_Dnd_Enter *ev; + + sd = data; + if (!type) return; + if (strcmp(type, "text/uri-list")) return; + ev = (E_Event_Dnd_Enter *)event; + printf("DND IN %i %i\n", ev->x, ev->y); +} + +static void +_e_fm2_cb_dnd_move(void *data, const char *type, void *event) +{ + E_Fm2_Smart_Data *sd; + E_Event_Dnd_Move *ev; + + sd = data; + if (!type) return; + if (strcmp(type, "text/uri-list")) return; + ev = (E_Event_Dnd_Move *)event; + printf("DND MOVE %i %i\n", ev->x, ev->y); +} + +static void +_e_fm2_cb_dnd_leave(void *data, const char *type, void *event) +{ + E_Fm2_Smart_Data *sd; + E_Event_Dnd_Leave *ev; + + sd = data; + if (!type) return; + if (strcmp(type, "text/uri-list")) return; + ev = (E_Event_Dnd_Leave *)event; + printf("DND LEAVE %i %i\n", ev->x, ev->y); +} + +static void +_e_fm2_cb_dnd_drop(void *data, const char *type, void *event) +{ + E_Fm2_Smart_Data *sd; + E_Event_Dnd_Drop *ev; + + sd = data; + if (!type) return; + if (strcmp(type, "text/uri-list")) return; + ev = (E_Event_Dnd_Drop *)event; + printf("DROP: %i %i %s\n", ev->x, ev->y, ev->data); +} + +static void +_e_fm2_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev; + E_Fm2_Icon *ic, *ic2; + int multi_sel = 0, range_sel = 0, seen = 0; + Evas_List *l; + + ic = data; + ev = event_info; + if ((ev->button == 1) && (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)) + { + /* if its a directory && open dirs in-place is set then change the dir + * to be the dir + file */ + if ((S_ISDIR(ic->info.statinfo.st_mode)) && + (ic->sd->config->view.open_dirs_in_place) && + (!ic->sd->config->view.no_subdir_jump) && + (!ic->sd->config->view.single_click) + ) + { + char buf[4096], *dev = NULL; + + if (ic->sd->dev) dev = strdup(ic->sd->dev); + if (ic->info.pseudo_link) + snprintf(buf, sizeof(buf), "%s/%s", ic->info.pseudo_dir, ic->info.file); + else + snprintf(buf, sizeof(buf), "%s/%s", ic->sd->path, ic->info.file); + e_fm2_path_set(ic->sd->obj, dev, buf); + E_FREE(dev); + } + else + { + evas_object_smart_callback_call(ic->sd->obj, "selected", NULL); + } + /* if its in file selector mode then signal that a selection has + * taken place and dont do anything more */ + + /* do the below per selected file */ + /* if its a directory and open dirs in-place is not set, then + * signal owner that a new dir should be opened */ + /* if its a normal file - do what the mime type says to do with + * that file type */ + } + else if (ev->button == 1) + { + if ((ic->sd->eobj)) + { + ic->drag.x = ev->output.x; + ic->drag.y = ev->output.y; + ic->drag.start = 1; + ic->drag.dnd = 0; + } + if (ic->sd->config->selection.windows_modifiers) + { + if (evas_key_modifier_is_set(ev->modifiers, "Shift")) + range_sel = 1; + else if (evas_key_modifier_is_set(ev->modifiers, "Control")) + multi_sel = 1; + } + else + { + if (evas_key_modifier_is_set(ev->modifiers, "Control")) + range_sel = 1; + else if (evas_key_modifier_is_set(ev->modifiers, "Shift")) + multi_sel = 1; + } + if (ic->sd->config->selection.single) + { + multi_sel = 0; + range_sel = 0; + } + if (range_sel) + { + /* find last selected - if any, and select all icons between */ + for (l = ic->sd->icons; l; l = l->next) + { + ic2 = l->data; + if (ic2 == ic) seen = 1; + if (ic2->last_selected) + { + ic2->last_selected = 0; + if (seen) + { + for (; (l) && (l->data != ic); l = l->prev) + { + ic2 = l->data; + _e_fm2_icon_select(ic2); + ic2->last_selected = 0; + } + } + else + { + for (; (l) && (l->data != ic); l = l->next) + { + ic2 = l->data; + _e_fm2_icon_select(ic2); + ic2->last_selected = 0; + } + } + break; + } + } + } + else if (!multi_sel) + { + /* desel others */ + for (l = ic->sd->icons; l; l = l->next) + { + ic2 = l->data; + if (ic2 != ic) + { + if (ic2->selected) _e_fm2_icon_deselect(ic2); + } + } + } + else + { + for (l = ic->sd->icons; l; l = l->next) + { + ic2 = l->data; + ic2->last_selected = 0; + } + } + if ((multi_sel) && (ic->selected)) + _e_fm2_icon_deselect(ic); + else + _e_fm2_icon_select(ic); + evas_object_smart_callback_call(ic->sd->obj, "selection_change", NULL); + if ((!(S_ISDIR(ic->info.statinfo.st_mode)) || + (ic->sd->config->view.no_subdir_jump)) && + (ic->sd->config->view.single_click) + ) + { + evas_object_smart_callback_call(ic->sd->obj, "selected", NULL); + } + } + else if (ev->button == 3) + { + _e_fm2_icon_menu(ic, ic->sd->obj, ev->timestamp); + e_util_evas_fake_mouse_up_later(evas_object_evas_get(ic->sd->obj), + ev->button); +// evas_event_feed_mouse_up(evas_object_evas_get(ic->sd->obj), ev->button, +// EVAS_BUTTON_NONE, ev->timestamp, NULL); + } +} + +static void +_e_fm2_cb_icon_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ev; + E_Fm2_Icon *ic; + + ic = data; + ev = event_info; + if ((ev->button == 1) && (!ic->drag.dnd)) + { + ic->drag.start = 0; + ic->drag.dnd = 0; + } +} + +static void +_e_fm2_cb_drag_finished(E_Drag *drag, int dropped) +{ + free(drag->data); +} + +static void +_e_fm2_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Move *ev; + E_Fm2_Icon *ic; + + ic = data; + ev = event_info; + if ((ic->drag.start) && (ic->sd->eobj)) + { + int dx, dy; + + dx = ev->cur.output.x - ic->drag.x; + dy = ev->cur.output.y - ic->drag.y; + if (((dx * dx) + (dy * dy)) > + (e_config->drag_resist * e_config->drag_resist)) + { + E_Drag *d; + Evas_Object *o, *o2; + Evas_Coord x, y, w, h; + const char *drag_types[] = { "text/uri-list" }, *realpath; + char buf[4096]; + E_Container *con = NULL; + + switch (ic->sd->eobj->type) + { + case E_GADCON_TYPE: + con = ((E_Gadcon *)(ic->sd->eobj))->zone->container; + break; + case E_WIN_TYPE: + con = ((E_Win *)(ic->sd->eobj))->container; + break; + case E_BORDER_TYPE: + con = ((E_Border *)(ic->sd->eobj))->zone->container; + break; + case E_POPUP_TYPE: + con = ((E_Popup *)(ic->sd->eobj))->zone->container; + break; + /* FIXME: add mroe types as needed */ + default: + break; + } + if (!con) return; + ic->drag.dnd = 1; + ic->drag.start = 0; + evas_object_geometry_get(ic->obj, &x, &y, &w, &h); + realpath = e_fm2_real_path_get(ic->sd->obj); + if (!strcmp(realpath, "/")) + snprintf(buf, sizeof(buf), "/%s", ic->info.file); + else + snprintf(buf, sizeof(buf), "%s/%s", realpath, ic->info.file); + + d = e_drag_new(con, + x, y, drag_types, 1, + strdup(buf), -1, _e_fm2_cb_drag_finished); + o = edje_object_add(e_drag_evas_get(d)); + if (ic->sd->config->view.mode == E_FM2_VIEW_MODE_LIST) + { + if (ic->sd->config->icon.fixed.w) + { + if (ic->odd) + e_theme_edje_object_set(o, "base/theme/widgets", + "e/fileman/list_odd/fixed"); + else + e_theme_edje_object_set(o, "base/theme/widgets", + "e/fileman/list/fixed"); + } + else + { + if (ic->odd) + e_theme_edje_object_set(o, "base/theme/widgets", + "e/fileman/list_odd/variable"); + else + e_theme_edje_object_set(o, "base/theme/widgets", + "e/fileman/list/variable"); + } + } + else + { + if (ic->sd->config->icon.fixed.w) + e_theme_edje_object_set(o, "base/theme/fileman", + "e/fileman/icon/fixed"); + else + e_theme_edje_object_set(o, "base/theme/fileman", + "e/fileman/icon/variable"); + } + _e_fm2_icon_label_set(ic, o); + o2 = _e_fm2_icon_icon_direct_set(ic, o, + _e_fm2_cb_icon_thumb_dnd_gen, o); + edje_object_signal_emit(o, "e,state,selected", "e"); + edje_object_signal_emit(o2, "e,state,selected", "e"); + e_drag_object_set(d, o); + e_drag_resize(d, w, h); + e_drag_start(d, ic->drag.x, ic->drag.y); + e_util_evas_fake_mouse_up_later(evas_object_evas_get(ic->sd->obj), + 1); +// evas_event_feed_mouse_up(evas_object_evas_get(ic->sd->obj), +// 1, EVAS_BUTTON_NONE, +// ecore_x_current_time_get(), NULL); + } + } +} + +static void +_e_fm2_cb_icon_thumb_dnd_gen(void *data, Evas_Object *obj, void *event_info) +{ + Evas_Object *o; + Evas_Coord w = 0, h = 0; + int have_alpha; + + o = data; + e_icon_size_get(obj, &w, &h); + have_alpha = e_icon_alpha_get(obj); +// if (ic->sd->config->view.mode == E_FM2_VIEW_MODE_LIST) + { + edje_extern_object_aspect_set(obj, + EDJE_ASPECT_CONTROL_BOTH, w, h); + } + edje_object_part_swallow(o, "e.swallow.icon", obj); + if (have_alpha) + edje_object_signal_emit(o, "e,action,thumb,gen,alpha", "e"); + else + edje_object_signal_emit(o, "e,action,thumb,gen", "e"); +} + +static void +_e_fm2_cb_icon_thumb_gen(void *data, Evas_Object *obj, void *event_info) +{ + E_Fm2_Icon *ic; + + ic = data; + if (ic->realized) + { + Evas_Coord w = 0, h = 0; + int have_alpha; + + e_icon_size_get(obj, &w, &h); + have_alpha = e_icon_alpha_get(obj); + if (ic->sd->config->view.mode == E_FM2_VIEW_MODE_LIST) + { + edje_extern_object_aspect_set(obj, + EDJE_ASPECT_CONTROL_BOTH, w, h); + } + edje_object_part_swallow(ic->obj, "e.swallow.icon", obj); + if (have_alpha) + edje_object_signal_emit(ic->obj, "e,action,thumb,gen,alpha", "e"); + else + edje_object_signal_emit(ic->obj, "e,action,thumb,gen", "e"); + } +} + static void _e_fm2_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { @@ -2626,8 +2858,10 @@ if (ev->button == 3) { _e_fm2_menu(sd->obj, ev->timestamp); - evas_event_feed_mouse_up(evas_object_evas_get(sd->obj), ev->button, - EVAS_BUTTON_NONE, ev->timestamp, NULL); + e_util_evas_fake_mouse_up_later(evas_object_evas_get(sd->obj), + ev->button); +// evas_event_feed_mouse_up(evas_object_evas_get(sd->obj), ev->button, +// EVAS_BUTTON_NONE, ev->timestamp, NULL); } } @@ -2728,10 +2962,10 @@ ic1 = data1; ic2 = data2; - l1 = ic1->info.file; - if (ic1->info.label) l1 = ic1->info.label; - l2 = ic2->info.file; - if (ic2->info.label) l2 = ic2->info.label; + l1 = (char *)ic1->info.file; + if (ic1->info.label) l1 = (char *)ic1->info.label; + l2 = (char *)ic2->info.file; + if (ic2->info.label) l2 = (char *)ic2->info.label; if (ic1->sd->config->list.sort.dirs.first) { if ((S_ISDIR(ic1->info.statinfo.st_mode)) != @@ -2974,10 +3208,11 @@ if (sd->config) _e_fm2_config_free(sd->config); E_FREE(sd->typebuf.buf); - + evas_object_del(sd->underlay); evas_object_del(sd->overlay); evas_object_del(sd->clip); + if (sd->drop_handler) e_drop_handler_del(sd->drop_handler); free(sd); } @@ -2995,6 +3230,8 @@ evas_object_move(sd->overlay, sd->x, sd->y); evas_object_move(sd->clip, sd->x - OVERCLIP, sd->y - OVERCLIP); _e_fm2_obj_icons_place(sd); + if (sd->drop_handler) + e_drop_handler_geometry_set(sd->drop_handler, sd->x, sd->y, sd->w, sd->h); } static void @@ -3025,6 +3262,8 @@ if (sd->scroll_job) ecore_job_del(sd->scroll_job); sd->scroll_job = ecore_job_add(_e_fm2_cb_scroll_job, obj); } + if (sd->drop_handler) + e_drop_handler_geometry_set(sd->drop_handler, sd->x, sd->y, sd->w, sd->h); } static void =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- e_fm.h 14 Sep 2006 16:07:57 -0000 1.20 +++ e_fm.h 18 Sep 2006 03:49:44 -0000 1.21 @@ -116,7 +116,8 @@ EAPI void e_fm2_file_show(Evas_Object *obj, const char *file); EAPI void e_fm2_icon_menu_start_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data); EAPI void e_fm2_icon_menu_end_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data); - +EAPI void e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj); + EAPI void e_fm2_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y); EAPI void e_fm2_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); EAPI void e_fm2_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_gadcon.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -3 -r1.45 -r1.46 --- e_gadcon.c 6 Sep 2006 21:40:16 -0000 1.45 +++ e_gadcon.c 18 Sep 2006 03:49:44 -0000 1.46 @@ -1200,8 +1200,10 @@ e_util_zone_current_get(e_manager_current_get()), cx + ev->output.x, cy + ev->output.y, 1, 1, E_MENU_POP_DIRECTION_DOWN, ev->timestamp); - evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button, - EVAS_BUTTON_NONE, ev->timestamp, NULL); + e_util_evas_fake_mouse_up_later(gcc->gadcon->evas, + ev->button); +// evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button, +// EVAS_BUTTON_NONE, ev->timestamp, NULL); } } @@ -1521,8 +1523,10 @@ e_util_zone_current_get(e_manager_current_get()), cx + ev->output.x, cy + ev->output.y, 1, 1, E_MENU_POP_DIRECTION_DOWN, ev->timestamp); - evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button, - EVAS_BUTTON_NONE, ev->timestamp, NULL); + e_util_evas_fake_mouse_up_later(gcc->gadcon->evas, + ev->button); +// evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button, +// EVAS_BUTTON_NONE, ev->timestamp, NULL); } } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_wallpaper_import.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- e_int_config_wallpaper_import.c 2 Sep 2006 05:15:01 -0000 1.22 +++ e_int_config_wallpaper_import.c 18 Sep 2006 03:49:44 -0000 1.23 @@ -140,6 +140,7 @@ _import_cb_sel_selected, import, _import_cb_sel_change, import, 1 ); + e_widget_fsel_window_object_set(ofm, win); import->fsel_obj = ofm; e_widget_list_object_append(o, ofm, 1, 1, 0.5); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- e_shelf.c 1 Sep 2006 03:37:43 -0000 1.39 +++ e_shelf.c 18 Sep 2006 03:49:44 -0000 1.40 @@ -923,8 +923,10 @@ e_util_zone_current_get(e_manager_current_get()), cx + ev->output.x, cy + ev->output.y, 1, 1, E_MENU_POP_DIRECTION_DOWN, ev->timestamp); - evas_event_feed_mouse_up(es->gadcon->evas, ev->button, - EVAS_BUTTON_NONE, ev->timestamp, NULL); + e_util_evas_fake_mouse_up_later(es->gadcon->evas, + ev->button); +// evas_event_feed_mouse_up(es->gadcon->evas, ev->button, +// EVAS_BUTTON_NONE, ev->timestamp, NULL); } } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- e_utils.c 23 Aug 2006 03:39:02 -0000 1.51 +++ e_utils.c 18 Sep 2006 03:49:44 -0000 1.52 @@ -22,7 +22,7 @@ struct _E_Util_Fake_Mouse_Up_Info { - E_Container *con; + Evas *evas; int button; }; @@ -37,19 +37,10 @@ EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button) { - E_Util_Fake_Mouse_Up_Info *info; - E_OBJECT_CHECK(con); E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE); - info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info)); - if (info) - { - info->con = con; - info->button = button; - e_object_ref(E_OBJECT(info->con)); - ecore_job_add(_e_util_container_fake_mouse_up_cb, info); - } + e_util_evas_fake_mouse_up_later(con->bg_evas, button); } EAPI void @@ -64,6 +55,20 @@ } EAPI void +e_util_evas_fake_mouse_up_later(Evas *e, int button) +{ + E_Util_Fake_Mouse_Up_Info *info; + + info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info)); + if (info) + { + info->evas = e; + info->button = button; + ecore_job_add(_e_util_container_fake_mouse_up_cb, info); + } +} + +EAPI void e_util_wakeup(void) { if (_e_util_dummy_timer) return; @@ -675,8 +680,8 @@ info = data; if (info) { - evas_event_feed_mouse_up(info->con->bg_evas, info->button, EVAS_BUTTON_NONE, ecore_x_current_time_get(), NULL); - e_object_unref(E_OBJECT(info->con)); + evas_event_feed_mouse_up(info->evas, info->button, EVAS_BUTTON_NONE, + ecore_x_current_time_get(), NULL); free(info); } } =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- e_utils.h 22 Jul 2006 21:48:24 -0000 1.26 +++ e_utils.h 18 Sep 2006 03:49:44 -0000 1.27 @@ -17,6 +17,7 @@ EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button); EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con); +EAPI void e_util_evas_fake_mouse_up_later(Evas *e, int button); EAPI void e_util_wakeup(void); EAPI void e_util_env_set(const char *var, const char *val); EAPI E_Zone *e_util_zone_current_get(E_Manager *man); =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -3 -r1.38 -r1.39 --- e_widget_fsel.c 16 Sep 2006 12:20:31 -0000 1.38 +++ e_widget_fsel.c 18 Sep 2006 03:49:44 -0000 1.39 @@ -542,6 +542,17 @@ return wd->path; } +EAPI void +e_widget_fsel_window_object_set(Evas_Object *obj, E_Object *eobj) +{ + E_Widget_Data *wd; + + if (!obj) return NULL; + wd = e_widget_data_get(obj); + e_fm2_window_object_set(wd->o_favorites_fm, eobj); + e_fm2_window_object_set(wd->o_files_fm, eobj); +} + static void _e_wid_fsel_preview_update(void *data, Evas_Object *obj, void *event_info) { =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- e_widget_fsel.h 17 Aug 2006 16:58:32 -0000 1.5 +++ e_widget_fsel.h 18 Sep 2006 03:49:45 -0000 1.6 @@ -9,8 +9,9 @@ EAPI Evas_Object *e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected, char *filter, void (*sel_func) (void *data, Evas_Object *obj), void *sel_data, void (*chg_func) (void *data, Evas_Object *obj), void *chg_data, int preview); -EAPI const char *e_widget_fsel_selection_path_get(Evas_Object *obj); EAPI void e_widget_fsel_path_get(Evas_Object *obj, const char **dev, const char **path); - +EAPI const char *e_widget_fsel_selection_path_get(Evas_Object *obj); +EAPI void e_widget_fsel_window_object_set(Evas_Object *obj, E_Object *eobj); + #endif #endif ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs