summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2007-03-24 12:55:30 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2007-03-24 12:55:30 +0000
commitb150b36b9345fe254775e288a401cdc47ee67fbe (patch)
treead65db48a3aa9695105516af310f511346c09a4b
parentca94561458bc82391e7476967fda5fbb64b8d895 (diff)
Formatting.
SVN revision: 29008
-rw-r--r--src/bin/e_intl.c368
-rw-r--r--src/bin/e_sys.c54
-rw-r--r--src/bin/e_thumb.c26
-rw-r--r--src/bin/e_utils.c88
4 files changed, 268 insertions, 268 deletions
diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c
index c41c337..097c445 100644
--- a/src/bin/e_intl.c
+++ b/src/bin/e_intl.c
@@ -15,7 +15,7 @@ static char *_e_intl_language = NULL;
15static char *_e_intl_language_alias = NULL; 15static char *_e_intl_language_alias = NULL;
16 16
17static char *_e_intl_orig_xmodifiers = NULL; 17static char *_e_intl_orig_xmodifiers = NULL;
18static char *_e_intl_orig_qt_im_module = NULL; 18static char *_e_intl_orig_qt_im_module = NULL;
19static char *_e_intl_orig_gtk_im_module = NULL; 19static char *_e_intl_orig_gtk_im_module = NULL;
20 20
21static const char *_e_intl_imc_personal_path = NULL; 21static const char *_e_intl_imc_personal_path = NULL;
@@ -59,7 +59,7 @@ EAPI int
59e_intl_init(void) 59e_intl_init(void)
60{ 60{
61 char *s; 61 char *s;
62 62
63 _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config); 63 _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config);
64 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, version, INT); 64 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, version, INT);
65 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_name, STR); 65 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_name, STR);
@@ -67,7 +67,7 @@ e_intl_init(void)
67 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, qt_im_module, STR); 67 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, qt_im_module, STR);
68 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, xmodifiers, STR); 68 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, xmodifiers, STR);
69 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_exec, STR); 69 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_exec, STR);
70 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_setup_exec, STR); 70 E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_setup_exec, STR);
71 71
72 if ((s = getenv("LC_MESSAGES"))) _e_intl_orig_lc_messages = strdup(s); 72 if ((s = getenv("LC_MESSAGES"))) _e_intl_orig_lc_messages = strdup(s);
73 if ((s = getenv("LANGUAGE"))) _e_intl_orig_language = strdup(s); 73 if ((s = getenv("LANGUAGE"))) _e_intl_orig_language = strdup(s);
@@ -77,7 +77,7 @@ e_intl_init(void)
77 if ((s = getenv("GTK_IM_MODULE"))) _e_intl_orig_gtk_im_module = strdup(s); 77 if ((s = getenv("GTK_IM_MODULE"))) _e_intl_orig_gtk_im_module = strdup(s);
78 if ((s = getenv("QT_IM_MODULE"))) _e_intl_orig_qt_im_module = strdup(s); 78 if ((s = getenv("QT_IM_MODULE"))) _e_intl_orig_qt_im_module = strdup(s);
79 if ((s = getenv("XMODIFIERS"))) _e_intl_orig_xmodifiers = strdup(s); 79 if ((s = getenv("XMODIFIERS"))) _e_intl_orig_xmodifiers = strdup(s);
80 80
81 return 1; 81 return 1;
82} 82}
83 83
@@ -89,18 +89,18 @@ e_intl_shutdown(void)
89 E_FREE(_e_intl_orig_language); 89 E_FREE(_e_intl_orig_language);
90 E_FREE(_e_intl_orig_lc_all); 90 E_FREE(_e_intl_orig_lc_all);
91 E_FREE(_e_intl_orig_lang); 91 E_FREE(_e_intl_orig_lang);
92 92
93 E_FREE(_e_intl_orig_gtk_im_module); 93 E_FREE(_e_intl_orig_gtk_im_module);
94 E_FREE(_e_intl_orig_qt_im_module); 94 E_FREE(_e_intl_orig_qt_im_module);
95 E_FREE(_e_intl_orig_xmodifiers); 95 E_FREE(_e_intl_orig_xmodifiers);
96 96
97 if (_e_intl_imc_personal_path) 97 if (_e_intl_imc_personal_path)
98 evas_stringshare_del(_e_intl_imc_personal_path); 98 evas_stringshare_del(_e_intl_imc_personal_path);
99 if (_e_intl_imc_system_path) 99 if (_e_intl_imc_system_path)
100 evas_stringshare_del(_e_intl_imc_system_path); 100 evas_stringshare_del(_e_intl_imc_system_path);
101 101
102 E_CONFIG_DD_FREE(_e_intl_input_method_config_edd); 102 E_CONFIG_DD_FREE(_e_intl_input_method_config_edd);
103 103
104 return 1; 104 return 1;
105} 105}
106 106
@@ -110,11 +110,11 @@ e_intl_post_init(void)
110{ 110{
111 if ((e_config->language) && (e_config->language[0] != 0)) 111 if ((e_config->language) && (e_config->language[0] != 0))
112 e_intl_language_set(e_config->language); 112 e_intl_language_set(e_config->language);
113 else 113 else
114 e_intl_language_set(NULL); 114 e_intl_language_set(NULL);
115 115
116 if ((e_config->input_method) && (e_config->input_method[0] != 0)) 116 if ((e_config->input_method) && (e_config->input_method[0] != 0))
117 e_intl_input_method_set(e_config->input_method); 117 e_intl_input_method_set(e_config->input_method);
118 118
119 _e_intl_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _e_intl_cb_exit, NULL); 119 _e_intl_exit_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _e_intl_cb_exit, NULL);
120 return 1; 120 return 1;
@@ -126,20 +126,20 @@ e_intl_post_shutdown(void)
126 if (_e_intl_exit_handler) 126 if (_e_intl_exit_handler)
127 { 127 {
128 ecore_event_handler_del(_e_intl_exit_handler); 128 ecore_event_handler_del(_e_intl_exit_handler);
129 _e_intl_exit_handler = NULL; 129 _e_intl_exit_handler = NULL;
130 } 130 }
131 131
132 e_intl_input_method_set(NULL); 132 e_intl_input_method_set(NULL);
133 133
134 e_intl_language_set(NULL); 134 e_intl_language_set(NULL);
135 E_FREE(_e_intl_language_alias); 135 E_FREE(_e_intl_language_alias);
136 136
137 E_EXE_STOP(_e_intl_input_method_exec); 137 E_EXE_STOP(_e_intl_input_method_exec);
138 return 1; 138 return 1;
139} 139}
140 140
141/* 141/*
142 * TODO 142 * TODO
143 * - Add error dialogs explaining any errors while setting the locale 143 * - Add error dialogs explaining any errors while setting the locale
144 * * Locale aliases need to be configured 144 * * Locale aliases need to be configured
145 * * Locale is invalid 145 * * Locale is invalid
@@ -151,10 +151,10 @@ EAPI void
151e_intl_language_set(const char *lang) 151e_intl_language_set(const char *lang)
152{ 152{
153 int set_envars; 153 int set_envars;
154 154
155 set_envars = 1; 155 set_envars = 1;
156 /* NULL lang means set everything back to the original environment 156 /* NULL lang means set everything back to the original environment
157 * defaults 157 * defaults
158 */ 158 */
159 if (!lang) 159 if (!lang)
160 { 160 {
@@ -162,24 +162,24 @@ e_intl_language_set(const char *lang)
162 e_util_env_set("LANGUAGE", _e_intl_orig_language); 162 e_util_env_set("LANGUAGE", _e_intl_orig_language);
163 e_util_env_set("LC_ALL", _e_intl_orig_lc_all); 163 e_util_env_set("LC_ALL", _e_intl_orig_lc_all);
164 e_util_env_set("LANG", _e_intl_orig_lang); 164 e_util_env_set("LANG", _e_intl_orig_lang);
165 165
166 lang = getenv("LC_MESSAGES"); 166 lang = getenv("LC_MESSAGES");
167 if (!lang) lang = getenv("LANGUAGE"); 167 if (!lang) lang = getenv("LANGUAGE");
168 if (!lang) lang = getenv("LC_ALL"); 168 if (!lang) lang = getenv("LC_ALL");
169 if (!lang) lang = getenv("LANG"); 169 if (!lang) lang = getenv("LANG");
170 170
171 set_envars = 0; 171 set_envars = 0;
172 } 172 }
173 173
174 E_FREE(_e_intl_language_alias); 174 E_FREE(_e_intl_language_alias);
175 _e_intl_language_alias = _e_intl_locale_alias_get(lang); 175 _e_intl_language_alias = _e_intl_locale_alias_get(lang);
176 E_FREE(_e_intl_language); 176 E_FREE(_e_intl_language);
177 177
178 if (lang) 178 if (lang)
179 _e_intl_language = strdup(lang); 179 _e_intl_language = strdup(lang);
180 else 180 else
181 _e_intl_language = NULL; 181 _e_intl_language = NULL;
182 182
183 if (!_e_intl_locale_validate(_e_intl_language_alias)) 183 if (!_e_intl_locale_validate(_e_intl_language_alias))
184 { 184 {
185 fprintf(stderr, "The locale '%s' cannot be found on your " 185 fprintf(stderr, "The locale '%s' cannot be found on your "
@@ -196,44 +196,44 @@ e_intl_language_set(const char *lang)
196 e_util_env_set("LC_ALL", _e_intl_language); 196 e_util_env_set("LC_ALL", _e_intl_language);
197 e_util_env_set("LC_MESSAGES", _e_intl_language); 197 e_util_env_set("LC_MESSAGES", _e_intl_language);
198 } 198 }
199 199
200 setlocale(LC_ALL, _e_intl_language); 200 setlocale(LC_ALL, _e_intl_language);
201 if (_e_intl_language) 201 if (_e_intl_language)
202 { 202 {
203 char *locale_path; 203 char *locale_path;
204 204
205 locale_path = _e_intl_language_path_find(_e_intl_language_alias); 205 locale_path = _e_intl_language_path_find(_e_intl_language_alias);
206 if (locale_path == NULL) 206 if (locale_path == NULL)
207 { 207 {
208 E_Locale_Parts *locale_parts; 208 E_Locale_Parts *locale_parts;
209 209
210 locale_parts = e_intl_locale_parts_get(_e_intl_language_alias); 210 locale_parts = e_intl_locale_parts_get(_e_intl_language_alias);
211 211
212 /* If locale is C or some form of en don't report an error */ 212 /* If locale is C or some form of en don't report an error */
213 if ( locale_parts == NULL && strcmp (_e_intl_language_alias, "C") ) 213 if ( locale_parts == NULL && strcmp (_e_intl_language_alias, "C") )
214 { 214 {
215 fprintf(stderr, 215 fprintf(stderr,
216 "An error occurred setting your locale. \n\n" 216 "An error occurred setting your locale. \n\n"
217 217
218 "The locale you have chosen '%s' appears to \n" 218 "The locale you have chosen '%s' appears to \n"
219 "be an alias, however, it can not be resloved.\n" 219 "be an alias, however, it can not be resloved.\n"
220 "Please make sure you have a 'locale.alias' \n" 220 "Please make sure you have a 'locale.alias' \n"
221 "file in your 'messages' path which can resolve\n" 221 "file in your 'messages' path which can resolve\n"
222 "this alias.\n\n" 222 "this alias.\n\n"
223 223
224 "Enlightenment will not be translated.\n", 224 "Enlightenment will not be translated.\n",
225 _e_intl_language_alias); 225 _e_intl_language_alias);
226 } 226 }
227 else if ( locale_parts && locale_parts->lang && strcmp(locale_parts->lang, "en") ) 227 else if ( locale_parts && locale_parts->lang && strcmp(locale_parts->lang, "en") )
228 { 228 {
229 fprintf(stderr, 229 fprintf(stderr,
230 "An error occurred setting your locale. \n\n" 230 "An error occurred setting your locale. \n\n"
231 231
232 "The translation files for the locale you \n" 232 "The translation files for the locale you \n"
233 "have chosen (%s) cannot be found in your \n" 233 "have chosen (%s) cannot be found in your \n"
234 "'messages' path. \n\n" 234 "'messages' path. \n\n"
235 235
236 "Enlightenment will not be translated.\n", 236 "Enlightenment will not be translated.\n",
237 _e_intl_language_alias); 237 _e_intl_language_alias);
238 } 238 }
239 e_intl_locale_parts_free(locale_parts); 239 e_intl_locale_parts_free(locale_parts);
@@ -244,7 +244,7 @@ e_intl_language_set(const char *lang)
244 textdomain(PACKAGE); 244 textdomain(PACKAGE);
245 bind_textdomain_codeset(PACKAGE, "UTF-8"); 245 bind_textdomain_codeset(PACKAGE, "UTF-8");
246 free(locale_path); 246 free(locale_path);
247 } 247 }
248 } 248 }
249 } 249 }
250} 250}
@@ -272,10 +272,10 @@ e_intl_language_list(void)
272 dir_list = e_path_dir_list_get(path_messages); 272 dir_list = e_path_dir_list_get(path_messages);
273 for (next = dir_list ; next ; next = next->next) 273 for (next = dir_list ; next ; next = next->next)
274 { 274 {
275 E_Path_Dir *epd; 275 E_Path_Dir *epd;
276 Evas_List *dir_languages; 276 Evas_List *dir_languages;
277 277
278 epd = next->data; 278 epd = next->data;
279 dir_languages = _e_intl_language_dir_scan(epd->dir); 279 dir_languages = _e_intl_language_dir_scan(epd->dir);
280 while (dir_languages) 280 while (dir_languages)
281 { 281 {
@@ -284,7 +284,7 @@ e_intl_language_list(void)
284 language = dir_languages->data; 284 language = dir_languages->data;
285 dir_languages = evas_list_remove_list(dir_languages, dir_languages); 285 dir_languages = evas_list_remove_list(dir_languages, dir_languages);
286 286
287 if ( _e_intl_language_list_find(all_languages, language) || (strlen(language) > 2 && 287 if ( _e_intl_language_list_find(all_languages, language) || (strlen(language) > 2 &&
288 !_e_intl_locale_validate(language))) 288 !_e_intl_locale_validate(language)))
289 { 289 {
290 free(language); 290 free(language);
@@ -295,7 +295,7 @@ e_intl_language_list(void)
295 } 295 }
296 } 296 }
297 } 297 }
298 298
299 e_path_dir_list_free(dir_list); 299 e_path_dir_list_free(dir_list);
300 300
301 return all_languages; 301 return all_languages;
@@ -305,7 +305,7 @@ static int
305_e_intl_language_list_find(Evas_List *language_list, char *language) 305_e_intl_language_list_find(Evas_List *language_list, char *language)
306{ 306{
307 Evas_List *l; 307 Evas_List *l;
308 308
309 if (!language_list) return 0; 309 if (!language_list) return 0;
310 if (!language) return 0; 310 if (!language) return 0;
311 311
@@ -316,7 +316,7 @@ _e_intl_language_list_find(Evas_List *language_list, char *language)
316 lang = l->data; 316 lang = l->data;
317 if (!strcmp(lang, language)) return 1; 317 if (!strcmp(lang, language)) return 1;
318 } 318 }
319 319
320 return 0; 320 return 0;
321} 321}
322 322
@@ -325,14 +325,14 @@ e_intl_input_method_set(const char *imc_path)
325{ 325{
326 if (!imc_path) 326 if (!imc_path)
327 { 327 {
328 E_EXE_STOP(_e_intl_input_method_exec); 328 E_EXE_STOP(_e_intl_input_method_exec);
329 e_util_env_set("GTK_IM_MODULE", _e_intl_orig_gtk_im_module); 329 e_util_env_set("GTK_IM_MODULE", _e_intl_orig_gtk_im_module);
330 e_util_env_set("QT_IM_MODULE", _e_intl_orig_qt_im_module); 330 e_util_env_set("QT_IM_MODULE", _e_intl_orig_qt_im_module);
331 e_util_env_set("XMODIFIERS", _e_intl_orig_xmodifiers); 331 e_util_env_set("XMODIFIERS", _e_intl_orig_xmodifiers);
332 } 332 }
333 333
334 if (imc_path) 334 if (imc_path)
335 { 335 {
336 Eet_File *imc_ef; 336 Eet_File *imc_ef;
337 E_Input_Method_Config *imc; 337 E_Input_Method_Config *imc;
338 338
@@ -341,36 +341,36 @@ e_intl_input_method_set(const char *imc_path)
341 { 341 {
342 imc = e_intl_input_method_config_read(imc_ef); 342 imc = e_intl_input_method_config_read(imc_ef);
343 eet_close(imc_ef); 343 eet_close(imc_ef);
344 344
345 if (imc) 345 if (imc)
346 { 346 {
347 e_util_env_set("GTK_IM_MODULE", imc->gtk_im_module); 347 e_util_env_set("GTK_IM_MODULE", imc->gtk_im_module);
348 e_util_env_set("QT_IM_MODULE", imc->qt_im_module); 348 e_util_env_set("QT_IM_MODULE", imc->qt_im_module);
349 e_util_env_set("XMODIFIERS", imc->xmodifiers); 349 e_util_env_set("XMODIFIERS", imc->xmodifiers);
350 350
351 E_EXE_STOP(_e_intl_input_method_exec); 351 E_EXE_STOP(_e_intl_input_method_exec);
352 352
353 if (E_EXE_IS_VALID(imc->e_im_exec)) 353 if (E_EXE_IS_VALID(imc->e_im_exec))
354 { 354 {
355 e_util_library_path_strip(); 355 e_util_library_path_strip();
356 _e_intl_input_method_exec = ecore_exe_run(imc->e_im_exec, NULL); 356 _e_intl_input_method_exec = ecore_exe_run(imc->e_im_exec, NULL);
357 e_util_library_path_restore(); 357 e_util_library_path_restore();
358 ecore_exe_tag_set(_e_intl_input_method_exec,"E/im_exec"); 358 ecore_exe_tag_set(_e_intl_input_method_exec,"E/im_exec");
359 359
360 if ( !_e_intl_input_method_exec || 360 if ((!_e_intl_input_method_exec) ||
361 !ecore_exe_pid_get(_e_intl_input_method_exec)) 361 (!ecore_exe_pid_get(_e_intl_input_method_exec)))
362 e_util_dialog_show(_("Input Method Error"), 362 e_util_dialog_show(_("Input Method Error"),
363 _( "Error starting the input method executable<br><br>" 363 _( "Error starting the input method executable<br><br>"
364 364
365 "please make sure that your input<br>" 365 "please make sure that your input<br>"
366 "method configuration is correct and<br>" 366 "method configuration is correct and<br>"
367 "that your configuration's<br>" 367 "that your configuration's<br>"
368 "executable is in your PATH<br>")); 368 "executable is in your PATH<br>"));
369 } 369 }
370 e_intl_input_method_config_free(imc); 370 e_intl_input_method_config_free(imc);
371 } 371 }
372 } 372 }
373 } 373 }
374} 374}
375 375
376EAPI Evas_List * 376EAPI Evas_List *
@@ -382,8 +382,8 @@ e_intl_input_method_list(void)
382 char *imc_path; 382 char *imc_path;
383 383
384 im_list = NULL; 384 im_list = NULL;
385 385
386 /* Personal Path */ 386 /* Personal Path */
387 input_methods = _e_intl_imc_dir_scan(e_intl_imc_personal_path_get()); 387 input_methods = _e_intl_imc_dir_scan(e_intl_imc_personal_path_get());
388 for (l = input_methods; l; l = l->next) 388 for (l = input_methods; l; l = l->next)
389 { 389 {
@@ -418,7 +418,7 @@ e_intl_imc_personal_path_get(void)
418 if (_e_intl_imc_personal_path == NULL) 418 if (_e_intl_imc_personal_path == NULL)
419 { 419 {
420 char buf[4096]; 420 char buf[4096];
421 421
422 snprintf(buf, sizeof(buf), "%s/.e/e/input_methods", e_user_homedir_get()); 422 snprintf(buf, sizeof(buf), "%s/.e/e/input_methods", e_user_homedir_get());
423 _e_intl_imc_personal_path = evas_stringshare_add(buf); 423 _e_intl_imc_personal_path = evas_stringshare_add(buf);
424 } 424 }
@@ -431,7 +431,7 @@ e_intl_imc_system_path_get(void)
431 if (_e_intl_imc_system_path == NULL) 431 if (_e_intl_imc_system_path == NULL)
432 { 432 {
433 char buf[4096]; 433 char buf[4096];
434 434
435 snprintf(buf, sizeof(buf), "%s/data/input_methods", e_prefix_data_get()); 435 snprintf(buf, sizeof(buf), "%s/data/input_methods", e_prefix_data_get());
436 _e_intl_imc_system_path = evas_stringshare_add(buf); 436 _e_intl_imc_system_path = evas_stringshare_add(buf);
437 } 437 }
@@ -444,10 +444,10 @@ EAPI E_Input_Method_Config *
444e_intl_input_method_config_read(Eet_File *imc_file) 444e_intl_input_method_config_read(Eet_File *imc_file)
445{ 445{
446 E_Input_Method_Config *imc; 446 E_Input_Method_Config *imc;
447 447
448 imc = NULL; 448 imc = NULL;
449 if (imc_file) 449 if (imc_file)
450 { 450 {
451 imc = (E_Input_Method_Config *) eet_data_read(imc_file, _e_intl_input_method_config_edd, "imc"); 451 imc = (E_Input_Method_Config *) eet_data_read(imc_file, _e_intl_input_method_config_edd, "imc");
452 } 452 }
453 return imc; 453 return imc;
@@ -485,12 +485,12 @@ static int
485_e_intl_cb_exit(void *data, int type, void *event) 485_e_intl_cb_exit(void *data, int type, void *event)
486{ 486{
487 Ecore_Exe_Event_Del *ev; 487 Ecore_Exe_Event_Del *ev;
488 488
489 ev = event; 489 ev = event;
490 if (!ev->exe) return 1; 490 if (!ev->exe) return 1;
491 491
492 if (!(ecore_exe_tag_get(ev->exe) && 492 if (!(ecore_exe_tag_get(ev->exe) &&
493 (!strcmp(ecore_exe_tag_get(ev->exe), "E/im_exec")))) return 1; 493 (!strcmp(ecore_exe_tag_get(ev->exe), "E/im_exec")))) return 1;
494 494
495 _e_intl_input_method_exec = NULL; 495 _e_intl_input_method_exec = NULL;
496 return 1; 496 return 1;
@@ -512,15 +512,15 @@ _e_intl_locale_hash_free_cb(Evas_Hash *hash __UNUSED__, const char *key __UNUSED
512} 512}
513 513
514 514
515/* 515/*
516 * get the directory associated with the language. Language Must be valid alias 516 * get the directory associated with the language. Language Must be valid alias
517 * i.e. Already validated and already de-aliased. 517 * i.e. Already validated and already de-aliased.
518 * 518 *
519 * NULL means: 519 * NULL means:
520 * 1) The user does not have an enlightenment translation for this locale 520 * 1) The user does not have an enlightenment translation for this locale
521 * 2) The user does not have their locale.aliases configured correctly 521 * 2) The user does not have their locale.aliases configured correctly
522 * 522 *
523 * @return NULL if not found. 523 * @return NULL if not found.
524 */ 524 */
525static char * 525static char *
526_e_intl_language_path_find(char *language) 526_e_intl_language_path_find(char *language)
@@ -532,39 +532,39 @@ _e_intl_language_path_find(char *language)
532 Evas_List *next_search; 532 Evas_List *next_search;
533 int found; 533 int found;
534 534
535 search_list = _e_intl_locale_search_order_get(language); 535 search_list = _e_intl_locale_search_order_get(language);
536 536
537 if (search_list == NULL) return NULL; 537 if (search_list == NULL) return NULL;
538 538
539 directory = NULL; 539 directory = NULL;
540 found = 0; 540 found = 0;
541 dir_list = e_path_dir_list_get(path_messages); 541 dir_list = e_path_dir_list_get(path_messages);
542 542
543 /* For each directory in the path */ 543 /* For each directory in the path */
544 for (next_dir = dir_list ; next_dir && !found ; next_dir = next_dir->next) 544 for (next_dir = dir_list ; next_dir && !found ; next_dir = next_dir->next)
545 { 545 {
546 E_Path_Dir *epd; 546 E_Path_Dir *epd;
547 epd = next_dir->data; 547 epd = next_dir->data;
548 548
549 /* Match canonicalized locale against each possible search */ 549 /* Match canonicalized locale against each possible search */
550 for (next_search = search_list ; next_search && !found ; next_search = next_search->next) 550 for (next_search = search_list ; next_search && !found ; next_search = next_search->next)
551 { 551 {
552 char *search_locale; 552 char *search_locale;
553 char message_path[PATH_MAX]; 553 char message_path[PATH_MAX];
554 554
555 search_locale = next_search->data; 555 search_locale = next_search->data;
556 snprintf(message_path, sizeof(message_path), "%s/%s/LC_MESSAGES/%s.mo", epd->dir, search_locale, PACKAGE); 556 snprintf(message_path, sizeof(message_path), "%s/%s/LC_MESSAGES/%s.mo", epd->dir, search_locale, PACKAGE);
557 557
558 if (ecore_file_exists(message_path) && !ecore_file_is_dir(message_path)) 558 if (ecore_file_exists(message_path) && !ecore_file_is_dir(message_path))
559 { 559 {
560 directory = strdup(epd->dir); 560 directory = strdup(epd->dir);
561 found = 1; 561 found = 1;
562 } 562 }
563 } 563 }
564 } 564 }
565 565
566 e_path_dir_list_free(dir_list); 566 e_path_dir_list_free(dir_list);
567 567
568 while (search_list) 568 while (search_list)
569 { 569 {
570 char *data; 570 char *data;
@@ -582,20 +582,20 @@ _e_intl_language_dir_scan(const char *dir)
582 Evas_List *languages; 582 Evas_List *languages;
583 Ecore_List *files; 583 Ecore_List *files;
584 char *file; 584 char *file;
585 585
586 languages = NULL; 586 languages = NULL;
587 587
588 files = ecore_file_ls(dir); 588 files = ecore_file_ls(dir);
589 if (!files) return NULL; 589 if (!files) return NULL;
590 590
591 ecore_list_goto_first(files); 591 ecore_list_goto_first(files);
592 if (files) 592 if (files)
593 { 593 {
594 while ((file = ecore_list_next(files))) 594 while ((file = ecore_list_next(files)))
595 { 595 {
596 char file_path[PATH_MAX]; 596 char file_path[PATH_MAX];
597 597
598 snprintf(file_path, sizeof(file_path),"%s/%s/LC_MESSAGES/%s.mo", 598 snprintf(file_path, sizeof(file_path),"%s/%s/LC_MESSAGES/%s.mo",
599 dir, file, PACKAGE); 599 dir, file, PACKAGE);
600 if (ecore_file_exists(file_path) && !ecore_file_is_dir(file_path)) 600 if (ecore_file_exists(file_path) && !ecore_file_is_dir(file_path))
601 languages = evas_list_append(languages, strdup(file)); 601 languages = evas_list_append(languages, strdup(file));
@@ -606,51 +606,51 @@ _e_intl_language_dir_scan(const char *dir)
606 return languages; 606 return languages;
607} 607}
608 608
609/* get the alias for a locale 609/* get the alias for a locale
610 * 610 *
611 * return pointer to allocated alias string. never returns NULL 611 * return pointer to allocated alias string. never returns NULL
612 * String will be the same if its a valid locale already or there 612 * String will be the same if its a valid locale already or there
613 * is no alias. 613 * is no alias.
614 */ 614 */
615static char * 615static char *
616_e_intl_locale_alias_get(const char *language) 616_e_intl_locale_alias_get(const char *language)
617{ 617{
618 Evas_Hash *alias_hash; 618 Evas_Hash *alias_hash;
619 char *alias; 619 char *alias;
620 620
621 if (language == NULL || !strncmp(language, "POSIX", strlen("POSIX"))) 621 if (language == NULL || !strncmp(language, "POSIX", strlen("POSIX")))
622 return strdup("C"); 622 return strdup("C");
623 623
624 alias_hash = _e_intl_locale_alias_hash_get(); 624 alias_hash = _e_intl_locale_alias_hash_get();
625 if (alias_hash == NULL) /* No alias file available */ 625 if (alias_hash == NULL) /* No alias file available */
626 { 626 {
627 return strdup(language); 627 return strdup(language);
628 } 628 }
629 629
630 { 630 {
631 char *lower_language; 631 char *lower_language;
632 int i; 632 int i;
633 633
634 lower_language = malloc(strlen(language) + 1); 634 lower_language = malloc(strlen(language) + 1);
635 for (i = 0; i < strlen(language); i++) 635 for (i = 0; i < strlen(language); i++)
636 lower_language[i] = tolower(language[i]); 636 lower_language[i] = tolower(language[i]);
637 lower_language[i] = 0; 637 lower_language[i] = 0;
638 638
639 alias = evas_hash_find(alias_hash, lower_language); 639 alias = evas_hash_find(alias_hash, lower_language);
640 free(lower_language); 640 free(lower_language);
641 } 641 }
642 642
643 if (alias) 643 if (alias)
644 { 644 {
645 alias = strdup(alias); 645 alias = strdup(alias);
646 } 646 }
647 else 647 else
648 { 648 {
649 alias = strdup(language); 649 alias = strdup(language);
650 } 650 }
651 651
652 _e_intl_locale_hash_free(alias_hash); 652 _e_intl_locale_hash_free(alias_hash);
653 653
654 return alias; 654 return alias;
655} 655}
656 656
@@ -659,25 +659,25 @@ _e_intl_locale_alias_hash_get(void)
659{ 659{
660 Evas_List *next; 660 Evas_List *next;
661 Evas_List *dir_list; 661 Evas_List *dir_list;
662 Evas_Hash *alias_hash; 662 Evas_Hash *alias_hash;
663 663
664 dir_list = e_path_dir_list_get(path_messages); 664 dir_list = e_path_dir_list_get(path_messages);
665 alias_hash = NULL; 665 alias_hash = NULL;
666 666
667 for (next = dir_list ; next ; next = next->next) 667 for (next = dir_list ; next ; next = next->next)
668 { 668 {
669 char buf[4096]; 669 char buf[4096];
670 E_Path_Dir *epd; 670 E_Path_Dir *epd;
671 FILE *f; 671 FILE *f;
672 672
673 epd = next->data; 673 epd = next->data;
674 674
675 snprintf(buf, sizeof(buf), "%s/locale.alias", epd->dir); 675 snprintf(buf, sizeof(buf), "%s/locale.alias", epd->dir);
676 f = fopen(buf, "r"); 676 f = fopen(buf, "r");
677 if (f) 677 if (f)
678 { 678 {
679 char alias[4096], locale[4096]; 679 char alias[4096], locale[4096];
680 680
681 /* read locale alias lines */ 681 /* read locale alias lines */
682 while (fscanf(f, "%4090s %[^\n]\n", alias, locale) == 2) 682 while (fscanf(f, "%4090s %[^\n]\n", alias, locale) == 2)
683 { 683 {
@@ -688,25 +688,25 @@ _e_intl_locale_alias_hash_get(void)
688 /* skip dupes */ 688 /* skip dupes */
689 if (evas_hash_find(alias_hash, alias)) 689 if (evas_hash_find(alias_hash, alias))
690 continue; 690 continue;
691 691
692 alias_hash = evas_hash_add(alias_hash, alias, strdup(locale)); 692 alias_hash = evas_hash_add(alias_hash, alias, strdup(locale));
693 } 693 }
694 fclose (f); 694 fclose (f);
695 } 695 }
696 } 696 }
697 e_path_dir_list_free(dir_list); 697 e_path_dir_list_free(dir_list);
698 698
699 return alias_hash; 699 return alias_hash;
700} 700}
701 701
702/* return parts of the locale that are requested in the mask 702/* return parts of the locale that are requested in the mask
703 * return null if the locale looks to be invalid (Does not have 703 * return null if the locale looks to be invalid (Does not have
704 * ll_DD) 704 * ll_DD)
705 * 705 *
706 * the returned string needs to be freed 706 * the returned string needs to be freed
707 */ 707 */
708/* 708/*
709 * Not canonic, just gets the parts 709 * Not canonic, just gets the parts
710 */ 710 */
711EAPI E_Locale_Parts * 711EAPI E_Locale_Parts *
712e_intl_locale_parts_get(const char *locale) 712e_intl_locale_parts_get(const char *locale)
@@ -722,17 +722,17 @@ e_intl_locale_parts_get(const char *locale)
722 int state = 0; /* start out looking for the language */ 722 int state = 0; /* start out looking for the language */
723 int locale_idx; 723 int locale_idx;
724 int tmp_idx = 0; 724 int tmp_idx = 0;
725 725
726 /* Parse Loop - Seperators are _ . @ */ 726 /* Parse Loop - Seperators are _ . @ */
727 for ( locale_idx = 0; locale_idx < strlen(locale); locale_idx++ ) 727 for ( locale_idx = 0; locale_idx < strlen(locale); locale_idx++ )
728 { 728 {
729 char locale_char; 729 char locale_char;
730 locale_char = locale[locale_idx]; 730 locale_char = locale[locale_idx];
731 731
732 /* we have finished scanning the locale string */ 732 /* we have finished scanning the locale string */
733 if(locale_char == 0) 733 if(locale_char == 0)
734 break; 734 break;
735 735
736 /* scan this character based on the current start */ 736 /* scan this character based on the current start */
737 switch(state) 737 switch(state)
738 { 738 {
@@ -770,7 +770,7 @@ e_intl_locale_parts_get(const char *locale)
770 { 770 {
771 territory[tmp_idx++] = locale_char; 771 territory[tmp_idx++] = locale_char;
772 } 772 }
773 else 773 else
774 { 774 {
775 return NULL; 775 return NULL;
776 } 776 }
@@ -818,9 +818,9 @@ e_intl_locale_parts_get(const char *locale)
818 case 3: 818 case 3:
819 modifier[tmp_idx] = 0; 819 modifier[tmp_idx] = 0;
820 } 820 }
821 821
822 locale_parts = E_NEW(E_Locale_Parts, 1); 822 locale_parts = E_NEW(E_Locale_Parts, 1);
823 823
824 /* Put the parts of the string together */ 824 /* Put the parts of the string together */
825 if (language[0] != 0) 825 if (language[0] != 0)
826 { 826 {
@@ -831,18 +831,18 @@ e_intl_locale_parts_get(const char *locale)
831 { 831 {
832 locale_parts->mask |= E_INTL_LOC_REGION; 832 locale_parts->mask |= E_INTL_LOC_REGION;
833 locale_parts->region = evas_stringshare_add(territory); 833 locale_parts->region = evas_stringshare_add(territory);
834 } 834 }
835 if (codeset[0] != 0) 835 if (codeset[0] != 0)
836 { 836 {
837 locale_parts->mask |= E_INTL_LOC_CODESET; 837 locale_parts->mask |= E_INTL_LOC_CODESET;
838 locale_parts->codeset = evas_stringshare_add(codeset); 838 locale_parts->codeset = evas_stringshare_add(codeset);
839 } 839 }
840 if (modifier[0] != 0) 840 if (modifier[0] != 0)
841 { 841 {
842 locale_parts->mask |= E_INTL_LOC_MODIFIER; 842 locale_parts->mask |= E_INTL_LOC_MODIFIER;
843 locale_parts->modifier = evas_stringshare_add(modifier); 843 locale_parts->modifier = evas_stringshare_add(modifier);
844 } 844 }
845 845
846 return locale_parts; 846 return locale_parts;
847} 847}
848 848
@@ -866,50 +866,50 @@ e_intl_locale_parts_combine(E_Locale_Parts *locale_parts, int mask)
866 char *locale; 866 char *locale;
867 867
868 if (!locale_parts) return NULL; 868 if (!locale_parts) return NULL;
869 869
870 if ((mask & locale_parts->mask) != mask) return NULL; 870 if ((mask & locale_parts->mask) != mask) return NULL;
871 871
872 /* Construct the clean locale string */ 872 /* Construct the clean locale string */
873 locale_size = 0; 873 locale_size = 0;
874 874
875 /* determine the size */ 875 /* determine the size */
876 if (mask & E_INTL_LOC_LANG) 876 if (mask & E_INTL_LOC_LANG)
877 locale_size = strlen(locale_parts->lang) + 1; 877 locale_size = strlen(locale_parts->lang) + 1;
878 878
879 if (mask & E_INTL_LOC_REGION) 879 if (mask & E_INTL_LOC_REGION)
880 locale_size += strlen(locale_parts->region) + 1; 880 locale_size += strlen(locale_parts->region) + 1;
881 881
882 if (mask & E_INTL_LOC_CODESET) 882 if (mask & E_INTL_LOC_CODESET)
883 locale_size += strlen(locale_parts->codeset) + 1; 883 locale_size += strlen(locale_parts->codeset) + 1;
884 884
885 if (mask & E_INTL_LOC_MODIFIER) 885 if (mask & E_INTL_LOC_MODIFIER)
886 locale_size += strlen(locale_parts->modifier) + 1; 886 locale_size += strlen(locale_parts->modifier) + 1;
887 887
888 /* Allocate memory */ 888 /* Allocate memory */
889 locale = (char *) malloc(locale_size); 889 locale = (char *) malloc(locale_size);
890 locale[0] = 0; 890 locale[0] = 0;
891 891
892 if (mask & E_INTL_LOC_LANG) 892 if (mask & E_INTL_LOC_LANG)
893 { 893 {
894 strcat(locale, locale_parts->lang); 894 strcat(locale, locale_parts->lang);
895 } 895 }
896 896
897 if (mask & E_INTL_LOC_REGION) 897 if (mask & E_INTL_LOC_REGION)
898 { 898 {
899 if (locale[0] != 0) strcat(locale, "_"); 899 if (locale[0] != 0) strcat(locale, "_");
900 strcat(locale, locale_parts->region); 900 strcat(locale, locale_parts->region);
901 } 901 }
902 902
903 if (mask & E_INTL_LOC_CODESET) 903 if (mask & E_INTL_LOC_CODESET)
904 { 904 {
905 if (locale[0] != 0) strcat(locale, "."); 905 if (locale[0] != 0) strcat(locale, ".");
906 strcat(locale, locale_parts->codeset); 906 strcat(locale, locale_parts->codeset);
907 } 907 }
908 908
909 if (mask & E_INTL_LOC_MODIFIER) 909 if (mask & E_INTL_LOC_MODIFIER)
910 { 910 {
911 if (locale[0] != 0) strcat(locale, "@"); 911 if (locale[0] != 0) strcat(locale, "@");
912 strcat(locale, locale_parts->modifier); 912 strcat(locale, locale_parts->modifier);
913 } 913 }
914 914
915 return locale; 915 return locale;
@@ -921,10 +921,10 @@ e_intl_locale_charset_canonic_get(const char *charset)
921 char charset_canonic[32]; 921 char charset_canonic[32];
922 char c; 922 char c;
923 int i, i_tmp; 923 int i, i_tmp;
924 924
925 i = 0; 925 i = 0;
926 i_tmp = 0; 926 i_tmp = 0;
927 while ((c = charset[i++]) != 0) 927 while ((c = charset[i++]) != 0)
928 { 928 {
929 if (isalnum(c)) 929 if (isalnum(c))
930 { 930 {
@@ -937,7 +937,7 @@ e_intl_locale_charset_canonic_get(const char *charset)
937 { 937 {
938 return NULL; 938 return NULL;
939 } 939 }
940 940
941 return strdup(charset_canonic); 941 return strdup(charset_canonic);
942} 942}
943 943
@@ -949,14 +949,14 @@ _e_intl_locale_system_locales_get(void)
949 949
950 locales = NULL; 950 locales = NULL;
951 output = popen("locale -a", "r"); 951 output = popen("locale -a", "r");
952 if ( output ) 952 if ( output )
953 { 953 {
954 char line[32]; 954 char line[32];
955 while ( fscanf(output, "%[^\n]\n", line) == 1) 955 while ( fscanf(output, "%[^\n]\n", line) == 1)
956 { 956 {
957 locales = evas_list_append(locales, strdup(line)); 957 locales = evas_list_append(locales, strdup(line));
958 } 958 }
959 959
960 pclose(output); 960 pclose(output);
961 } 961 }
962 return locales; 962 return locales;
@@ -969,33 +969,33 @@ static int
969_e_intl_locale_validate(const char *locale) 969_e_intl_locale_validate(const char *locale)
970{ 970{
971 Evas_List *all_locales; 971 Evas_List *all_locales;
972 E_Locale_Parts *locale_parts; 972 E_Locale_Parts *locale_parts;
973 char *locale_lr; 973 char *locale_lr;
974 char *locale_cs_canonic; 974 char *locale_cs_canonic;
975 int found; 975 int found;
976 976
977 found = 0; 977 found = 0;
978 978
979 locale_parts = e_intl_locale_parts_get(locale); 979 locale_parts = e_intl_locale_parts_get(locale);
980 980
981 /* Gather the search information */ 981 /* Gather the search information */
982 locale_lr = e_intl_locale_parts_combine(locale_parts, E_INTL_LOC_LANG | E_INTL_LOC_REGION); 982 locale_lr = e_intl_locale_parts_combine(locale_parts, E_INTL_LOC_LANG | E_INTL_LOC_REGION);
983 983
984 if ( locale_lr == NULL ) 984 if ( locale_lr == NULL )
985 { 985 {
986 /* Not valid locale, maybe its an alias */ 986 /* Not valid locale, maybe its an alias */
987 locale_lr = strdup(locale); 987 locale_lr = strdup(locale);
988 locale_cs_canonic = NULL; 988 locale_cs_canonic = NULL;
989 } 989 }
990 else 990 else
991 { 991 {
992 if ( locale_parts && locale_parts->codeset ) 992 if ( locale_parts && locale_parts->codeset )
993 locale_cs_canonic = e_intl_locale_charset_canonic_get(locale_parts->codeset); 993 locale_cs_canonic = e_intl_locale_charset_canonic_get(locale_parts->codeset);
994 else 994 else
995 locale_cs_canonic = NULL; 995 locale_cs_canonic = NULL;
996 } 996 }
997 997
998 /* Get list of all available locales and aliases */ 998 /* Get list of all available locales and aliases */
999 all_locales = _e_intl_locale_system_locales_get(); 999 all_locales = _e_intl_locale_system_locales_get();
1000 1000
1001 /* Match locale with one from the list */ 1001 /* Match locale with one from the list */
@@ -1007,20 +1007,20 @@ _e_intl_locale_validate(const char *locale)
1007 if (found == 0) 1007 if (found == 0)
1008 { 1008 {
1009 E_Locale_Parts *locale_parts_next; 1009 E_Locale_Parts *locale_parts_next;
1010 char * locale_lr_next; 1010 char * locale_lr_next;
1011 1011
1012 locale_parts_next = e_intl_locale_parts_get(locale_next); 1012 locale_parts_next = e_intl_locale_parts_get(locale_next);
1013 locale_lr_next = e_intl_locale_parts_combine(locale_parts_next, 1013 locale_lr_next = e_intl_locale_parts_combine(locale_parts_next,
1014 E_INTL_LOC_LANG | E_INTL_LOC_REGION); 1014 E_INTL_LOC_LANG | E_INTL_LOC_REGION);
1015 1015
1016 if (locale_parts && locale_lr_next && !strcmp(locale_lr, locale_lr_next)) 1016 if (locale_parts && locale_lr_next && !strcmp(locale_lr, locale_lr_next))
1017 { 1017 {
1018 /* Matched lang/region part, now if CS matches */ 1018 /* Matched lang/region part, now if CS matches */
1019 if ((locale_parts->codeset == NULL) && (locale_parts_next->codeset == NULL)) 1019 if ((locale_parts->codeset == NULL) && (locale_parts_next->codeset == NULL))
1020 { 1020 {
1021 /* Lang/Region parts match and no charsets, 1021 /* Lang/Region parts match and no charsets,
1022 * we have a match 1022 * we have a match
1023 */ 1023 */
1024 found = 1; 1024 found = 1;
1025 } 1025 }
1026 else if (locale_parts->codeset && locale_parts_next->codeset) 1026 else if (locale_parts->codeset && locale_parts_next->codeset)
@@ -1030,20 +1030,20 @@ _e_intl_locale_validate(const char *locale)
1030 /* Lang/Region and charsets match */ 1030 /* Lang/Region and charsets match */
1031 found = 1; 1031 found = 1;
1032 } 1032 }
1033 else if (locale_cs_canonic) 1033 else if (locale_cs_canonic)
1034 { 1034 {
1035 char *locale_cs_canonic_next; 1035 char *locale_cs_canonic_next;
1036 /* try to match charsets in canonic form */ 1036 /* try to match charsets in canonic form */
1037 1037
1038 locale_cs_canonic_next = 1038 locale_cs_canonic_next =
1039 e_intl_locale_charset_canonic_get(locale_parts_next->codeset); 1039 e_intl_locale_charset_canonic_get(locale_parts_next->codeset);
1040 1040
1041 if (locale_cs_canonic_next) 1041 if (locale_cs_canonic_next)
1042 { 1042 {
1043 if (!strcmp(locale_cs_canonic, locale_cs_canonic_next)) 1043 if (!strcmp(locale_cs_canonic, locale_cs_canonic_next))
1044 { 1044 {
1045 /* Lang/Resion and charsets in canonic 1045 /* Lang/Resion and charsets in canonic
1046 * form match 1046 * form match
1047 */ 1047 */
1048 found = 1; 1048 found = 1;
1049 } 1049 }
@@ -1053,8 +1053,8 @@ _e_intl_locale_validate(const char *locale)
1053 { 1053 {
1054 if (!strcmp(locale_cs_canonic, locale_parts_next->codeset)) 1054 if (!strcmp(locale_cs_canonic, locale_parts_next->codeset))
1055 { 1055 {
1056 /* Lang/Resion and charsets in canonic 1056 /* Lang/Resion and charsets in canonic
1057 * form match 1057 * form match
1058 */ 1058 */
1059 found = 1; 1059 found = 1;
1060 } 1060 }
@@ -1070,17 +1070,17 @@ _e_intl_locale_validate(const char *locale)
1070 e_intl_locale_parts_free(locale_parts_next); 1070 e_intl_locale_parts_free(locale_parts_next);
1071 E_FREE(locale_lr_next); 1071 E_FREE(locale_lr_next);
1072 } 1072 }
1073 1073
1074 all_locales = evas_list_remove_list(all_locales, all_locales); 1074 all_locales = evas_list_remove_list(all_locales, all_locales);
1075 free(locale_next); 1075 free(locale_next);
1076 } 1076 }
1077 e_intl_locale_parts_free(locale_parts); 1077 e_intl_locale_parts_free(locale_parts);
1078 free(locale_lr); 1078 free(locale_lr);
1079 E_FREE(locale_cs_canonic); 1079 E_FREE(locale_cs_canonic);
1080 return found; 1080 return found;
1081} 1081}
1082 1082
1083/* 1083/*
1084 * arg local must be an already validated and unaliased locale 1084 * arg local must be an already validated and unaliased locale
1085 * returns the locale search order e.g. 1085 * returns the locale search order e.g.
1086 * en_US.UTF-8 -> 1086 * en_US.UTF-8 ->
@@ -1096,10 +1096,10 @@ _e_intl_locale_search_order_get(const char *locale)
1096 E_Locale_Parts *locale_parts; 1096 E_Locale_Parts *locale_parts;
1097 char *masked_locale; 1097 char *masked_locale;
1098 int mask; 1098 int mask;
1099 1099
1100 locale_parts = e_intl_locale_parts_get(locale); 1100 locale_parts = e_intl_locale_parts_get(locale);
1101 if (locale_parts == NULL) return NULL; 1101 if (locale_parts == NULL) return NULL;
1102 1102
1103 search_list = NULL; 1103 search_list = NULL;
1104 for ( mask = E_INTL_LOC_ALL; mask >= E_INTL_LOC_LANG; mask-- ) 1104 for ( mask = E_INTL_LOC_ALL; mask >= E_INTL_LOC_LANG; mask-- )
1105 { 1105 {
@@ -1109,23 +1109,23 @@ _e_intl_locale_search_order_get(const char *locale)
1109 masked_locale = e_intl_locale_parts_combine(locale_parts, mask); 1109 masked_locale = e_intl_locale_parts_combine(locale_parts, mask);
1110 search_list = evas_list_append(search_list, masked_locale); 1110 search_list = evas_list_append(search_list, masked_locale);
1111 } 1111 }
1112 } 1112 }
1113 e_intl_locale_parts_free(locale_parts); 1113 e_intl_locale_parts_free(locale_parts);
1114 return search_list; 1114 return search_list;
1115} 1115}
1116 1116
1117static Evas_List * 1117static Evas_List *
1118_e_intl_imc_dir_scan(const char *dir) 1118_e_intl_imc_dir_scan(const char *dir)
1119{ 1119{
1120 Evas_List *imcs; 1120 Evas_List *imcs;
1121 Ecore_List *files; 1121 Ecore_List *files;
1122 char *file; 1122 char *file;
1123 1123
1124 imcs = NULL; 1124 imcs = NULL;
1125 1125
1126 files = ecore_file_ls(dir); 1126 files = ecore_file_ls(dir);
1127 if (!files) return NULL; 1127 if (!files) return NULL;
1128 1128
1129 ecore_list_goto_first(files); 1129 ecore_list_goto_first(files);
1130 if (files) 1130 if (files)
1131 { 1131 {
@@ -1133,9 +1133,9 @@ _e_intl_imc_dir_scan(const char *dir)
1133 { 1133 {
1134 if (strstr(file, ".imc") != NULL) 1134 if (strstr(file, ".imc") != NULL)
1135 { 1135 {
1136 char buf[PATH_MAX]; 1136 char buf[PATH_MAX];
1137 1137
1138 snprintf(buf, sizeof(buf), "%s/%s", dir, file); 1138 snprintf(buf, sizeof(buf), "%s/%s", dir, file);
1139 imcs = evas_list_append(imcs, strdup(buf)); 1139 imcs = evas_list_append(imcs, strdup(buf));
1140 } 1140 }
1141 } 1141 }
diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c
index 38151be..87ee117 100644
--- a/src/bin/e_sys.c
+++ b/src/bin/e_sys.c
@@ -88,7 +88,7 @@ EAPI int
88e_sys_action_do(E_Sys_Action a, char *param) 88e_sys_action_do(E_Sys_Action a, char *param)
89{ 89{
90 int ret; 90 int ret;
91 91
92 if (_e_sys_action_current != E_SYS_NONE) 92 if (_e_sys_action_current != E_SYS_NONE)
93 { 93 {
94 _e_sys_current_action(); 94 _e_sys_current_action();
@@ -124,7 +124,7 @@ _e_sys_cb_timer(void *data)
124 * things 124 * things
125 */ 125 */
126 char buf[4096]; 126 char buf[4096];
127 127
128 snprintf(buf, sizeof(buf), "%s/enlightenment_sys -t halt", e_prefix_bin_get()); 128 snprintf(buf, sizeof(buf), "%s/enlightenment_sys -t halt", e_prefix_bin_get());
129 _e_sys_halt_check_exe = ecore_exe_run(buf, NULL); 129 _e_sys_halt_check_exe = ecore_exe_run(buf, NULL);
130 snprintf(buf, sizeof(buf), "%s/enlightenment_sys -t reboot", e_prefix_bin_get()); 130 snprintf(buf, sizeof(buf), "%s/enlightenment_sys -t reboot", e_prefix_bin_get());
@@ -242,11 +242,11 @@ _e_sys_cb_logout_timer(void *data)
242{ 242{
243 Evas_List *l; 243 Evas_List *l;
244 int pending = 0; 244 int pending = 0;
245 245
246 for (l = e_border_client_list(); l; l = l->next) 246 for (l = e_border_client_list(); l; l = l->next)
247 { 247 {
248 E_Border *bd; 248 E_Border *bd;
249 249
250 bd = l->data; 250 bd = l->data;
251 if (!bd->internal) pending++; 251 if (!bd->internal) pending++;
252 } 252 }
@@ -259,13 +259,13 @@ _e_sys_cb_logout_timer(void *data)
259 if ((ecore_time_get() - _e_sys_logout_begin_time) > 15.0) 259 if ((ecore_time_get() - _e_sys_logout_begin_time) > 15.0)
260 { 260 {
261 E_Dialog *dia; 261 E_Dialog *dia;
262 262
263 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_logout_slow"); 263 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_logout_slow");
264 if (dia) 264 if (dia)
265 { 265 {
266 e_dialog_title_set(dia, _("Logout problems")); 266 e_dialog_title_set(dia, _("Logout problems"));
267 e_dialog_icon_set(dia, "enlightenment/logout", 64); 267 e_dialog_icon_set(dia, "enlightenment/logout", 64);
268 e_dialog_text_set(dia, 268 e_dialog_text_set(dia,
269 _("Logout is taking too long. Some<br>" 269 _("Logout is taking too long. Some<br>"
270 "applications refuse to close.<br>" 270 "applications refuse to close.<br>"
271 "Do you want to finish the logout<br>" 271 "Do you want to finish the logout<br>"
@@ -309,9 +309,9 @@ _e_sys_logout_begin(E_Sys_Action a_after)
309{ 309{
310 Evas_List *l; 310 Evas_List *l;
311 E_Obj_Dialog *od; 311 E_Obj_Dialog *od;
312 312
313 /* start logout - at end do the a_after action */ 313 /* start logout - at end do the a_after action */
314 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), 314 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
315 _("Logout in progress"), "E", "_sys_logout"); 315 _("Logout in progress"), "E", "_sys_logout");
316 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/logout"); 316 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/logout");
317 e_obj_dialog_obj_part_text_set(od, "e.textblock.message", 317 e_obj_dialog_obj_part_text_set(od, "e.textblock.message",
@@ -325,7 +325,7 @@ _e_sys_logout_begin(E_Sys_Action a_after)
325 for (l = e_border_client_list(); l; l = l->next) 325 for (l = e_border_client_list(); l; l = l->next)
326 { 326 {
327 E_Border *bd; 327 E_Border *bd;
328 328
329 bd = l->data; 329 bd = l->data;
330 e_border_act_close_begin(bd); 330 e_border_act_close_begin(bd);
331 } 331 }
@@ -343,48 +343,48 @@ _e_sys_current_action(void)
343 343
344 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_action_busy"); 344 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_action_busy");
345 if (!dia) return; 345 if (!dia) return;
346 346
347 e_dialog_title_set(dia, _("Enlightenment is busy with another request")); 347 e_dialog_title_set(dia, _("Enlightenment is busy with another request"));
348 e_dialog_icon_set(dia, "enlightenment/sys", 64); 348 e_dialog_icon_set(dia, "enlightenment/sys", 64);
349 switch (_e_sys_action_current) 349 switch (_e_sys_action_current)
350 { 350 {
351 case E_SYS_LOGOUT: 351 case E_SYS_LOGOUT:
352 e_dialog_text_set(dia, 352 e_dialog_text_set(dia,
353 _("Enlightenment is busy logging out.<br>" 353 _("Enlightenment is busy logging out.<br>"
354 "You cannot perform other system actions<br>" 354 "You cannot perform other system actions<br>"
355 "once a logout has begun.") 355 "once a logout has begun.")
356 ); 356 );
357 break; 357 break;
358 case E_SYS_HALT: 358 case E_SYS_HALT:
359 e_dialog_text_set(dia, 359 e_dialog_text_set(dia,
360 _("Enlightenment is shutting the system down.<br>" 360 _("Enlightenment is shutting the system down.<br>"
361 "You cannot do any other system actions<br>" 361 "You cannot do any other system actions<br>"
362 "once a shutdown has been started.") 362 "once a shutdown has been started.")
363 ); 363 );
364 break; 364 break;
365 case E_SYS_REBOOT: 365 case E_SYS_REBOOT:
366 e_dialog_text_set(dia, 366 e_dialog_text_set(dia,
367 _("Enlightenment is rebooting the system.<br>" 367 _("Enlightenment is rebooting the system.<br>"
368 "You cannot do any other system actions<br>" 368 "You cannot do any other system actions<br>"
369 "once a reboot has begun.") 369 "once a reboot has begun.")
370 ); 370 );
371 break; 371 break;
372 case E_SYS_SUSPEND: 372 case E_SYS_SUSPEND:
373 e_dialog_text_set(dia, 373 e_dialog_text_set(dia,
374 _("Enlightenment is suspending the system.<br>" 374 _("Enlightenment is suspending the system.<br>"
375 "Until suspend is complete you cannot perform<br>" 375 "Until suspend is complete you cannot perform<br>"
376 "any other system actions.") 376 "any other system actions.")
377 ); 377 );
378 break; 378 break;
379 case E_SYS_HIBERNATE: 379 case E_SYS_HIBERNATE:
380 e_dialog_text_set(dia, 380 e_dialog_text_set(dia,
381 _("Enlightenment is hibernating the system.<br>" 381 _("Enlightenment is hibernating the system.<br>"
382 "You cannot perform an other system actions<br>" 382 "You cannot perform an other system actions<br>"
383 "until this is complete.") 383 "until this is complete.")
384 ); 384 );
385 break; 385 break;
386 default: 386 default:
387 e_dialog_text_set(dia, 387 e_dialog_text_set(dia,
388 _("EEK! This should not happen") 388 _("EEK! This should not happen")
389 ); 389 );
390 break; 390 break;
@@ -403,33 +403,33 @@ _e_sys_action_failed(void)
403 403
404 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_action_failed"); 404 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_action_failed");
405 if (!dia) return; 405 if (!dia) return;
406 406
407 e_dialog_title_set(dia, _("Enlightenment is busy with another request")); 407 e_dialog_title_set(dia, _("Enlightenment is busy with another request"));
408 e_dialog_icon_set(dia, "enlightenment/sys", 64); 408 e_dialog_icon_set(dia, "enlightenment/sys", 64);
409 switch (_e_sys_action_current) 409 switch (_e_sys_action_current)
410 { 410 {
411 case E_SYS_HALT: 411 case E_SYS_HALT:
412 e_dialog_text_set(dia, 412 e_dialog_text_set(dia,
413 _("Shutting down of your system failed.") 413 _("Shutting down of your system failed.")
414 ); 414 );
415 break; 415 break;
416 case E_SYS_REBOOT: 416 case E_SYS_REBOOT:
417 e_dialog_text_set(dia, 417 e_dialog_text_set(dia,
418 _("Rebooting your system failed.") 418 _("Rebooting your system failed.")
419 ); 419 );
420 break; 420 break;
421 case E_SYS_SUSPEND: 421 case E_SYS_SUSPEND:
422 e_dialog_text_set(dia, 422 e_dialog_text_set(dia,
423 _("Suspend of your system failed.") 423 _("Suspend of your system failed.")
424 ); 424 );
425 break; 425 break;
426 case E_SYS_HIBERNATE: 426 case E_SYS_HIBERNATE:
427 e_dialog_text_set(dia, 427 e_dialog_text_set(dia,
428 _("Hibernating your system failed.") 428 _("Hibernating your system failed.")
429 ); 429 );
430 break; 430 break;
431 default: 431 default:
432 e_dialog_text_set(dia, 432 e_dialog_text_set(dia,
433 _("EEK! This should not happen") 433 _("EEK! This should not happen")
434 ); 434 );
435 break; 435 break;
@@ -445,7 +445,7 @@ _e_sys_action_do(E_Sys_Action a, char *param)
445{ 445{
446 char buf[4096]; 446 char buf[4096];
447 E_Obj_Dialog *od; 447 E_Obj_Dialog *od;
448 448
449 switch (a) 449 switch (a)
450 { 450 {
451 case E_SYS_EXIT: 451 case E_SYS_EXIT:
@@ -474,7 +474,7 @@ _e_sys_action_do(E_Sys_Action a, char *param)
474 else 474 else
475 { 475 {
476 _e_sys_exe = ecore_exe_run(buf, NULL); 476 _e_sys_exe = ecore_exe_run(buf, NULL);
477 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), 477 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
478 _("Shutting down"), "E", "_sys_halt"); 478 _("Shutting down"), "E", "_sys_halt");
479 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/halt"); 479 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/halt");
480 e_obj_dialog_obj_part_text_set(od, "e.textblock.message", 480 e_obj_dialog_obj_part_text_set(od, "e.textblock.message",
@@ -501,7 +501,7 @@ _e_sys_action_do(E_Sys_Action a, char *param)
501 else 501 else
502 { 502 {
503 _e_sys_exe = ecore_exe_run(buf, NULL); 503 _e_sys_exe = ecore_exe_run(buf, NULL);
504 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), 504 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
505 _("Rebooting"), "E", "_sys_reboot"); 505 _("Rebooting"), "E", "_sys_reboot");
506 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/reboot"); 506 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/reboot");
507 e_obj_dialog_obj_part_text_set(od, "e.textblock.message", 507 e_obj_dialog_obj_part_text_set(od, "e.textblock.message",
@@ -527,7 +527,7 @@ _e_sys_action_do(E_Sys_Action a, char *param)
527 else 527 else
528 { 528 {
529 _e_sys_exe = ecore_exe_run(buf, NULL); 529 _e_sys_exe = ecore_exe_run(buf, NULL);
530 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), 530 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
531 _("Suspending"), "E", "_sys_suspend"); 531 _("Suspending"), "E", "_sys_suspend");
532 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/suspend"); 532 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/suspend");
533 e_obj_dialog_obj_part_text_set(od, "e.textblock.message", 533 e_obj_dialog_obj_part_text_set(od, "e.textblock.message",
@@ -553,7 +553,7 @@ _e_sys_action_do(E_Sys_Action a, char *param)
553 else 553 else
554 { 554 {
555 _e_sys_exe = ecore_exe_run(buf, NULL); 555 _e_sys_exe = ecore_exe_run(buf, NULL);
556 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), 556 od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
557 _("Hibernating"), "E", "_sys_hibernate"); 557 _("Hibernating"), "E", "_sys_hibernate");
558 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/hibernate"); 558 e_obj_dialog_obj_theme_set(od, "base/theme/sys", "e/sys/hibernate");
559 e_obj_dialog_obj_part_text_set(od, "e.textblock.message", 559 e_obj_dialog_obj_part_text_set(od, "e.textblock.message",
diff --git a/src/bin/e_thumb.c b/src/bin/e_thumb.c
index 7e98fa7..a553dcd 100644
--- a/src/bin/e_thumb.c
+++ b/src/bin/e_thumb.c
@@ -93,7 +93,7 @@ EAPI void
93e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key) 93e_thumb_icon_file_set(Evas_Object *obj, const char *file, const char *key)
94{ 94{
95 E_Thumb *eth; 95 E_Thumb *eth;
96 96
97 eth = evas_object_data_get(obj, "e_thumbdata"); 97 eth = evas_object_data_get(obj, "e_thumbdata");
98 if (!eth) return; 98 if (!eth) return;
99 if (eth->file) evas_stringshare_del(eth->file); 99 if (eth->file) evas_stringshare_del(eth->file);
@@ -108,7 +108,7 @@ EAPI void
108e_thumb_icon_size_set(Evas_Object *obj, int w, int h) 108e_thumb_icon_size_set(Evas_Object *obj, int w, int h)
109{ 109{
110 E_Thumb *eth; 110 E_Thumb *eth;
111 111
112 eth = evas_object_data_get(obj, "e_thumbdata"); 112 eth = evas_object_data_get(obj, "e_thumbdata");
113 if (!eth) return; 113 if (!eth) return;
114 if ((w < 1) || (h <1)) return; 114 if ((w < 1) || (h <1)) return;
@@ -121,7 +121,7 @@ e_thumb_icon_begin(Evas_Object *obj)
121{ 121{
122 E_Thumb *eth, *eth2; 122 E_Thumb *eth, *eth2;
123 char buf[4096]; 123 char buf[4096];
124 124
125 eth = evas_object_data_get(obj, "e_thumbdata"); 125 eth = evas_object_data_get(obj, "e_thumbdata");
126 if (!eth) return; 126 if (!eth) return;
127 if (eth->queued) return; 127 if (eth->queued) return;
@@ -133,7 +133,7 @@ e_thumb_icon_begin(Evas_Object *obj)
133 while (evas_list_count(_thumbnailers_exe) < _num_thumbnailers) 133 while (evas_list_count(_thumbnailers_exe) < _num_thumbnailers)
134 { 134 {
135 Ecore_Exe *exe; 135 Ecore_Exe *exe;
136 136
137 snprintf(buf, sizeof(buf), "%s/enlightenment_thumb", e_prefix_bin_get()); 137 snprintf(buf, sizeof(buf), "%s/enlightenment_thumb", e_prefix_bin_get());
138 exe = ecore_exe_run(buf, NULL); 138 exe = ecore_exe_run(buf, NULL);
139 _thumbnailers_exe = evas_list_append(_thumbnailers_exe, exe); 139 _thumbnailers_exe = evas_list_append(_thumbnailers_exe, exe);
@@ -162,7 +162,7 @@ EAPI void
162e_thumb_icon_end(Evas_Object *obj) 162e_thumb_icon_end(Evas_Object *obj)
163{ 163{
164 E_Thumb *eth; 164 E_Thumb *eth;
165 165
166 eth = evas_object_data_get(obj, "e_thumbdata"); 166 eth = evas_object_data_get(obj, "e_thumbdata");
167 if (!eth) return; 167 if (!eth) return;
168 if (eth->queued) 168 if (eth->queued)
@@ -200,7 +200,7 @@ e_thumb_client_data(Ecore_Ipc_Event_Client_Data *e)
200 char *icon; 200 char *icon;
201 E_Thumb *eth; 201 E_Thumb *eth;
202 Evas_Object *obj; 202 Evas_Object *obj;
203 203
204 if (!evas_list_find(_thumbnailers, e->client)) 204 if (!evas_list_find(_thumbnailers, e->client))
205 _thumbnailers = evas_list_prepend(_thumbnailers, e->client); 205 _thumbnailers = evas_list_prepend(_thumbnailers, e->client);
206 if (e->minor == 2) 206 if (e->minor == 2)
@@ -277,7 +277,7 @@ _e_thumb_gen_end(int objid)
277{ 277{
278 Evas_List *l; 278 Evas_List *l;
279 Ecore_Ipc_Client *cli; 279 Ecore_Ipc_Client *cli;
280 280
281 /* send thumb cancel */ 281 /* send thumb cancel */
282 for (l = _thumbnailers; l; l = l->next) 282 for (l = _thumbnailers; l; l = l->next)
283 { 283 {
@@ -290,7 +290,7 @@ static void
290_e_thumb_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info) 290_e_thumb_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
291{ 291{
292 E_Thumb *eth; 292 E_Thumb *eth;
293 293
294 eth = evas_object_data_get(obj, "e_thumbdata"); 294 eth = evas_object_data_get(obj, "e_thumbdata");
295 if (!eth) return; 295 if (!eth) return;
296 evas_object_data_del(obj, "e_thumbdata"); 296 evas_object_data_del(obj, "e_thumbdata");
@@ -313,7 +313,7 @@ static void
313_e_thumb_hash_add(int objid, Evas_Object *obj) 313_e_thumb_hash_add(int objid, Evas_Object *obj)
314{ 314{
315 char buf[32]; 315 char buf[32];
316 316
317 snprintf(buf, sizeof(buf), "%i", objid); 317 snprintf(buf, sizeof(buf), "%i", objid);
318 _thumbs = evas_hash_add(_thumbs, buf, obj); 318 _thumbs = evas_hash_add(_thumbs, buf, obj);
319} 319}
@@ -322,7 +322,7 @@ static void
322_e_thumb_hash_del(int objid) 322_e_thumb_hash_del(int objid)
323{ 323{
324 char buf[32]; 324 char buf[32];
325 325
326 snprintf(buf, sizeof(buf), "%i", objid); 326 snprintf(buf, sizeof(buf), "%i", objid);
327 _thumbs = evas_hash_del(_thumbs, buf, NULL); 327 _thumbs = evas_hash_del(_thumbs, buf, NULL);
328 if ((!_thumbs) && (!_thumbnailers)) _objid = 0; 328 if ((!_thumbs) && (!_thumbnailers)) _objid = 0;
@@ -332,7 +332,7 @@ static Evas_Object *
332_e_thumb_hash_find(int objid) 332_e_thumb_hash_find(int objid)
333{ 333{
334 char buf[32]; 334 char buf[32];
335 335
336 snprintf(buf, sizeof(buf), "%i", objid); 336 snprintf(buf, sizeof(buf), "%i", objid);
337 return evas_hash_find(_thumbs, buf); 337 return evas_hash_find(_thumbs, buf);
338} 338}
@@ -355,7 +355,7 @@ static int
355_e_thumb_cb_kill(void *data) 355_e_thumb_cb_kill(void *data)
356{ 356{
357 Evas_List *l; 357 Evas_List *l;
358 358
359 for (l = _thumbnailers_exe; l; l = l->next) 359 for (l = _thumbnailers_exe; l; l = l->next)
360 ecore_exe_terminate(l->data); 360 ecore_exe_terminate(l->data);
361 _kill_timer = NULL; 361 _kill_timer = NULL;
@@ -367,7 +367,7 @@ _e_thumb_cb_exe_event_del(void *data, int type, void *event)
367{ 367{
368 Ecore_Exe_Event_Del *ev; 368 Ecore_Exe_Event_Del *ev;
369 Evas_List *l; 369 Evas_List *l;
370 370
371 ev = event; 371 ev = event;
372 for (l = _thumbnailers_exe; l; l = l->next) 372 for (l = _thumbnailers_exe; l; l = l->next)
373 { 373 {
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index 209a59a..427a33e 100644
--- a/src/bin/e_utils.c
+++ b/src/bin/e_utils.c
@@ -38,7 +38,7 @@ e_util_container_fake_mouse_up_later(E_Container *con, int button)
38{ 38{
39 E_OBJECT_CHECK(con); 39 E_OBJECT_CHECK(con);
40 E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE); 40 E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
41 41
42 e_util_evas_fake_mouse_up_later(con->bg_evas, button); 42 e_util_evas_fake_mouse_up_later(con->bg_evas, button);
43} 43}
44 44
@@ -47,7 +47,7 @@ e_util_container_fake_mouse_up_all_later(E_Container *con)
47{ 47{
48 E_OBJECT_CHECK(con); 48 E_OBJECT_CHECK(con);
49 E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE); 49 E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
50 50
51 e_util_container_fake_mouse_up_later(con, 1); 51 e_util_container_fake_mouse_up_later(con, 1);
52 e_util_container_fake_mouse_up_later(con, 2); 52 e_util_container_fake_mouse_up_later(con, 2);
53 e_util_container_fake_mouse_up_later(con, 3); 53 e_util_container_fake_mouse_up_later(con, 3);
@@ -57,7 +57,7 @@ EAPI void
57e_util_evas_fake_mouse_up_later(Evas *e, int button) 57e_util_evas_fake_mouse_up_later(Evas *e, int button)
58{ 58{
59 E_Util_Fake_Mouse_Up_Info *info; 59 E_Util_Fake_Mouse_Up_Info *info;
60 60
61 info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info)); 61 info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info));
62 if (info) 62 if (info)
63 { 63 {
@@ -79,25 +79,25 @@ e_util_env_set(const char *var, const char *val)
79{ 79{
80 if (val) 80 if (val)
81 { 81 {
82#ifdef HAVE_SETENV 82#ifdef HAVE_SETENV
83 setenv(var, val, 1); 83 setenv(var, val, 1);
84#else 84#else
85 char buf[8192]; 85 char buf[8192];
86 86
87 snprintf(buf, sizeof(buf), "%s=%s", var, val); 87 snprintf(buf, sizeof(buf), "%s=%s", var, val);
88 if (getenv(var)) 88 if (getenv(var))
89 putenv(buf); 89 putenv(buf);
90 else 90 else
91 putenv(strdup(buf)); 91 putenv(strdup(buf));
92#endif 92#endif
93 } 93 }
94 else 94 else
95 { 95 {
96#ifdef HAVE_UNSETENV 96#ifdef HAVE_UNSETENV
97 unsetenv(var); 97 unsetenv(var);
98#else 98#else
99 if (getenv(var)) putenv(var); 99 if (getenv(var)) putenv(var);
100#endif 100#endif
101 } 101 }
102} 102}
103 103
@@ -105,14 +105,14 @@ EAPI E_Zone *
105e_util_zone_current_get(E_Manager *man) 105e_util_zone_current_get(E_Manager *man)
106{ 106{
107 E_Container *con; 107 E_Container *con;
108 108
109 E_OBJECT_CHECK_RETURN(man, NULL); 109 E_OBJECT_CHECK_RETURN(man, NULL);
110 E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL); 110 E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
111 con = e_container_current_get(man); 111 con = e_container_current_get(man);
112 if (con) 112 if (con)
113 { 113 {
114 E_Zone *zone; 114 E_Zone *zone;
115 115
116 zone = e_zone_current_get(con); 116 zone = e_zone_current_get(con);
117 return zone; 117 return zone;
118 } 118 }
@@ -126,7 +126,7 @@ e_util_utils_installed(void)
126} 126}
127 127
128EAPI int 128EAPI int
129e_util_app_installed(char *app) 129e_util_app_installed(char *app)
130{ 130{
131 return ecore_file_app_installed(app); 131 return ecore_file_app_installed(app);
132} 132}
@@ -151,7 +151,7 @@ e_util_glob_case_match(const char *str, const char *glob)
151{ 151{
152 const char *p; 152 const char *p;
153 char *tstr, *tglob, *tp; 153 char *tstr, *tglob, *tp;
154 154
155 if (glob[0] == 0) 155 if (glob[0] == 0)
156 { 156 {
157 if (str[0] == 0) return 1; 157 if (str[0] == 0) return 1;
@@ -172,12 +172,12 @@ EAPI E_Container *
172e_util_container_number_get(int num) 172e_util_container_number_get(int num)
173{ 173{
174 Evas_List *l; 174 Evas_List *l;
175 175
176 for (l = e_manager_list(); l; l = l->next) 176 for (l = e_manager_list(); l; l = l->next)
177 { 177 {
178 E_Manager *man; 178 E_Manager *man;
179 E_Container *con; 179 E_Container *con;
180 180
181 man = l->data; 181 man = l->data;
182 con = e_container_number_get(man, num); 182 con = e_container_number_get(man, num);
183 if (con) return con; 183 if (con) return con;
@@ -189,7 +189,7 @@ EAPI E_Zone *
189e_util_container_zone_number_get(int con_num, int zone_num) 189e_util_container_zone_number_get(int con_num, int zone_num)
190{ 190{
191 E_Container *con; 191 E_Container *con;
192 192
193 con = e_util_container_number_get(con_num); 193 con = e_util_container_number_get(con_num);
194 if (!con) return NULL; 194 if (!con) return NULL;
195 return e_container_zone_number_get(con, zone_num); 195 return e_container_zone_number_get(con, zone_num);
@@ -203,7 +203,7 @@ e_util_head_exec(int head, const char *cmd)
203 char buf[4096], buf2[32]; 203 char buf[4096], buf2[32];
204 int ok = 0; 204 int ok = 0;
205 Ecore_Exe *exe; 205 Ecore_Exe *exe;
206 206
207 penv_display = getenv("DISPLAY"); 207 penv_display = getenv("DISPLAY");
208 if (penv_display) penv_display = strdup(penv_display); 208 if (penv_display) penv_display = strdup(penv_display);
209 /* set env vars */ 209 /* set env vars */
@@ -227,7 +227,7 @@ e_util_head_exec(int head, const char *cmd)
227 } 227 }
228 else 228 else
229 strcpy(buf, penv_display); 229 strcpy(buf, penv_display);
230 230
231 ok = 1; 231 ok = 1;
232 e_util_library_path_strip(); 232 e_util_library_path_strip();
233 exe = ecore_exe_run(cmd, NULL); 233 exe = ecore_exe_run(cmd, NULL);
@@ -241,7 +241,7 @@ e_util_head_exec(int head, const char *cmd)
241 cmd); 241 cmd);
242 ok = 0; 242 ok = 0;
243 } 243 }
244 244
245 /* reset env vars */ 245 /* reset env vars */
246 if (penv_display) 246 if (penv_display)
247 { 247 {
@@ -263,7 +263,7 @@ EAPI int
263e_util_both_str_empty(const char *s1, const char *s2) 263e_util_both_str_empty(const char *s1, const char *s2)
264{ 264{
265 int empty = 0; 265 int empty = 0;
266 266
267 if ((!s1) && (!s2)) return 1; 267 if ((!s1) && (!s2)) return 1;
268 if ((!s1) || ((s1) && (s1[0] == 0))) empty++; 268 if ((!s1) || ((s1) && (s1[0] == 0))) empty++;
269 if ((!s2) || ((s2) && (s2[0] == 0))) empty++; 269 if ((!s2) || ((s2) && (s2[0] == 0))) empty++;
@@ -275,7 +275,7 @@ EAPI int
275e_util_immortal_check(void) 275e_util_immortal_check(void)
276{ 276{
277 Evas_List *wins; 277 Evas_List *wins;
278 278
279 wins = e_border_immortal_windows_get(); 279 wins = e_border_immortal_windows_get();
280 if (wins) 280 if (wins)
281 { 281 {
@@ -298,7 +298,7 @@ e_util_edje_icon_list_check(const char *list)
298 char *buf; 298 char *buf;
299 const char *p; 299 const char *p;
300 const char *c; 300 const char *c;
301 301
302 if ((!list) || (!list[0])) return 0; 302 if ((!list) || (!list[0])) return 0;
303 buf = alloca(strlen(list) + 1); 303 buf = alloca(strlen(list) + 1);
304 p = list; 304 p = list;
@@ -329,7 +329,7 @@ e_util_edje_icon_list_set(Evas_Object *obj, const char *list)
329 char *buf; 329 char *buf;
330 const char *p; 330 const char *p;
331 const char *c; 331 const char *c;
332 332
333 if ((!list) || (!list[0])) return 0; 333 if ((!list) || (!list[0])) return 0;
334 buf = alloca(strlen(list) + 1); 334 buf = alloca(strlen(list) + 1);
335 p = list; 335 p = list;
@@ -360,7 +360,7 @@ e_util_menu_item_edje_icon_list_set(E_Menu_Item *mi, const char *list)
360 char *buf; 360 char *buf;
361 const char *p; 361 const char *p;
362 char *c; 362 char *c;
363 363
364 if ((!list) || (!list[0])) return 0; 364 if ((!list) || (!list[0])) return 0;
365 buf = alloca(strlen(list) + 1); 365 buf = alloca(strlen(list) + 1);
366 p = list; 366 p = list;
@@ -421,7 +421,7 @@ e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *name)
421{ 421{
422 const char *file; 422 const char *file;
423 char buf[4096]; 423 char buf[4096];
424 424
425 if ((!name) || (!name[0])) return 0; 425 if ((!name) || (!name[0])) return 0;
426 snprintf(buf, sizeof(buf), "e/icons/%s", name); 426 snprintf(buf, sizeof(buf), "e/icons/%s", name);
427 file = e_theme_edje_file_get("base/theme/icons", buf); 427 file = e_theme_edje_file_get("base/theme/icons", buf);
@@ -441,14 +441,14 @@ e_util_container_window_find(Ecore_X_Window win)
441 for (l = e_manager_list(); l; l = l->next) 441 for (l = e_manager_list(); l; l = l->next)
442 { 442 {
443 E_Manager *man; 443 E_Manager *man;
444 444
445 man = l->data; 445 man = l->data;
446 for (ll = man->containers; ll; ll = ll->next) 446 for (ll = man->containers; ll; ll = ll->next)
447 { 447 {
448 E_Container *con; 448 E_Container *con;
449 449
450 con = ll->data; 450 con = ll->data;
451 if ((con->win == win) || (con->bg_win == win) || 451 if ((con->win == win) || (con->bg_win == win) ||
452 (con->event_win == win)) 452 (con->event_win == win))
453 return con; 453 return con;
454 } 454 }
@@ -465,7 +465,7 @@ e_util_desk_border_above(E_Border *bd)
465 465
466 E_OBJECT_CHECK_RETURN(bd, NULL); 466 E_OBJECT_CHECK_RETURN(bd, NULL);
467 E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, NULL); 467 E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, NULL);
468 468
469 if (bd->layer == 0) pos = 0; 469 if (bd->layer == 0) pos = 0;
470 else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; 470 else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1;
471 else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; 471 else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2;
@@ -508,7 +508,7 @@ e_util_desk_border_below(E_Border *bd)
508 508
509 E_OBJECT_CHECK_RETURN(bd, NULL); 509 E_OBJECT_CHECK_RETURN(bd, NULL);
510 E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, NULL); 510 E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, NULL);
511 511
512 if (bd->layer == 0) pos = 0; 512 if (bd->layer == 0) pos = 0;
513 else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; 513 else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1;
514 else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; 514 else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2;
@@ -550,7 +550,7 @@ EAPI int
550e_util_edje_collection_exists(const char *file, const char *coll) 550e_util_edje_collection_exists(const char *file, const char *coll)
551{ 551{
552 Evas_List *clist, *l; 552 Evas_List *clist, *l;
553 553
554 clist = edje_file_collection_list(file); 554 clist = edje_file_collection_list(file);
555 for (l = clist; l; l = l->next) 555 for (l = clist; l; l = l->next)
556 { 556 {
@@ -568,7 +568,7 @@ EAPI void
568e_util_dialog_internal(const char *title, const char *txt) 568e_util_dialog_internal(const char *title, const char *txt)
569{ 569{
570 E_Dialog *dia; 570 E_Dialog *dia;
571 571
572 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_error_dialog"); 572 dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_error_dialog");
573 if (!dia) return; 573 if (!dia) return;
574 e_dialog_title_set(dia, title); 574 e_dialog_title_set(dia, title);
@@ -586,7 +586,7 @@ e_util_filename_escape(const char *filename)
586 const char *p; 586 const char *p;
587 char *q; 587 char *q;
588 static char buf[4096]; 588 static char buf[4096];
589 589
590 p = filename; 590 p = filename;
591 q = buf; 591 q = buf;
592 while (*p) 592 while (*p)
@@ -722,7 +722,7 @@ e_util_size_string_get(off_t size)
722{ 722{
723 double dsize; 723 double dsize;
724 char buf[256]; 724 char buf[256];
725 725
726 dsize = (double)size; 726 dsize = (double)size;
727 if (dsize < 1024.0) snprintf(buf, sizeof(buf), _("%'.0f Bytes"), dsize); 727 if (dsize < 1024.0) snprintf(buf, sizeof(buf), _("%'.0f Bytes"), dsize);
728 else 728 else
@@ -759,25 +759,25 @@ e_util_file_time_get(time_t ftime)
759 } 759 }
760 else 760 else
761 { 761 {
762 if (diff <= 60) 762 if (diff <= 60)
763 snprintf(buf, sizeof(buf), _("In the last Minute")); 763 snprintf(buf, sizeof(buf), _("In the last Minute"));
764 else if (diff >= 31526000) 764 else if (diff >= 31526000)
765 snprintf(buf, sizeof(buf), _("%li Years ago"), (diff / 31526000)); 765 snprintf(buf, sizeof(buf), _("%li Years ago"), (diff / 31526000));
766 else if (diff >= 2592000) 766 else if (diff >= 2592000)
767 snprintf(buf, sizeof(buf), _("%li Months ago"), (diff / 2592000)); 767 snprintf(buf, sizeof(buf), _("%li Months ago"), (diff / 2592000));
768 else if (diff >= 604800) 768 else if (diff >= 604800)
769 snprintf(buf, sizeof(buf), _("%li Weeks ago"), (diff / 604800)); 769 snprintf(buf, sizeof(buf), _("%li Weeks ago"), (diff / 604800));
770 else if (diff >= 86400) 770 else if (diff >= 86400)
771 snprintf(buf, sizeof(buf), _("%li Days ago"), (diff / 86400)); 771 snprintf(buf, sizeof(buf), _("%li Days ago"), (diff / 86400));
772 else if (diff >= 3600) 772 else if (diff >= 3600)
773 snprintf(buf, sizeof(buf), _("%li Hours ago"), (diff / 3600)); 773 snprintf(buf, sizeof(buf), _("%li Hours ago"), (diff / 3600));
774 else if (diff > 60) 774 else if (diff > 60)
775 snprintf(buf, sizeof(buf), _("%li Minutes ago"), (diff / 60)); 775 snprintf(buf, sizeof(buf), _("%li Minutes ago"), (diff / 60));
776 } 776 }
777 777
778 if (buf) 778 if (buf)
779 s = strdup(buf); 779 s = strdup(buf);
780 else 780 else
781 s = strdup(_("Unknown")); 781 s = strdup(_("Unknown"));
782 return s; 782 return s;
783} 783}
@@ -789,7 +789,7 @@ EAPI void
789e_util_library_path_strip(void) 789e_util_library_path_strip(void)
790{ 790{
791 char *p, *p2; 791 char *p, *p2;
792 792
793 p = getenv("LD_LIBRARY_PATH"); 793 p = getenv("LD_LIBRARY_PATH");
794 E_FREE(prev_ld_library_path); 794 E_FREE(prev_ld_library_path);
795 if (p) 795 if (p)
@@ -851,7 +851,7 @@ static void
851_e_util_container_fake_mouse_up_cb(void *data) 851_e_util_container_fake_mouse_up_cb(void *data)
852{ 852{
853 E_Util_Fake_Mouse_Up_Info *info; 853 E_Util_Fake_Mouse_Up_Info *info;
854 854
855 info = data; 855 info = data;
856 if (info) 856 if (info)
857 { 857 {