Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_fileman.c e_fileman.h e_fileman_smart.c e_ipc_handlers.h 
        e_ipc_handlers_list.h 


Log Message:
- add more signals to icons / bg (need to properly rename them to make more 
sense)
- add dynamic glob matches to typebuffer (can get slow with 10,000 files, as 
expected, should be faster when we optimize e_icon_layout)
- add ability to start efm from e_remote (thanks ngc)
- add some edje effects.
- add a test idea for dynamic selection: when you bring up the typebuffer,
everything goes into "dark mode", and your searches light up dynamically as
they are found while you type.

- question: should A be equal to *A* in the typebuffer? ngc and rephorm
suggested this could be an option and if we do add a * manually then this
case will be invalidated.

- note: when browsing 10,000+ files, the slowness of the dir loading occurs
due to the fact that ecore_file's monitor will loop thru all the files and do
an insertion sort. raster said we can fix this with some work on the monitor
code.


===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- e_fileman.c 6 Nov 2005 14:40:58 -0000       1.25
+++ e_fileman.c 9 Nov 2005 02:00:33 -0000       1.26
@@ -28,10 +28,20 @@
 static void _e_fileman_scroll_child_size_get(Evas_Object *obj, Evas_Coord *x, 
Evas_Coord *y);
 static int  _e_fileman_reconfigure_cb(void *data, int type, void *event);
 
-  
 E_Fileman *
 e_fileman_new(E_Container *con)
 {
+   char dir[PATH_MAX];
+   
+   if (!getcwd(dir, sizeof(dir)))
+     return NULL;
+   
+   return e_fileman_new_to_dir(con, dir);
+}
+
+E_Fileman *
+e_fileman_new_to_dir(E_Container *con, char *path)
+{
    E_Fileman *fileman;
    E_Manager *man;
    char dir[PATH_MAX];
@@ -44,8 +54,12 @@
        if (!con) con = e_container_number_get(man, 0);
        if (!con) return NULL;
      }
-   if (!getcwd(dir, sizeof(dir)))
-     return NULL;
+
+   snprintf(dir, PATH_MAX, "%s", path);
+   
+   if(!ecore_file_is_dir(dir))
+     if (!getcwd(dir, sizeof(dir)))
+       return NULL;
 
    fileman = E_OBJECT_ALLOC(E_Fileman, E_FILEMAN_TYPE, _e_fileman_free);
    if (!fileman) return NULL;
@@ -72,8 +86,9 @@
    e_win_title_set(fileman->win, dir);
 
    evas_event_freeze(fileman->evas);   
-   fileman->smart = e_fm_add(fileman->evas); 
+   fileman->smart = e_fm_add(fileman->evas);
    e_fm_e_win_set(fileman->smart, fileman->win);
+   e_fm_dir_set(fileman->smart, dir);   
    
    fileman->main = e_scrollframe_add(fileman->evas);
    e_scrollframe_custom_theme_set(fileman->main, "base/themes/fileman",
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_fileman.h 26 Oct 2005 00:19:51 -0000      1.5
+++ e_fileman.h 9 Nov 2005 02:00:33 -0000       1.6
@@ -38,6 +38,7 @@
 };
 
 EAPI E_Fileman *e_fileman_new(E_Container *con);
+EAPI E_Fileman *e_fileman_new_to_dir(E_Container *con, char *path);
 EAPI void       e_fileman_show(E_Fileman *fileman);
 EAPI void       e_fileman_hide(E_Fileman *fileman);
 EAPI void       e_fileman_selector_enable(E_Fileman *fileman, void 
(*func)(E_Fileman *fileman, char *file, void *data), void *data);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- e_fileman_smart.c   8 Nov 2005 22:59:01 -0000       1.103
+++ e_fileman_smart.c   9 Nov 2005 02:00:33 -0000       1.104
@@ -237,6 +237,7 @@
 
 static void                _e_fm_string_replace(const char *src, const char 
*key, const char *replacement, char *result, size_t resultsize);
 
+static void                _e_fm_autocomplete(E_Fm_Smart_Data *sd);
 static void                _e_fm_icon_select_glob(E_Fm_Smart_Data *sd, char 
*glb);
 static void                _e_fm_icon_select_up(E_Fm_Smart_Data *sd);
 static void                _e_fm_icon_select_down(E_Fm_Smart_Data *sd);
@@ -2154,7 +2155,7 @@
    ev = event_info;
    icon = data;
 
-   e_fm_icon_signal_emit(icon->icon_object, "hilight", "");
+   e_fm_icon_signal_emit(icon->icon_object, "mousein", "");
 }
 
 static void
@@ -2166,7 +2167,7 @@
    ev = event_info;
    icon = data;
 
-   e_fm_icon_signal_emit(icon->icon_object, "default", "");
+   e_fm_icon_signal_emit(icon->icon_object, "mouseout", "");
 }
 
 static void
@@ -2304,6 +2305,12 @@
 }
 
 static void
+_e_fm_autocomplete(E_Fm_Smart_Data *sd)
+{
+   /* TODO */
+}
+
+static void
 _e_fm_icon_select_glob(E_Fm_Smart_Data *sd, char *glb)
 {
    E_Fm_Icon *icon, *anchor;
@@ -2318,10 +2325,21 @@
    ev = NULL;
    glbpath = E_NEW(char, strlen(sd->dir) + strlen(glb) + 2);
    snprintf(glbpath, strlen(sd->dir) + strlen(glb) + 2, "%s/%s", sd->dir, glb);
-   if(glob(glbpath, 0, NULL, &globbuf))
-     return;
    
    _e_fm_selections_clear(sd);
+
+   edje_object_signal_emit(sd->edje_obj, "selecting", "");
+   
+   if(glob(glbpath, 0, NULL, &globbuf))
+     {
+       for (l = sd->files; l; l = l->next)
+         {
+            icon = l->data;
+            e_fm_icon_signal_emit(icon->icon_object, "disable", "");
+         }
+       return;
+     }
+   
    for (l = sd->files; l; l = l->next)
      {
        icon = l->data; 
@@ -2333,6 +2351,7 @@
             if(!strcmp(icon->file->name, file))
                {
                   _e_fm_selections_add(l->data, l);
+                  e_fm_icon_signal_emit(icon->icon_object, "default", "");
                   if(!anchor)
                     {
                        evas_object_geometry_get(icon->icon_object, &x, &y, &w, 
&h);
@@ -2727,16 +2746,32 @@
 {
    Evas_Event_Key_Down *ev;
    E_Fm_Smart_Data *sd;
+   Evas_List *l;
+   E_Fm_Icon *icon;
    
    ev = event_info;
    sd = data;   
 
+   if (!strcmp(ev->keyname, "Tab"))
+     {   
+       if(strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), 
"shown"))
+         {
+            
+            _e_fm_autocomplete(sd);
+         }
+     }
    if (!strcmp(ev->keyname, "Up"))
      {
        if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", 
NULL), "shown"))
-         {
+         {          
             edje_object_signal_emit(sd->edje_obj, "typebuf_hide", "");      
-            edje_object_part_text_set(sd->edje_obj, "text", "");            
+            edje_object_part_text_set(sd->edje_obj, "text", "");
+            for (l = sd->files; l; l = l->next)
+              {
+                 icon = l->data;
+                 e_fm_icon_signal_emit(icon->icon_object, "default", "");
+              }
+            edje_object_signal_emit(sd->edje_obj, "default", "");           
          }
        else          
          _e_fm_icon_select_up(sd);
@@ -2746,7 +2781,13 @@
        if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", 
NULL), "shown"))
          {
             edje_object_signal_emit(sd->edje_obj, "typebuf_hide", "");      
-            edje_object_part_text_set(sd->edje_obj, "text", "");            
+            edje_object_part_text_set(sd->edje_obj, "text", "");
+            for (l = sd->files; l; l = l->next)
+              {
+                 icon = l->data;
+                 e_fm_icon_signal_emit(icon->icon_object, "default", "");
+              }
+            edje_object_signal_emit(sd->edje_obj, "default", "");           
          }
        else     
          _e_fm_icon_select_down(sd);
@@ -2771,19 +2812,26 @@
          {
             edje_object_signal_emit(sd->edje_obj, "typebuf_hide", "");      
             edje_object_part_text_set(sd->edje_obj, "text", "");
+            for (l = sd->files; l; l = l->next)
+              {
+                 icon = l->data;
+                 e_fm_icon_signal_emit(icon->icon_object, "default", "");
+              }
+            edje_object_signal_emit(sd->edje_obj, "default", "");           
          }
      }
    else if (!strcmp(ev->keyname, "Return"))
      {
        if(!strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", 
NULL), "shown"))
          {
-            char *buf;
-            
             edje_object_signal_emit(sd->edje_obj, "typebuf_hide", "");
-            buf = strdup(edje_object_part_text_get(sd->edje_obj, "text"));
             edje_object_part_text_set(sd->edje_obj, "text", "");
-            if(strcmp(buf, ""))
-              _e_fm_icon_select_glob(sd, buf);
+            for (l = sd->files; l; l = l->next)
+              {
+                 icon = l->data;
+                 e_fm_icon_signal_emit(icon->icon_object, "default", "");
+              }
+            edje_object_signal_emit(sd->edje_obj, "default", "");           
          }
        else
          _e_fm_icon_run(sd);
@@ -2803,6 +2851,8 @@
                  buf = calloc(size , sizeof(char));
                  snprintf(buf, size, "%s", str);
                  edje_object_part_text_set(sd->edje_obj, "text", buf);
+                 _e_fm_icon_select_glob(sd, buf);
+                 E_FREE(buf);
               }             
          }
        else
@@ -2832,10 +2882,13 @@
             buf = calloc(size, sizeof(char));
             snprintf(buf, size, "%s%s", str, ev->string);
             edje_object_part_text_set(sd->edje_obj, "text", buf);
+            _e_fm_icon_select_glob(sd, buf);        
+            E_FREE(buf);
          }
        else
          {
             edje_object_part_text_set(sd->edje_obj, "text", ev->string);
+            _e_fm_icon_select_glob(sd, ev->string);         
          }
        
        if(strcmp(edje_object_part_state_get(sd->edje_obj, "typebuffer", NULL), 
"shown"))
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -3 -r1.105 -r1.106
--- e_ipc_handlers.h    4 Nov 2005 23:30:18 -0000       1.105
+++ e_ipc_handlers.h    9 Nov 2005 02:00:33 -0000       1.106
@@ -840,7 +840,21 @@
  * E_LIB_IN
  *   ...
  */
-   
+/****************************************************************************/
+#define HDL E_IPC_EFM_START
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-start-efm", 1, "Starts the E File Manager in Directory 'OPT1'", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+     REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+   STRING(s, HDL);
+   E_Fileman *fileman;
+   fileman = 
e_fileman_new_to_dir(e_container_current_get(e_manager_current_get()), s);
+   e_fileman_show (fileman);
+   END_STRING(s);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
 /****************************************************************************/
 #define HDL E_IPC_OP_MODULE_LOAD
 #if (TYPE == E_REMOTE_OPTIONS)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- e_ipc_handlers_list.h       4 Nov 2005 23:30:18 -0000       1.37
+++ e_ipc_handlers_list.h       9 Nov 2005 02:00:33 -0000       1.38
@@ -338,3 +338,5 @@
 #define E_IPC_OP_FULLSCREEN_POLICY_SET 320
 #define E_IPC_OP_FULLSCREEN_POLICY_GET 321
 #define E_IPC_OP_FULLSCREEN_POLICY_GET_REPLY 322
+
+#define E_IPC_EFM_START 323




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to