Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/modules/fileman


Modified Files:
        e_fwin.c e_fwin.h e_mod_main.c 


Log Message:


patches, caching fixes, zone dynamic creation/deletion handling, stuff.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/fileman/e_fwin.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- e_fwin.c    11 Dec 2007 14:59:18 -0000      1.20
+++ e_fwin.c    14 Dec 2007 05:57:15 -0000      1.21
@@ -43,6 +43,7 @@
 
    E_Toolbar          *tbar;
    Ecore_Event_Handler *zone_handler;
+   Ecore_Event_Handler *zone_del_handler;
 };
 
 struct _E_Fwin_Apps_Dialog
@@ -99,6 +100,7 @@
 
 static void _e_fwin_zone_cb_mouse_down(void *data, Evas *evas, Evas_Object 
*obj, void *event_info);
 static int  _e_fwin_zone_move_resize(void *data, int type, void *event);
+static int  _e_fwin_zone_del(void *data, int type, void *event);
 static void _e_fwin_config_set(E_Fwin *fwin);
 static void _e_fwin_window_title_set(E_Fwin *fwin);
 static void _e_fwin_toolbar_resize(E_Fwin *fwin);
@@ -155,6 +157,10 @@
    fwin->zone_handler = ecore_event_handler_add(E_EVENT_ZONE_MOVE_RESIZE, 
                                                _e_fwin_zone_move_resize, 
                                                fwin);
+   fwin->zone_del_handler = ecore_event_handler_add(E_EVENT_ZONE_DEL, 
+                                                   _e_fwin_zone_del,
+                                                   fwin);
+   /* FIXME: catch del of zone and del fwin when zone goes */
    
    /* Trap the mouse_down on zone so we can unselect */
    evas_object_event_callback_add(zone->bg_event_object, 
@@ -283,6 +289,7 @@
                  E_Zone *zone;
 
                  zone = lll->data;
+                 if (e_fwin_zone_find(zone)) continue;
                  if ((zone->container->num == 0) && (zone->num == 0) && 
                      (fileman_config->view.show_desktop_icons))
                    e_fwin_zone_new(zone, "desktop", "/");
@@ -302,6 +309,21 @@
      }
 }
 
+EAPI int
+e_fwin_zone_find(E_Zone *zone)
+{
+   Evas_List *f;
+   
+   for (f = fwins; f; f = f->next)
+     {
+       E_Fwin *win;
+       
+       win = f->data;
+       if (win->zone == zone) return 1;
+     }
+   return 0;
+}
+
 /* local subsystem functions */
 static E_Fwin *
 _e_fwin_new(E_Container *con, const char *dev, const char *path) 
@@ -440,6 +462,8 @@
    
    if (fwin->zone_handler) 
      ecore_event_handler_del(fwin->zone_handler);
+   if (fwin->zone_del_handler) 
+     ecore_event_handler_del(fwin->zone_del_handler);
    
    fwins = evas_list_remove(fwins, fwin);
    if (fwin->wallpaper_file) evas_stringshare_del(fwin->wallpaper_file);
@@ -1489,6 +1513,7 @@
    fwin = data;
    ev = event;
    if (!fwin) return 1;
+   if (fwin->zone != ev->zone) return 1;
    if (fwin->bg_obj) 
      {
        evas_object_move(fwin->bg_obj, ev->zone->x, ev->zone->y);
@@ -1499,6 +1524,21 @@
        evas_object_move(fwin->scrollframe_obj, ev->zone->x, ev->zone->y);
        evas_object_resize(fwin->scrollframe_obj, ev->zone->w, ev->zone->h);
      }
+   return 1;
+}
+
+static int 
+_e_fwin_zone_del(void *data, int type, void *event) 
+{
+   E_Event_Zone_Del *ev;
+   E_Fwin *fwin;
+   
+   if (type != E_EVENT_ZONE_DEL) return 1;
+   fwin = data;
+   ev = event;
+   if (!fwin) return 1;
+   if (fwin->zone != ev->zone) return 1;
+   e_object_del(E_OBJECT(fwin));
    return 1;
 }
 
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/fileman/e_fwin.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_fwin.h    12 Aug 2007 23:04:38 -0000      1.2
+++ e_fwin.h    14 Dec 2007 05:57:15 -0000      1.3
@@ -14,6 +14,7 @@
 EAPI void e_fwin_zone_shutdown (E_Zone *zone);
 EAPI void e_fwin_all_unsel     (void *data);
 EAPI void e_fwin_reload_all    (void);
-
+EAPI int  e_fwin_zone_find     (E_Zone *zone);
+    
 #endif
 #endif
===================================================================
RCS file: /cvs/e/e17/apps/e/src/modules/fileman/e_mod_main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_mod_main.c        9 Nov 2007 23:33:23 -0000       1.11
+++ e_mod_main.c        14 Dec 2007 05:57:15 -0000      1.12
@@ -12,10 +12,12 @@
 static void  _e_mod_fileman_config_load(void);
 static void  _e_mod_fileman_config_free(void);
 static int   _e_mod_cb_config_timer(void *data);
+static int   _e_mod_zone_add(void *data, int type, void *event);
 
 static E_Module *conf_module = NULL;
 static E_Action *act = NULL;
 static E_Int_Menu_Augmentation *maug = NULL;
+static Ecore_Event_Handler *zone_add_handler = NULL;
 
 static E_Config_DD *conf_edd = NULL;
 Config *fileman_config = NULL;
@@ -69,6 +71,7 @@
             for (lll = con->zones; lll; lll = lll->next)
               {
                  zone = lll->data;
+                  if (e_fwin_zone_find(zone)) continue;
                  if ((zone->container->num == 0) && (zone->num == 0) && 
                      (fileman_config->view.show_desktop_icons))
                    e_fwin_zone_new(zone, "desktop", "/");
@@ -86,6 +89,10 @@
               }
          }
      }
+   zone_add_handler = ecore_event_handler_add(E_EVENT_ZONE_ADD,
+                                             _e_mod_zone_add, NULL);
+   
+   /* FIXME: add system event for new zone creation, and on creation, add an 
fwin to the zone */
    
    return m;
 }
@@ -98,6 +105,9 @@
    E_Container *con;
    E_Zone *zone;
 
+   ecore_event_handler_del(zone_add_handler);
+   zone_add_handler = NULL;
+   
    /* Unhook zone fm */
    for (l = e_manager_list(); l; l = l->next)
      {
@@ -332,4 +342,31 @@
 {
    e_util_dialog_show(_("Fileman Configuration Updated"), data);
    return 0;
+}
+
+static int
+_e_mod_zone_add(void *data, int type, void *event)
+{
+   E_Event_Zone_Add *ev;
+   E_Zone *zone;
+   
+   if (type != E_EVENT_ZONE_ADD) return 1;
+   ev = event;
+   zone = ev->zone;
+   if (e_fwin_zone_find(zone)) return 1;
+   if ((zone->container->num == 0) && (zone->num == 0) && 
+       (fileman_config->view.show_desktop_icons))
+     e_fwin_zone_new(zone, "desktop", "/");
+   else 
+     {
+       char buf[256];
+       
+       if (fileman_config->view.show_desktop_icons) 
+         {
+            snprintf(buf, sizeof(buf), "%i", 
+                     (zone->container->num + zone->num));
+            e_fwin_zone_new(zone, "desktop", buf);
+         }
+     }
+   return 1;
 }



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to