Enlightenment CVS committal

Author  : jlzapata
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fileman_smart.c e_icon_canvas.c e_icon_canvas.h 


Log Message:
efm work, dnd working, save/load working
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -3 -r1.123 -r1.124
--- e_fileman_smart.c   7 Feb 2006 14:30:21 -0000       1.123
+++ e_fileman_smart.c   8 Feb 2006 23:06:12 -0000       1.124
@@ -25,7 +25,7 @@
  * - is the offset code working properly? i have a feeling we're displayin
  *   more icons that the visible space can take and they are being hidden.
  *
- * - allow for icon movement inside the canvas
+ * + allow for icon movement inside the canvas
  *
  * - double check dir monitoring. note: when we are in a dir that is constantly
  *   changing, we cant keep calling redraw_new as it will kill us.
@@ -1419,6 +1419,14 @@
 
    if (!(dir2 = opendir(dir))) return;
 
+   /* save the old meta */
+   if(sd->meta)
+     {
+       _e_fm_dir_meta_save(sd);
+       _e_fm_dir_meta_free(sd->meta);
+       sd->meta = NULL;
+     }
+
    type = E_FM_FILE_TYPE_NORMAL;
    list = NULL;
    while((dp = readdir(dir2)))
@@ -1445,16 +1453,12 @@
    if (sd->dir) free (sd->dir);
    sd->dir = strdup(dir);
 
-   if(sd->meta)
-     {
-       _e_fm_dir_meta_free(sd->meta);
-       sd->meta = NULL;
-     }
-
+   
    _e_fm_dir_meta_load(sd);
 
    if(sd->meta)
      {
+       /* FIXME whats the purpose of this */
        Evas_List *l;
 
        for(l = sd->meta->files; l; l = l->next)
@@ -1501,6 +1505,7 @@
             icon->sd = sd;
             e_fm_icon_file_set(icon->icon_obj, icon->file);
             sd->files = evas_list_prepend(sd->files, icon);
+                           
             e_icon_canvas_pack(sd->layout, icon->icon_obj, e_fm_icon_create, 
e_fm_icon_destroy, icon);
             evas_object_event_callback_add(icon->icon_obj, 
EVAS_CALLBACK_MOUSE_DOWN, _e_fm_icon_mouse_down_cb, icon);
             evas_object_event_callback_add(icon->icon_obj, 
EVAS_CALLBACK_MOUSE_UP, _e_fm_icon_mouse_up_cb, icon);
@@ -1528,6 +1533,7 @@
 
    e_icon_canvas_freeze(sd->layout);
 
+   /* add two files per each timer call */
    while (i < 2)
      {
        char *f;
@@ -1604,8 +1610,6 @@
 
    if(!sd->files_raw) {
       sd->timer = NULL;
-      if(sd->meta)
-       _e_fm_dir_meta_save(sd);
 
       return 0;
    }
@@ -2439,11 +2443,11 @@
                  ecore_evas_geometry_get(sd->win->ecore_evas, &cx, &cy, NULL, 
NULL);
                  evas_object_geometry_get(icon->icon_obj, &x, &y, &w, &h);
                  
-                 sd->drag.dx = cx;
-                 sd->drag.dy = cy;
+                 sd->drag.dx = cx + 5;
+                 sd->drag.dy = cy + 5;
 
                  if(!sd->drag.ecore_evas)
-                   sd->drag.ecore_evas = ecore_evas_software_x11_new(NULL, 0, 
cx + x, cx + y, w, h);
+                   sd->drag.ecore_evas = ecore_evas_software_x11_new(NULL, 0, 
cx + x, cy + y, w, h);
                  
                  sd->drag.evas = ecore_evas_get(sd->drag.ecore_evas);
                  sd->drag.win = 
ecore_evas_software_x11_window_get(sd->drag.ecore_evas);
@@ -3210,6 +3214,7 @@
 
    ev = event;
    sd = data;
+
    if (ev->win != sd->win->evas_win) return 1;
    
    return 1;
@@ -3267,11 +3272,39 @@
 {
    Ecore_X_Event_Xdnd_Drop *ev;
    E_Fm_Smart_Data *sd;
+   int ax, ay, x, y;
 
    ev = event;
    sd = data;
+                 
    if (ev->win != sd->win->evas_win) return 1;
 
+   ecore_evas_geometry_get(sd->win->ecore_evas, &ax, &ay, NULL, NULL);
+
+   x = ev->position.x - ax - 5; /* 5 because we already shift 5 pixels 
creating the window */
+   y = ev->position.y - ay - 5;
+   e_icon_canvas_child_move(sd->drag.icon_obj->icon_obj,x,y); 
+   
+   
+   /* update the metadata for the new coords */
+   if(sd->meta)
+     {
+       Evas_List *l;
+       for(l = sd->meta->files; l; l = l->next)
+         {
+            E_Fm_Icon_Metadata *m;
+
+            m = l->data;
+            if(!strcmp(m->name, sd->drag.icon_obj->file->name))
+              {
+                 m->x = x;
+                 m->y = y;
+                 break;
+              }
+         }
+     }
+   
+
    ecore_x_selection_xdnd_request(sd->win->evas_win, "text/uri-list");
 
    return 1;
@@ -3414,11 +3447,6 @@
    char buf[PATH_MAX];
    char *hash;
 
-   /*******
-    * DISABLE FOR NOW
-    *******/
-   return 0;
-
    if (!sd->dir) return 0;
 
    hash = _e_fm_dir_meta_dir_id(sd->dir);
@@ -3436,6 +3464,7 @@
             E_Fm_Icon_Metadata *im;
 
             im = l->data;
+            printf("Loading meta: %d %d for file %s\n", im->x, im->y, 
im->name);
             m->files_hash = evas_hash_add(m->files_hash, im->name, im);
          }
      }
@@ -3507,7 +3536,7 @@
             E_Fm_Icon_Metadata *m;
 
             m = l->data;
-            //printf("Saving meta: %d %d\n", m->x, m->y);
+            printf("Saving meta: %d %d for file %s\n", m->x, m->y, m->name);
          }
      }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_icon_canvas.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_icon_canvas.c     7 Jan 2006 10:39:45 -0000       1.10
+++ e_icon_canvas.c     8 Feb 2006 23:06:12 -0000       1.11
@@ -285,6 +285,19 @@
    _e_icon_canvas_move_resize_item(li);
 }
 
+EAPI void         
+e_icon_canvas_child_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+   E_Icon_Canvas_Item *li;
+   
+   li = evas_object_data_get(obj, "e_icon_canvas_data");
+   if(x < 0) x = 0;
+   if(y < 0) y = 0;
+   li->x = x;
+   li->y = y;
+   _e_icon_canvas_move_resize_item(li);
+}
+
 EAPI void
 e_icon_canvas_unpack(Evas_Object *obj)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_icon_canvas.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_icon_canvas.h     29 Dec 2005 14:46:29 -0000      1.3
+++ e_icon_canvas.h     8 Feb 2006 23:06:12 -0000       1.4
@@ -16,6 +16,7 @@
 EAPI void         e_icon_canvas_pack               (Evas_Object *obj, 
Evas_Object *child, Evas_Object *(*create)(void *data), void 
(*destroy)(Evas_Object *obj, void *data), void *data);
 EAPI void         e_icon_canvas_pack_at_location   (Evas_Object *obj, 
Evas_Object *child, Evas_Object *(*create)(void *data), void 
(*destroy)(Evas_Object *obj, void *data), void *data, Evas_Coord x, Evas_Coord 
y);
 EAPI void         e_icon_canvas_child_resize       (Evas_Object *obj, 
Evas_Coord w, Evas_Coord h);
+EAPI void         e_icon_canvas_child_move         (Evas_Object *obj, 
Evas_Coord x, Evas_Coord y);
 EAPI void         e_icon_canvas_unpack             (Evas_Object *obj);
 EAPI void         e_icon_canvas_spacing_set        (Evas_Object *obj, 
Evas_Coord xs, Evas_Coord ys);
 EAPI void         e_icon_canvas_redraw_force       (Evas_Object *obj);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to