Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fm.c e_fm.h e_fwin.c 


Log Message:


working more on icon view for fm2

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -3 -r1.158 -r1.159
--- e_fm.c      5 May 2007 15:14:15 -0000       1.158
+++ e_fm.c      6 May 2007 06:41:59 -0000       1.159
@@ -2013,7 +2013,6 @@
        if (ic->h > rh) rh = ic->h;
        if ((ic->x + ic->w) > sd->max.w) sd->max.w = ic->x + ic->w;
        if ((ic->y + ic->h) > sd->max.h) sd->max.h = ic->y + ic->h;
-//     printf("BLAH %s - %i %i %ix%i\n", ic->info.file, ic->x, ic->y, ic->w, 
ic->h);
      }
 }
 
@@ -2023,7 +2022,8 @@
    Evas_List *l;
    E_Fm2_Icon *ic;
    Evas_Coord x, y, gw, gh;
-
+   int cols = 1, col;
+   
    gw = 0; gh = 0;
    for (l = sd->icons; l; l = l->next)
      {
@@ -2031,18 +2031,22 @@
        if (ic->w > gw) gw = ic->w;
        if (ic->h > gh) gh = ic->h;
      }
-   x = 0; y = 0;
+   if (gw > 0) cols = sd->w / gw;
+   if (cols < 1) cols = 1;
+   x = 0; y = 0; col = 0;
    for (l = sd->icons; l; l = l->next)
      {
        ic = l->data;
-       if ((x > 0) && ((x + ic->w) > sd->w))
+       ic->x = x + ((gw - ic->w) / 2);
+       ic->y = y + (gh - ic->h);
+       x += gw;
+       col++;
+       if (col >= cols)
          {
+            col = 0;
             x = 0;
             y += gh;
          }
-       ic->x = x + (gw - ic->w);
-       ic->y = y + (gh - ic->h);
-       x += gw;
        if ((ic->x + ic->w) > sd->max.w) sd->max.w = ic->x + ic->w;
        if ((ic->y + ic->h) > sd->max.h) sd->max.h = ic->y + ic->h;
      }
@@ -2061,6 +2065,8 @@
        if (!ic->saved_pos)
          {
             /* FIXME: place using smart place fn */
+            ic->x = rand() % 200;
+            ic->y = rand() % 200;
          }
        
        if ((ic->x + ic->w) > sd->max.w) sd->max.w = ic->x + ic->w;
@@ -2071,6 +2077,7 @@
 static void
 _e_fm2_icons_place_custom_grid_icons(E_Fm2_Smart_Data *sd)
 {
+   /* FIXME: not going to implement this at this stage */
    Evas_List *l;
    E_Fm2_Icon *ic;
 
@@ -2091,6 +2098,7 @@
 static void
 _e_fm2_icons_place_custom_smart_grid_icons(E_Fm2_Smart_Data *sd)
 {
+   /* FIXME: not going to implement this at this stage */
    Evas_List *l;
    E_Fm2_Icon *ic;
 
@@ -2161,9 +2169,11 @@
        _e_fm2_icons_place_custom_icons(sd);
        break;
       case E_FM2_VIEW_MODE_CUSTOM_GRID_ICONS:
+       /* FIXME: not going to implement this at this stage */
        _e_fm2_icons_place_custom_grid_icons(sd);
        break;
       case E_FM2_VIEW_MODE_CUSTOM_SMART_GRID_ICONS:
+       /* FIXME: not going to implement this at this stage */
        _e_fm2_icons_place_custom_smart_grid_icons(sd);
        break;
       case E_FM2_VIEW_MODE_LIST:
@@ -3507,6 +3517,12 @@
                      sd->realpath, ecore_file_get_file(fp));
             printf("mv %s %s\n", (char *)fp, buf);
             _e_fm2_client_file_move(sd->id, fp, buf, "", 0, ev->x, ev->y);
+            if (sd->config->view.mode == E_FM2_VIEW_MODE_CUSTOM_ICONS)
+              {
+                 /* dnd doesnt tell me all the co-ords of the icons being 
dragged so i can't place them accurately.
+                  * need to fix this. ev->data probably needs to become more 
compelx than a list of url's
+                  */
+              }
             evas_stringshare_del(fp);
          }
      }
@@ -4156,7 +4172,48 @@
    
    sd = data;
    ev = event_info;
-   if (ev->button == 3)
+   if (ev->button == 1)
+     {
+       Evas_List *l;
+       int multi_sel = 0, range_sel = 0, seen = 0, sel_change = 0;
+       
+       if (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 (sd->config->selection.single)
+         {
+            multi_sel = 0;
+            range_sel = 0;
+         }
+       if ((!multi_sel) && (!range_sel))
+         {
+            for (l = sd->icons; l; l = l->next)
+              {
+                 E_Fm2_Icon *ic;
+                 
+                 ic = l->data;
+                 if (ic->selected)
+                   {
+                      _e_fm2_icon_deselect(ic);
+                      sel_change = 1;
+                   }
+              }
+         }
+       if (sel_change)
+         evas_object_smart_callback_call(sd->obj, "selection_change", NULL);
+     }
+   else if (ev->button == 3)
      {
        _e_fm2_menu(sd->obj, ev->timestamp);
        e_util_evas_fake_mouse_up_later(evas_object_evas_get(sd->obj),
@@ -4227,15 +4284,20 @@
        break;
       case E_FM2_VIEW_MODE_CUSTOM_ICONS:
        _e_fm2_regions_eval(sd->obj);
-       _e_fm2_obj_icons_place(sd);
+       _e_fm2_icons_place(sd->obj);
+       _e_fm2_regions_populate(sd->obj);
        break;
       case E_FM2_VIEW_MODE_CUSTOM_GRID_ICONS:
+       /* FIXME: not going to implement this at this stage */
        _e_fm2_regions_eval(sd->obj);
-       _e_fm2_obj_icons_place(sd);
+       _e_fm2_icons_place(sd->obj);
+       _e_fm2_regions_populate(sd->obj);
        break;
       case E_FM2_VIEW_MODE_CUSTOM_SMART_GRID_ICONS:
+       /* FIXME: not going to implement this at this stage */
        _e_fm2_regions_eval(sd->obj);
-       _e_fm2_obj_icons_place(sd);
+       _e_fm2_icons_place(sd->obj);
+       _e_fm2_regions_populate(sd->obj);
        break;
       case E_FM2_VIEW_MODE_LIST:
        if (sd->iconlist_changed)
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fm.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- e_fm.h      4 May 2007 05:43:13 -0000       1.42
+++ e_fm.h      6 May 2007 06:41:59 -0000       1.43
@@ -10,8 +10,12 @@
    E_FM2_VIEW_MODE_ICONS, /* regular layout row by row like text */
    E_FM2_VIEW_MODE_GRID_ICONS, /* regular grid layout */
    E_FM2_VIEW_MODE_CUSTOM_ICONS, /* icons go anywhere u drop them (desktop) */
+     
+     /* FIXME: not going to implement this at this stage */
    E_FM2_VIEW_MODE_CUSTOM_GRID_ICONS, /* icons go anywhere u drop them but 
align to a grid */
+     /* FIXME: not going to implement this at this stage */
    E_FM2_VIEW_MODE_CUSTOM_SMART_GRID_ICONS, /* icons go anywhere u drop them 
but try align to icons nearby */
+     /* FIXME: not going to implement this at this stage */
    E_FM2_VIEW_MODE_LIST /* vertical fileselector list */
 } E_Fm2_View_Mode;
 
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fwin.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- e_fwin.c    5 May 2007 15:14:15 -0000       1.40
+++ e_fwin.c    6 May 2007 06:41:59 -0000       1.41
@@ -7,6 +7,11 @@
  * primitive BUT enough to test generic dnd and fm stuff more easily. don't
  * play with this unless u want to help with it. NOT COMPLETE! BEWARE!
  */
+/* FIXME: multiple selected files across different fwins - you can only dnd the
+ * ones in the 1 window src - not all selected ones. also selecting a new file
+ * in a new fwin doesnt deseclect other selections in other fwin's (unless
+ * multi-selecting)
+ */
 
 typedef enum
 {
@@ -112,14 +117,14 @@
    o = e_fm2_add(e_win_evas_get(fwin->win));
    fwin->fm_obj = o;
    memset(&fmc, 0, sizeof(E_Fm2_Config));
-#if 1   
+#if 1
    fmc.view.mode = E_FM2_VIEW_MODE_LIST;
    fmc.icon.list.w = 24;
    fmc.icon.list.h = 24;
    fmc.icon.fixed.w = 1;
    fmc.icon.fixed.h = 1;
 #else   
-   fmc.view.mode = E_FM2_VIEW_MODE_ICONS;
+   fmc.view.mode = E_FM2_VIEW_MODE_CUSTOM_ICONS;
    fmc.icon.icon.w = 48;
    fmc.icon.icon.h = 48;
    fmc.icon.fixed.w = 0;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to