Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_fdo_menu_to_order.c e_fm.c Log Message: working on fm dnd... just logic right now - does nothing. sorting out the logic. and .e startup segv fix. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fdo_menu_to_order.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_fdo_menu_to_order.c 14 Sep 2006 12:47:08 -0000 1.10 +++ e_fdo_menu_to_order.c 18 Sep 2006 12:06:09 -0000 1.11 @@ -111,6 +111,7 @@ file = (char *)node->value; desktop = ecore_desktop_get(file, NULL); /* Check if we process */ + if (!desktop) return; if ( (!desktop->hidden) && (!desktop->no_display) && ((desktop->type == NULL) || (strcmp(desktop->type, "Application") == 0)) ) { char path2[PATH_MAX]; =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -3 -r1.68 -r1.69 --- e_fm.c 18 Sep 2006 10:02:36 -0000 1.68 +++ e_fm.c 18 Sep 2006 12:06:09 -0000 1.69 @@ -2333,6 +2333,26 @@ /**************************/ static void +_e_fm2_dnd_drop_into_show(E_Fm2_Icon *ic) +{ +} + +static void +_e_fm2_dnd_drop_into_hide(Evas_Object *obj) +{ +} + +static void +_e_fm2_dnd_drop_between_show(E_Fm2_Icon *ic, int after) +{ +} + +static void +_e_fm2_dnd_drop_between_hide(Evas_Object *obj) +{ +} + +static void _e_fm2_cb_dnd_enter(void *data, const char *type, void *event) { E_Fm2_Smart_Data *sd; @@ -2350,14 +2370,90 @@ { E_Fm2_Smart_Data *sd; E_Event_Dnd_Move *ev; + E_Fm2_Icon *ic; + Evas_List *l; 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); + for (l = sd->icons; l; l = l->next) + { + ic = l->data; + if (ic->drag.dnd) continue; + if (E_INSIDE(ev->x, ev->y, ic->x, ic->y, ic->w, ic->h)) + { + printf("OVER %s\n", ic->info.file); + /* if list view */ + if (ic->sd->config->view.mode == E_FM2_VIEW_MODE_LIST) + { + /* if there is a .order file - we can re-order files */ + if (ic->sd->order_file) + { + /* if dir: */ + if (S_ISDIR(ic->info.statinfo.st_mode)) + { + /* if bottom 25% or top 25% then insert between prev or next */ + /* if in middle 50% then put in dir */ + if (ev->y <= (ic->y + (ic->h / 4))) + { + _e_fm2_dnd_drop_into_hide(ic); + _e_fm2_dnd_drop_between_show(sd->obj, 0); + } + else if (ev->y > (ic->y + ((ic->h * 3) / 4))) + { + _e_fm2_dnd_drop_into_hide(ic); + _e_fm2_dnd_drop_between_show(sd->obj, 1); + } + else + { + _e_fm2_dnd_drop_between_hide(sd->obj); + _e_fm2_dnd_drop_into_show(ic); + } + } + else + { + /* if top 50% or bottom 50% then insert between prev or next */ + if (ev->y <= (ic->y + (ic->h / 2))) + { + _e_fm2_dnd_drop_into_hide(ic); + _e_fm2_dnd_drop_between_show(sd->obj, 0); + } + else + { + _e_fm2_dnd_drop_into_hide(ic); + _e_fm2_dnd_drop_between_show(sd->obj, 1); + } + } + } + /* we can only drop into subdirs */ + else + { + /* if it's over a dir - hilight as it will be dropped in */ + if (S_ISDIR(ic->info.statinfo.st_mode)) + { + _e_fm2_dnd_drop_between_hide(sd->obj); + _e_fm2_dnd_drop_into_show(ic); + } + else + { + _e_fm2_dnd_drop_between_hide(sd->obj); + _e_fm2_dnd_drop_into_hide(sd->obj); + } + } + } + else + { + /* FIXME: icon view mode */ + } + return; + } + } + _e_fm2_dnd_drop_between_hide(sd->obj); + _e_fm2_dnd_drop_into_hide(sd->obj); } - + static void _e_fm2_cb_dnd_leave(void *data, const char *type, void *event) { @@ -2369,6 +2465,8 @@ if (strcmp(type, "text/uri-list")) return; ev = (E_Event_Dnd_Leave *)event; printf("DND LEAVE %i %i\n", ev->x, ev->y); + _e_fm2_dnd_drop_between_hide(sd->obj); + _e_fm2_dnd_drop_into_hide(sd->obj); } static void @@ -2386,6 +2484,11 @@ selected = ev->data; printf("DROP: %i %i\n", ev->x, ev->y); for (i = 0, f = selected[i]; f; i++, f = selected[i]) printf(" %s\n", f); + /* FIXME: record the descision where to drop it in the dnd move callback + * then fix list, rewrite .order or move into dir (and if drag icon is + * from this dir, then refresh) */ + _e_fm2_dnd_drop_between_hide(sd->obj); + _e_fm2_dnd_drop_into_hide(sd->obj); } static void ------------------------------------------------------------------------- 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