Enlightenment CVS committal

Author  : devilhorns
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_config_color_classes.c 


Log Message:
Start "virtualizing" the color classes to a "long name" that can be
translated.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_color_classes.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_int_config_color_classes.c        3 Oct 2006 11:17:37 -0000       1.3
+++ e_int_config_color_classes.c        3 Oct 2006 11:47:48 -0000       1.4
@@ -1,6 +1,7 @@
 #include "e.h"
 
 typedef struct _CFColor_Class CFColor_Class;
+typedef struct _CFColor_Hash CFColor_Hash;
 
 static void        *_create_data          (E_Config_Dialog *cfd);
 static void         _free_data            (E_Config_Dialog *cfd, 
E_Config_Dialog_Data *cfdata);
@@ -11,6 +12,12 @@
 
 static void         _load_color_classes   (Evas_Object *obj, 
E_Config_Dialog_Data *cfdata);
 
+struct _CFColor_Hash 
+{
+   const char *key;
+   const char *name;
+};
+
 struct _CFColor_Class 
 {
    const char *name;
@@ -25,6 +32,13 @@
    Evas_List *classes;
 };
 
+const CFColor_Hash _color_hash[] = 
+{
+     {"button_text_enabled", N_("Button Text Enabled")},
+     {"button_text_disabled", N_("Button Text Disabled")},
+     {NULL, NULL}
+};
+
 EAPI E_Config_Dialog *
 e_int_config_color_classes(E_Container *con) 
 {
@@ -50,9 +64,41 @@
 _fill_data(E_Config_Dialog_Data *cfdata) 
 {
    Evas_List *l;
+   Evas_Hash *color_hash;
    
    cfdata->cur_class = NULL;
    cfdata->state = 0;
+   
+   for (l = edje_color_class_list(); l; l = l->next) 
+     {
+       Evas_Object *icon;
+       E_Color_Class *cc;
+       CFColor_Class *cfc;
+       char *name;
+       int i = 0;
+       
+       name = (char *)l->data;
+       if (!name) continue;
+
+       cfc = E_NEW(CFColor_Class, 1);
+       while (_color_hash[i].key) 
+         {
+            if (!strcmp(_color_hash[i].key, name)) 
+              {
+                 cfc->name = evas_stringshare_add(_color_hash[i].name);
+                 break;
+              }
+            i++;
+         }
+       if (!cfc->name)
+         cfc->name = evas_stringshare_add(name);
+         
+       cfc->enabled = 0;
+       cc = e_color_class_find(name);
+       if (cc) 
+         cfc->enabled = 1;
+       cfdata->classes = evas_list_append(cfdata->classes, cfc);
+     }
 
    cfdata->color1 = calloc(1, sizeof(E_Color));
    cfdata->color1->a = 255;
@@ -75,25 +121,6 @@
    e_color_update_rgb(cfdata->color1);
    e_color_update_rgb(cfdata->color2);
    e_color_update_rgb(cfdata->color3);
-   
-   for (l = edje_color_class_list(); l; l = l->next) 
-     {
-       char *name;
-       Evas_Object *icon;
-       E_Color_Class *cc;
-       CFColor_Class *cfc;
-       
-       name = (char *)l->data;
-       if (!name) continue;
-       
-       cfc = E_NEW(CFColor_Class, 1);
-       cfc->name = evas_stringshare_add(name);
-       cfc->enabled = 0;
-       cc = e_color_class_find(name);
-       if (cc) 
-         cfc->enabled = 1;
-       cfdata->classes = evas_list_append(cfdata->classes, cfc);
-     }
 }
 
 static void *



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