Enlightenment CVS committal

Author  : onefang
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_utils.c 


Log Message:
Two functionss for checking for the existance of icons in the E theme.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_utils.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_utils.c   18 Sep 2006 03:49:44 -0000      1.52
+++ e_utils.c   1 Oct 2006 18:21:31 -0000       1.53
@@ -292,6 +292,37 @@
 }
 
 EAPI int
+e_util_edje_icon_list_check(const char *list)
+{
+   char *buf;
+   const char *p;
+   const char *c;
+   
+   if ((!list) || (!list[0])) return 0;
+   buf = alloca(strlen(list) + 1);
+   p = list;
+   while (p)
+     {
+       c = strchr(p, ',');
+       if (c)
+         {
+            strncpy(buf, p, c - p);
+            buf[c - p] = 0;
+            if (e_util_edje_icon_check(buf)) return 1;
+            p = c + 1;
+            if (!*p) return 0;
+         }
+       else
+         {
+            strcpy(buf, p);
+            if (e_util_edje_icon_check(buf)) return 1;
+            return 0;
+         }
+     }
+   return 0;
+}
+
+EAPI int
 e_util_edje_icon_list_set(Evas_Object *obj, const char *list)
 {
    char *buf;
@@ -350,6 +381,20 @@
             return 0;
          }
      }
+   return 0;
+}
+
+EAPI int
+e_util_edje_icon_check(const char *name)
+{
+   const char *file;
+   char buf[4096];
+
+   if ((!name) || (!name[0])) return 0;
+   snprintf(buf, sizeof(buf), "e/icons/%s", name);
+   file = e_theme_edje_file_get("base/theme/icons", buf);
+   if (file[0])
+      return 1;
    return 0;
 }
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to