Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_border.c e_border.h e_fwin.c 


Log Message:


fwin windows have icon right now... :)

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.591
retrieving revision 1.592
diff -u -3 -r1.591 -r1.592
--- e_border.c  29 May 2007 11:25:53 -0000      1.591
+++ e_border.c  5 Jun 2007 13:58:04 -0000       1.592
@@ -2586,22 +2586,35 @@
          e_util_edje_icon_set(o, "enlightenment/e");
        else
          {
-            char *ext;
-
-            ext = strrchr(bd->internal_icon, '.');
-            if ((ext) && ((!strcmp(ext, ".edj"))))
+            if (!bd->internal_icon_key)
               {
-                 if (!edje_object_file_set(o, bd->internal_icon, "icon"))
-                   e_util_edje_icon_set(o, "enlightenment/e");        
+                 char *ext;
+                 
+                 ext = strrchr(bd->internal_icon, '.');
+                 if ((ext) && ((!strcmp(ext, ".edj"))))
+                   {
+                      if (!edje_object_file_set(o, bd->internal_icon, "icon"))
+                        e_util_edje_icon_set(o, "enlightenment/e");           
+                   }
+                 else if (ext)
+                   {
+                      evas_object_del(o);
+                      o = e_icon_add(evas);
+                      e_icon_file_set(o, bd->internal_icon);
+                   }
+                 else 
+                   {
+                      if (!e_util_edje_icon_set(o, bd->internal_icon))
+                        e_util_edje_icon_set(o, "enlightenment/e"); 
+                   }
               }
-            else 
+            else
               {
-                 if (!e_util_edje_icon_set(o, bd->internal_icon))
-                   e_util_edje_icon_set(o, "enlightenment/e"); 
+                 edje_object_file_set(o, bd->internal_icon,
+                                      bd->internal_icon_key);
               }
          }
-       if (o)
-          return o;
+       return o;
      }
    if (e_config->use_app_icon)
      {
@@ -2612,6 +2625,7 @@
                             bd->client.netwm.icons[0].width,
                             bd->client.netwm.icons[0].height);
             e_icon_alpha_set(o, 1);
+            return o;
          }
      }
    if (!o)
@@ -2619,6 +2633,7 @@
        if (bd->desktop)
          {
             o = e_util_desktop_icon_add(bd->desktop, "24x24", evas);
+            return o;
          }
        else if (bd->client.netwm.icons)
          {
@@ -2627,13 +2642,12 @@
                             bd->client.netwm.icons[0].width,
                             bd->client.netwm.icons[0].height);
             e_icon_alpha_set(o, 1);
+            return o;
          }
      }
-   if (!o)
-     {
-       o = edje_object_add(evas);
-       e_util_edje_icon_set(o, "enlightenment/unknown");
-     }
+   
+   o = edje_object_add(evas);
+   e_util_edje_icon_set(o, "enlightenment/unknown");
    return o;
 }
 
@@ -3159,6 +3173,7 @@
    if (bd->client.netwm.icon_name) free(bd->client.netwm.icon_name);
    e_object_del(E_OBJECT(bd->shape));
    if (bd->internal_icon) evas_stringshare_del(bd->internal_icon);
+   if (bd->internal_icon_key) evas_stringshare_del(bd->internal_icon_key);
    if (bd->icon_object) evas_object_del(bd->icon_object);
    evas_object_del(bd->bg_object);
    e_canvas_del(bd->bg_ecore_evas);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -3 -r1.158 -r1.159
--- e_border.h  11 Apr 2007 15:37:04 -0000      1.158
+++ e_border.h  5 Jun 2007 13:58:05 -0000       1.159
@@ -144,6 +144,7 @@
    Evas_Object    *icon_object;
    Ecore_X_Window  event_win;
    const char     *internal_icon;
+   const char     *internal_icon_key;
 
    struct {
       Ecore_X_Window shell_win;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_fwin.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- e_fwin.c    3 Jun 2007 04:50:54 -0000       1.49
+++ e_fwin.c    5 Jun 2007 13:58:05 -0000       1.50
@@ -208,6 +208,13 @@
    e_win_size_min_set(fwin->win, 24, 24);
    e_win_resize(fwin->win, 280, 200);
    e_win_show(fwin->win);
+   if (fwin->win->border)
+     {
+       if (fwin->win->border->internal_icon)
+         evas_stringshare_del(fwin->win->border->internal_icon);
+       fwin->win->border->internal_icon = 
+         evas_stringshare_add("enlightenment/fileman");
+     }
    
    return fwin;
 }
@@ -856,6 +863,7 @@
 static void
 _e_fwin_file_open_dialog(E_Fwin *fwin, Evas_List *files, int always)
 {
+   E_Fwin *fwin2 = NULL;
    E_Dialog *dia;
    Evas_Coord mw, mh;
    Evas_Object *o, *ocon, *of, *oi, *mt;
@@ -884,25 +892,25 @@
             if ((ici->link) && (ici->mount))
               {
                  if (fwin->win)
-                   e_fwin_new(fwin->win->container, ici->link, "/");
+                   fwin2 = e_fwin_new(fwin->win->container, ici->link, "/");
                  else if (fwin->zone)
-                   e_fwin_new(fwin->zone->container, ici->link, "/");
+                   fwin2 = e_fwin_new(fwin->zone->container, ici->link, "/");
               }
             else if ((ici->link) && (ici->removable))
               {
                  if (fwin->win)
-                   e_fwin_new(fwin->win->container, ici->link, "/");
+                   fwin2 = e_fwin_new(fwin->win->container, ici->link, "/");
                  else if (fwin->zone)
-                   e_fwin_new(fwin->zone->container, ici->link, "/");
+                   fwin2 = e_fwin_new(fwin->zone->container, ici->link, "/");
               }
             else if (ici->real_link)
               {
                  if (S_ISDIR(ici->statinfo.st_mode))
                    {
                       if (fwin->win)
-                        e_fwin_new(fwin->win->container, NULL, ici->real_link);
+                        fwin2 = e_fwin_new(fwin->win->container, NULL, 
ici->real_link);
                       else if (fwin->zone)
-                        e_fwin_new(fwin->zone->container, NULL, 
ici->real_link);
+                        fwin2 = e_fwin_new(fwin->zone->container, NULL, 
ici->real_link);
                    }
                  else
                    need_dia = 1;
@@ -914,12 +922,55 @@
                  if (S_ISDIR(ici->statinfo.st_mode))
                    {
                       if (fwin->win)
-                        e_fwin_new(fwin->win->container, NULL, buf);
+                        fwin2 = e_fwin_new(fwin->win->container, NULL, buf);
                       else
-                        e_fwin_new(fwin->zone->container, NULL, buf);
+                        fwin2 = e_fwin_new(fwin->zone->container, NULL, buf);
                    }
                  else
                    need_dia = 1;
+              }
+            if (fwin2)
+              {
+                 if ((fwin2->win) && (fwin2->win->border))
+                   {
+                      Evas_Object *oic;
+                      const char *itype = NULL;
+                      
+                      oic = e_fm2_icon_get(evas_object_evas_get(fwin->fm_obj),
+                                           ici->ic, NULL, NULL, 0, &itype);
+                      if (oic)
+                        {
+                           const char *file = NULL, *group = NULL;
+                           
+                           if (fwin2->win->border->internal_icon)
+                             
evas_stringshare_del(fwin2->win->border->internal_icon);
+                           fwin2->win->border->internal_icon = NULL;
+                           if (fwin2->win->border->internal_icon_key)
+                             
evas_stringshare_del(fwin2->win->border->internal_icon_key);
+                           fwin2->win->border->internal_icon_key = NULL;
+                           
+                           if (!strcmp(evas_object_type_get(oic), "edje"))
+                             {
+                                edje_object_file_get(oic, &file, &group);
+                                if (file)
+                                  {
+                                     fwin2->win->border->internal_icon = 
+                                       evas_stringshare_add(file);
+                                     if (group)
+                                       fwin2->win->border->internal_icon_key = 
+                                       evas_stringshare_add(group);
+                                  }
+                             }
+                           else
+                             {
+                                file = e_icon_file_get(oic);
+                                fwin2->win->border->internal_icon = 
+                                  evas_stringshare_add(file);
+                             }
+                           evas_object_del(oic);
+                        }
+                   }
+                 fwin2 = NULL;
               }
          }
        if (!need_dia) return;



-------------------------------------------------------------------------
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