Enlightenment CVS committal

Author  : stffrdhrn
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e.h e_alert.c e_config.c e_config.h e_fileman_smart.c e_font.c 
        e_intl.c e_intl.h e_ipc_handlers.h e_main.c e_utils.c 


Log Message:
E_Intl changes
- Hunt a path for message files

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- e.h 4 Nov 2005 23:10:34 -0000       1.35
+++ e.h 22 Nov 2005 13:28:10 -0000      1.36
@@ -114,6 +114,7 @@
 extern EAPI E_Path *path_modules;
 extern EAPI E_Path *path_backgrounds;
 extern EAPI E_Path *path_input_methods;
+extern EAPI E_Path *path_messages;
 extern EAPI int     restart;
 extern EAPI int     good;
 extern EAPI int     evil;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_alert.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_alert.c   19 Jul 2005 08:03:11 -0000      1.4
+++ e_alert.c   22 Nov 2005 13:28:10 -0000      1.5
@@ -30,7 +30,8 @@
    font = XLoadFont(dd, "fixed");
    fs = XQueryFont(dd, font);
    
-   /* dont i18n this - i dont want gettext doing anything as this is caleld 
from a segv */
+   /* dont i18n this - i dont want gettext doing anything as this is called 
+      from a segv */
    title = "Enlightenment Error";
    str1 = "(F1) Ignore";
    str2 = "(F2) Restart";
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -3 -r1.122 -r1.123
--- e_config.c  4 Nov 2005 23:30:18 -0000       1.122
+++ e_config.c  22 Nov 2005 13:28:10 -0000      1.123
@@ -362,7 +362,7 @@
    E_CONFIG_VAL(D, T, fullscreen_policy, INT); /**/
    E_CONFIG_VAL(D, T, input_method, STR); /**/
    E_CONFIG_LIST(D, T, path_append_input_methods, _e_config_path_append_edd); 
/**/
-   
+   E_CONFIG_LIST(D, T, path_append_messages, _e_config_path_append_edd); /**/
    e_config = e_config_domain_load("e", _e_config_edd);
    if (e_config)
      {
@@ -1942,6 +1942,14 @@
             E_FREE(epd->dir);
             E_FREE(epd);
          }
+       while (e_config->path_append_messages)
+         {
+            E_Path_Dir *epd;
+            epd = e_config->path_append_messages->data;
+            e_config->path_append_messages = 
evas_list_remove_list(e_config->path_append_messages, 
e_config->path_append_messages);
+            E_FREE(epd->dir);
+            E_FREE(epd);
+         }
        while (e_config->remembers)
          {
             E_Remember *rem;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- e_config.h  19 Nov 2005 06:10:52 -0000      1.65
+++ e_config.h  22 Nov 2005 13:28:10 -0000      1.66
@@ -50,7 +50,7 @@
  * defaults for e to work - started at 100 when we introduced this config
  * versioning feature
  */
-#define E_CONFIG_FILE_VERSION 128
+#define E_CONFIG_FILE_VERSION 129
 
 #define E_EVAS_ENGINE_DEFAULT      0
 #define E_EVAS_ENGINE_SOFTWARE_X11 1
@@ -120,6 +120,7 @@
    Evas_List  *path_append_modules;
    Evas_List  *path_append_backgrounds;
    Evas_List  *path_append_input_methods;
+   Evas_List  *path_append_messages;
    int         window_placement_policy; //
    int         focus_policy; // GUI
    int         focus_setting; // GUI
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_fileman_smart.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -3 -r1.108 -r1.109
--- e_fileman_smart.c   22 Nov 2005 09:27:25 -0000      1.108
+++ e_fileman_smart.c   22 Nov 2005 13:28:10 -0000      1.109
@@ -951,7 +951,6 @@
    E_Fm_Icon *icon;
 
    icon = data;
-
    switch (icon->file->type)
     {
      case E_FM_FILE_TYPE_DIRECTORY:
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_font.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- e_font.c    28 Sep 2005 17:36:35 -0000      1.13
+++ e_font.c    22 Nov 2005 13:28:10 -0000      1.14
@@ -125,7 +125,7 @@
 e_font_fallback_clear(void)
 {
    E_Font_Fallback *eff;
-   
+    
    while (e_config->font_fallbacks)
      { 
        eff = e_config->font_fallbacks->data;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_intl.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- e_intl.c    16 Nov 2005 03:47:20 -0000      1.53
+++ e_intl.c    22 Nov 2005 13:28:10 -0000      1.54
@@ -18,7 +18,6 @@
 static char *_e_intl_orig_lc_all = NULL;
 static char *_e_intl_orig_lang = NULL;
 static char *_e_intl_language = NULL;
-static Evas_List *_e_intl_languages = NULL;
 
 static char *_e_intl_orig_xmodifiers = NULL;
 static char *_e_intl_orig_qt_im_module = NULL; 
@@ -27,14 +26,18 @@
 
 static Eet_Data_Descriptor *_e_intl_input_method_config_edd = NULL;
 
-#define ADD_LANG(lang) _e_intl_languages = evas_list_append(_e_intl_languages, 
lang)
-
 #define E_EXE_STOP(EXE) if (EXE != NULL) { ecore_exe_terminate(EXE); 
ecore_exe_free(EXE); EXE = NULL; }
 #define E_EXE_IS_VALID(EXE) (!((EXE == NULL) || (EXE[0] == 0)))
 
+static Evas_Hash *_e_intl_language_path_scan(E_Path *path);
+static void _e_intl_language_hash_free(Evas_Hash *language_hash);
+static char *_e_intl_language_hash_find(Evas_Hash *language_hash, char 
*language);
+static int _e_intl_language_list_find(Evas_List *language_list, char 
*language);
+Evas_Bool _e_intl_cb_free_language_hash(Evas_Hash *hash, const char *key, void 
*data, void *fdata);
+static Evas_List *_e_intl_language_dir_scan(const char *dir);
 static int _e_intl_cb_exit(void *data, int type, void *event);
 static Evas_List *_e_intl_imc_path_scan(E_Path *path);
-static Evas_List *_e_intl_imc_dir_scan(char *dir);
+static Evas_List *_e_intl_imc_dir_scan(const char *dir);
 static E_Input_Method_Config *_e_intl_imc_find(Evas_List *imc_list, char 
*name);
 
 
@@ -42,8 +45,6 @@
 e_intl_init(void)
 {
    char *s;
- 
-   if (_e_intl_languages) return 1;
 
    /* supporeted languages - as we get translations - add them here
     * 
@@ -62,32 +63,7 @@
     *       vs. traditional chinese) we may refer to them as separate languages
     *       entirely.
     */
-   /* FIXME: remove this - hunt locale dirs (a user one in ~/.e/e/ too for
-    * user installed locale support
-    */
-   ADD_LANG("");
-   ADD_LANG("en_US.UTF-8");
-   ADD_LANG("ja_JP.UTF-8");
-   ADD_LANG("fr_FR.UTF-8");
-   ADD_LANG("es_AR.UTF-8");
-   ADD_LANG("pt_BR.UTF-8");
-   ADD_LANG("fi_FI.UTF-8");
-   ADD_LANG("ru_RU.UTF-8");
-   ADD_LANG("bg_BG.UTF-8");
-   ADD_LANG("de_DE.UTF-8");
-   ADD_LANG("pl_PL.UTF-8");
-   ADD_LANG("zh_CN.UTF-8");
-   ADD_LANG("hu_HU.UTF-8");
-   ADD_LANG("sl_SI.UTF-8");
-   ADD_LANG("it_IT.UTF-8");
-   ADD_LANG("cs_CZ.UTF-8");
-   ADD_LANG("da_DK.UTF-8");
-   ADD_LANG("sk_SK.UTF-8");
-   ADD_LANG("sv_SV.UTF-8");
-   ADD_LANG("nb_NO.UTF-8");
-   ADD_LANG("nl_NL.UTF-8");
-   ADD_LANG("zh_TW.UTF-8");
-
+   
    _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", 
E_Input_Method_Config);
    E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, 
version, INT);
    E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, 
e_im_name, STR);
@@ -122,8 +98,6 @@
    E_FREE(_e_intl_orig_qt_im_module);
    E_FREE(_e_intl_orig_xmodifiers);
    
-   evas_list_free(_e_intl_languages);
-   
    E_CONFIG_DD_FREE(_e_intl_input_method_config_edd);
   
    return 1;
@@ -158,114 +132,9 @@
    return 1;
 }
 
-static Evas_List *
-_e_intl_imc_path_scan(E_Path *path)
-{
-
-   Evas_List *next;
-   Evas_List *dir_list;
-   Evas_List *all_imcs;
-  
-   if (!path) return NULL; 
-   
-   all_imcs = NULL; 
-   dir_list = e_path_dir_list_get(path);
-   
-   for (next = dir_list ; next ; next = next->next)
-     {
-       E_Path_Dir *epd;
-       Evas_List *dir_imcs;
-       
-       epd = next->data;
-
-       dir_imcs = _e_intl_imc_dir_scan(epd->dir);
-       
-       while (dir_imcs)
-         {
-            E_Input_Method_Config *imc;
-
-            imc = dir_imcs->data;
-            dir_imcs = evas_list_remove_list(dir_imcs, dir_imcs);
-
-            if (_e_intl_imc_find(all_imcs, imc->e_im_name))
-              {
-                 e_intl_input_method_config_free(imc);
-              }
-            else
-              {
-                 all_imcs = evas_list_append(all_imcs, imc);
-              }
-         }
-     }
-   
-   e_path_dir_list_free(dir_list);  
-
-   return all_imcs;
-}
-   
-static Evas_List *
-_e_intl_imc_dir_scan(char *dir)
-{
-   Evas_List *imcs;
-   Ecore_List *files;
-   char *file;
-   
-   imcs = NULL;
-   
-   files = ecore_file_ls(dir);
-   if (!files) return NULL;
-  
-   ecore_list_goto_first(files);
-   if (files)
-     {
-       while ((file = ecore_list_next(files)))
-         {
-            E_Input_Method_Config *imc;
-            Eet_File *imc_file;
-            char buf[PATH_MAX]; 
-            
-            snprintf(buf, sizeof(buf), "%s/%s", dir, file);         
-            imc_file = eet_open(buf, EET_FILE_MODE_READ);
-            if (imc_file)
-              {
-                 imc = e_intl_input_method_config_read (imc_file);
-                 if (imc)
-                   {
-                      imcs = evas_list_append(imcs, imc);
-                   }
-              }
-         }
-       ecore_list_destroy(files);
-     }
-   return imcs;
-}
-
-static E_Input_Method_Config *
-_e_intl_imc_find(Evas_List *imc_list, char * name)
-{
-   Evas_List *l;
-   
-   if (!imc_list) return NULL;
-   if (!name) return NULL;
-
-   for (l = imc_list; l; l = l->next)
-     {
-       E_Input_Method_Config *imc;
-
-       imc = l->data;
-       if (!strcmp(imc->e_im_name, name)) return imc;
-     }
-   
-   return NULL;
-}
-
 void
 e_intl_language_set(const char *lang)
 {
-   /* 1 list ~/.e/e/locale contents */
-   /* 2 list e_preifx_locale_get() contents */
-   
-   /* FIXME: determine if in user or system locale dir */
    if (_e_intl_language) free(_e_intl_language);
    /* NULL lang means set everything back to the original environemtn defaults 
*/
    if (!lang)
@@ -291,6 +160,7 @@
      {
        _e_intl_language = NULL;
      }
+
    if (setlocale(LC_ALL, _e_intl_language) == NULL)
      {
        perror("setlocale() :");
@@ -300,10 +170,20 @@
        else
          printf("An error occured trying to use the default locale\n");
      }
-   bindtextdomain(PACKAGE, e_prefix_locale_get());
-   textdomain(PACKAGE);
+  
+   if (_e_intl_language) 
+     { 
+       Evas_Hash *language_hash;
+       char *locale_path;
+   
+       language_hash = _e_intl_language_path_scan(path_messages);
+       locale_path = _e_intl_language_hash_find(language_hash, 
_e_intl_language);
+       bindtextdomain(PACKAGE, locale_path);
+       _e_intl_language_hash_free(language_hash);
+       textdomain(PACKAGE);
 //   XSetLocaleModifiers("");
-   bind_textdomain_codeset(PACKAGE, "UTF-8");
+       bind_textdomain_codeset(PACKAGE, "UTF-8");
+     }
 }
 
 const char *
@@ -312,13 +192,63 @@
    return _e_intl_language;
 }
 
-const Evas_List *
+Evas_List *
 e_intl_language_list(void)
 {
-   /* FIXME: hunt dirs for locales */
-   return _e_intl_languages;
+   Evas_List *next;
+   Evas_List *dir_list;
+   Evas_List *all_languages;
+
+   all_languages = NULL;
+   dir_list = e_path_dir_list_get(path_messages);
+   for (next = dir_list ; next ; next = next->next)
+     {
+       E_Path_Dir *epd;        
+       Evas_List *dir_languages;
+               
+       epd = next->data;                       
+       dir_languages = _e_intl_language_dir_scan(epd->dir);
+       while (dir_languages)
+         {
+            char *language;
+
+            language = dir_languages->data;
+            dir_languages = evas_list_remove_list(dir_languages, 
dir_languages);
+
+            if (_e_intl_language_list_find(all_languages, language))
+              {
+                 free(language);
+              }
+            else
+              {
+                 all_languages = evas_list_append(all_languages, language);
+              }
+         }
+     }
+   
+   e_path_dir_list_free(dir_list);
+
+   return all_languages;
 }
 
+static int
+_e_intl_language_list_find(Evas_List *language_list, char * language)
+{
+   Evas_List *l;
+   
+   if (!language_list) return 0;
+   if (!language) return 0;
+
+   for (l = language_list; l; l = l->next)
+     {
+       char *lang;
+
+       lang = l->data;
+       if (!strcmp(lang, language)) return 1;
+     }
+   
+   return 0;
+}
 void
 e_intl_input_method_set(const char *method)
 {
@@ -474,3 +404,317 @@
    _e_intl_input_method_exec = NULL;
    return 1;
 }
+
+/* 
+ * Scan the path for languages. Return a hash of languages found in 
+ * the path. The hash is a Evas_Hash<String, String> the keys of the 
+ * hash are the languages (e.i. zh_CN) and the path is the direcory 
+ * where this locale was found. The directory is used to send to the locale
+ * function bindtextdomain().  
+ * Example Hash:
+ *     en -> ~/e/e/locale
+ *      zh_CN -> ~/my_messages  
+ *
+ * @path E_Path to scan
+ * @return hash of languages to path
+ */
+static Evas_Hash *
+_e_intl_language_path_scan(E_Path *path)
+{
+   Evas_List *next;
+   Evas_List *dir_list;
+   Evas_Hash *all_languages;
+   
+   if (!path) return NULL;
+
+   all_languages = NULL;
+   dir_list = e_path_dir_list_get(path);
+   for (next = dir_list ; next ; next = next->next)
+     {
+       E_Path_Dir *epd;        
+       Evas_List *dir_languages;
+               
+       epd = next->data;                       
+       dir_languages = _e_intl_language_dir_scan(epd->dir);
+       while (dir_languages)
+         {
+            char *language;
+
+            language = dir_languages->data;
+            dir_languages = evas_list_remove_list(dir_languages, 
dir_languages);
+
+            if (evas_hash_find(all_languages, language))
+              {
+                 free(language);
+              }
+            else
+              {
+                 all_languages = evas_hash_add(all_languages, language, 
strdup(epd->dir));
+                 free(language);
+              }
+         }
+     }
+   
+   e_path_dir_list_free(dir_list);  
+
+   return all_languages;
+}
+
+static void
+_e_intl_language_hash_free(Evas_Hash *language_hash)
+{
+   if(!language_hash) return;
+   evas_hash_foreach(language_hash, _e_intl_cb_free_language_hash, NULL);
+   evas_hash_free(language_hash);
+}
+
+Evas_Bool
+_e_intl_cb_free_language_hash(Evas_Hash *hash __UNUSED__, const char *key 
__UNUSED__, void *data, void *fdata __UNUSED__)
+{
+   free(data);
+   return 1;
+}
+
+
+/* 
+ * get the directory associated with the language.  
+ */
+static char *
+_e_intl_language_hash_find(Evas_Hash *language_hash, char *language)
+{
+   Evas_List *l;
+   Evas_List *all_languages;
+   char *best_language;
+   char *directory;
+   int state;
+   
+   if (!language_hash) return NULL;
+   if (!language) return NULL;
+
+   best_language = NULL;
+   all_languages = e_intl_language_list();
+   
+   /* Do a best match:
+    * If language is ja_JP.UTF-8 we should match ja 
+    * If language is zh we should match the first in the list, of zh_CN and 
zh_TW
+    */
+   for ( l = all_languages ; l ; l = l->next )
+     {
+       char *lang;
+       int comp_len;
+        int lang_len;
+        int language_len;      
+       
+       lang = l->data;
+       lang_len = strlen(lang);
+       language_len = strlen(language);
+       /* return shorter */
+       comp_len = lang_len > language_len ? language_len : lang_len;
+       
+       if ( !strncmp(lang, language, comp_len) )
+         {
+            if ( best_language == NULL ) 
+              {
+                 best_language = lang;
+                 if ( lang_len > language_len ) 
+                   state = 1; /* looking for shorter */
+                 else 
+                   state = 0; /* looking for longer */
+              }
+            else if ( (state == 1 && lang_len > language_len) ||
+                      (state == 0 && lang_len < language_len) )
+              best_language = lang;
+            
+            if ( strlen(best_language) == language_len ) break;          
+         }
+     }
+   
+   directory = evas_hash_find(language_hash, best_language);
+   
+   while (all_languages)
+     {
+       char *lang;
+
+       lang = all_languages->data;
+       all_languages = evas_list_remove_list(all_languages, all_languages);
+       free(lang);
+     }
+   
+   return directory;
+}
+
+static Evas_List *
+_e_intl_language_dir_scan(const char *dir)
+{
+   Evas_List *languages;
+   Ecore_List *files;
+   char *file;
+   
+   languages = NULL;
+   
+   files = ecore_file_ls(dir);
+   if (!files) return NULL;
+  
+   ecore_list_goto_first(files);
+   if (files)
+     {
+       while ((file = ecore_list_next(files)))
+         {
+            char file_path[PATH_MAX];
+            
+            snprintf(file_path, sizeof(file_path),"%s/%s", dir, file);
+            if (ecore_file_is_dir(file_path))
+              {
+                 /* look for LC_MESSAGES */
+                 Ecore_List *level_one_files;
+                 char *level_one_file;
+                 
+                 level_one_files = ecore_file_ls(file_path);
+                 if (!level_one_files) continue;
+                 
+                 ecore_list_goto_first(level_one_files);
+                 if (level_one_files)
+                   {
+                      while ((level_one_file = 
ecore_list_next(level_one_files)))
+                        {
+                           char level_one_file_path[PATH_MAX];
+
+                           snprintf(level_one_file_path, 
sizeof(level_one_file_path),"%s/%s", file_path, level_one_file);
+                           if (  !strcmp(level_one_file, "LC_MESSAGES") && 
+                                 ecore_file_is_dir(level_one_file_path))
+                             {
+                                /* Find any enlightenment.mo files */
+                                Ecore_List *level_two_files;
+                                char *level_two_file;
+                                
+                                level_two_files = 
ecore_file_ls(level_one_file_path);
+                                if (!level_two_files) continue;
+                                
+                                ecore_list_goto_first(level_two_files);
+                                if (level_two_files)
+                                  {
+                                     while ((level_two_file = 
ecore_list_next(level_two_files)))
+                                       {
+                                          char level_two_file_path[PATH_MAX];
+
+                                          snprintf(level_two_file_path, 
sizeof(level_two_file_path),"%s/%s", level_one_file_path, level_two_file);
+                                          if (  !strcmp(level_two_file, 
PACKAGE".mo") &&
+                                                
!ecore_file_is_dir(level_two_file_path))
+                                            {
+                                               languages = 
evas_list_append(languages, strdup(file));
+                                               break;
+                                            }
+                                       }
+                                     ecore_list_destroy(level_two_files);
+                                  }
+                             }                     
+                        }
+                      ecore_list_destroy(level_one_files);
+                   }
+              }
+         }
+       ecore_list_destroy(files);
+     }
+   return languages;
+}
+
+static Evas_List *
+_e_intl_imc_path_scan(E_Path *path)
+{
+
+   Evas_List *next;
+   Evas_List *dir_list;
+   Evas_List *all_imcs;
+  
+   if (!path) return NULL; 
+   
+   all_imcs = NULL; 
+   dir_list = e_path_dir_list_get(path);
+   
+   for (next = dir_list ; next ; next = next->next)
+     {
+       E_Path_Dir *epd;
+       Evas_List *dir_imcs;
+       
+       epd = next->data;
+
+       dir_imcs = _e_intl_imc_dir_scan(epd->dir);
+       
+       while (dir_imcs)
+         {
+            E_Input_Method_Config *imc;
+
+            imc = dir_imcs->data;
+            dir_imcs = evas_list_remove_list(dir_imcs, dir_imcs);
+
+            if (_e_intl_imc_find(all_imcs, imc->e_im_name))
+              {
+                 e_intl_input_method_config_free(imc);
+              }
+            else
+              {
+                 all_imcs = evas_list_append(all_imcs, imc);
+              }
+         }
+     }
+   
+   e_path_dir_list_free(dir_list);  
+
+   return all_imcs;
+}
+   
+static Evas_List *
+_e_intl_imc_dir_scan(const char *dir)
+{
+   Evas_List *imcs;
+   Ecore_List *files;
+   char *file;
+   
+   imcs = NULL;
+   
+   files = ecore_file_ls(dir);
+   if (!files) return NULL;
+  
+   ecore_list_goto_first(files);
+   if (files)
+     {
+       while ((file = ecore_list_next(files)))
+         {
+            E_Input_Method_Config *imc;
+            Eet_File *imc_file;
+            char buf[PATH_MAX]; 
+            
+            snprintf(buf, sizeof(buf), "%s/%s", dir, file);         
+            imc_file = eet_open(buf, EET_FILE_MODE_READ);
+            if (imc_file)
+              {
+                 imc = e_intl_input_method_config_read (imc_file);
+                 if (imc)
+                   {
+                      imcs = evas_list_append(imcs, imc);
+                   }
+              }
+         }
+       ecore_list_destroy(files);
+     }
+   return imcs;
+}
+
+static E_Input_Method_Config *
+_e_intl_imc_find(Evas_List *imc_list, char * name)
+{
+   Evas_List *l;
+   
+   if (!imc_list) return NULL;
+   if (!name) return NULL;
+
+   for (l = imc_list; l; l = l->next)
+     {
+       E_Input_Method_Config *imc;
+
+       imc = l->data;
+       if (!strcmp(imc->e_im_name, name)) return imc;
+     }
+   
+   return NULL;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_intl.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- e_intl.h    23 Oct 2005 04:56:51 -0000      1.7
+++ e_intl.h    22 Nov 2005 13:28:10 -0000      1.8
@@ -45,7 +45,7 @@
 /* Setting & Getting Language */
 EAPI void               e_intl_language_set(const char *lang);
 EAPI const char                *e_intl_language_get(void);
-EAPI const Evas_List   *e_intl_language_list(void);
+EAPI Evas_List         *e_intl_language_list(void);
 /* Setting & Getting Input Method */
 EAPI void                e_intl_input_method_set(const char *method);
 EAPI const char         *e_intl_input_method_get(void);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- e_ipc_handlers.h    20 Nov 2005 06:13:37 -0000      1.107
+++ e_ipc_handlers.h    22 Nov 2005 13:28:10 -0000      1.108
@@ -807,8 +807,9 @@
    else if (!strcmp(__str, "backgrounds")) \
      __path = path_backgrounds; \
    else if (!strcmp(__str, "input_methods")) \
-     __path = path_input_methods; 
-
+     __path = path_input_methods; \
+   else if (!strcmp(__str, "messages")) \
+     __path = path_messages; 
 
 #endif
 
@@ -1336,8 +1337,11 @@
 #elif (TYPE == E_WM_IN)
    GENERIC(HDL);
    LIST_DATA();
-   ENCODE((Evas_List *)e_intl_language_list(), e_ipc_codec_str_list_enc);
+   Evas_List *languages;
+   languages = e_intl_language_list();
+   ENCODE(languages, e_ipc_codec_str_list_enc);
    SEND_DATA(E_IPC_OP_LANG_LIST_REPLY);
+   FREE_LIST(languages); 
    END_GENERIC();
 #elif (TYPE == E_REMOTE_IN)
 #endif
@@ -1425,25 +1429,9 @@
    STRING(s, HDL);
    LIST_DATA()
    Evas_List *dir_list = NULL;
-   if (!strcmp(s, "data"))
-     dir_list = e_path_dir_list_get(path_data);
-   else if (!strcmp(s, "images"))
-     dir_list = e_path_dir_list_get(path_images);
-   else if (!strcmp(s, "fonts"))
-     dir_list = e_path_dir_list_get(path_fonts);
-   else if (!strcmp(s, "themes"))
-     dir_list = e_path_dir_list_get(path_themes);
-   else if (!strcmp(s, "init"))
-     dir_list = e_path_dir_list_get(path_init);
-   else if (!strcmp(s, "icons"))
-     dir_list = e_path_dir_list_get(path_icons);
-   else if (!strcmp(s, "modules"))
-     dir_list = e_path_dir_list_get(path_modules);
-   else if (!strcmp(s, "backgrounds"))
-     dir_list = e_path_dir_list_get(path_backgrounds);
-   else if (!strcmp(s, "input_methods"))
-     dir_list = e_path_dir_list_get(path_input_methods);
-
+   E_PATH_GET(path, s);
+   dir_list = e_path_dir_list_get(path);
+     
    E_Path_Dir *p;
    dat = evas_list_append(dat, strdup(s));
    FOR(dir_list) { p = l->data;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -3 -r1.137 -r1.138
--- e_main.c    8 Nov 2005 13:02:19 -0000       1.137
+++ e_main.c    22 Nov 2005 13:28:10 -0000      1.138
@@ -949,7 +949,16 @@
    e_path_default_path_append(path_input_methods, buf);
    e_path_user_path_set(path_input_methods, 
&(e_config->path_append_input_methods));
 
-
+   path_messages = e_path_new();
+   if (!path_messages) 
+     {
+       e_error_message_show("Cannot allocate path for path_messages\n");
+       return 0;
+     }
+   e_path_default_path_append(path_messages, "~/.e/e/locale");   
+   e_path_default_path_append(path_messages, e_prefix_locale_get());
+   e_path_user_path_set(path_messages, &(e_config->path_append_messages));
+   
    return 1;
 }
 
@@ -1001,6 +1010,11 @@
        e_object_del(E_OBJECT(path_input_methods));
         path_input_methods = NULL;
      }
+   if (path_messages)
+     {
+       e_object_del(E_OBJECT(path_messages));
+       path_messages = NULL;                             
+     }
    return 1;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_utils.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- e_utils.c   23 Oct 2005 04:56:51 -0000      1.30
+++ e_utils.c   22 Nov 2005 13:28:10 -0000      1.31
@@ -12,6 +12,7 @@
 E_Path *path_modules = NULL;
 E_Path *path_backgrounds = NULL;
 E_Path *path_input_methods = NULL;
+E_Path *path_messages = NULL;
 int     restart      = 0;
 int     good         = 0;
 int     evil         = 0;




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to