return buf;
}
-
-#if 0
-E_API char *
-e_util_shell_env_path_eval(const char *path)
-{
- /* evaluate things like:
- * $HOME/bling -> /home/user/bling
- * $HOME/bin/$HOSTNAME/blah -> /home/user/bin/localhost/blah
- * etc. etc.
- */
- const char *p, *v2, *v1 = NULL;
- char buf[PATH_MAX], *pd, *s, *vp;
- char *v = NULL;
- int esc = 0, invar = 0;
-
- for (p = path, pd = buf; (pd < (buf + sizeof(buf) - 1)); p++)
- {
- if (invar)
- {
- if (!((isalnum(*p)) || (*p == '_')))
- {
- v2 = p;
- invar = 0;
- if ((v2 - v1) > 1)
- {
- s = alloca(v2 - v1);
- strncpy(s, v1 + 1, v2 - v1 - 1);
- s[v2 - v1 - 1] = 0;
- if (strncmp(s, "XDG", 3))
- v = getenv(s);
- else
- {
- if (!strcmp(s, "XDG_CONFIG_HOME"))
- v = (char *)efreet_config_home_get();
- else if (!strcmp(s, "XDG_CACHE_HOME"))
- v = (char *)efreet_cache_home_get();
- else if (!strcmp(s, "XDG_DATA_HOME"))
- v = (char *)efreet_data_home_get();
- else if (!strcmp(s, "XDG_DESKTOP_DIR"))
- v = (char *)efreet_desktop_dir_get();
- else if (!strcmp(s, "XDG_DOWNLOAD_DIR"))
- v = (char *)efreet_download_dir_get();
- else if (!strcmp(s, "XDG_TEMPLATES_DIR"))
- v = (char *)efreet_templates_dir_get();
- else if (!strcmp(s, "XDG_PUBLICSHARE_DIR"))
- v = (char *)efreet_public_share_dir_get();
- else if (!strcmp(s, "XDG_DOCUMENTS_DIR"))
- v = (char *)efreet_documents_dir_get();
- else if (!strcmp(s, "XDG_MUSIC_DIR"))
- v = (char *)efreet_music_dir_get();
- else if (!strcmp(s, "XDG_PICTURES_DIR"))
- v = (char *)efreet_pictures_dir_get();
- else if (!strcmp(s, "XDG_VIDEOS_DIR"))
- v = (char *)efreet_videos_dir_get();
- else if (!strcmp(s, "XDG_RUNTIME_DIR"))
- v = (char *)efreet_runtime_dir_get();
- }
-
- if (v)
- {
- vp = v;
- while ((*vp) && (pd < (buf + sizeof(buf) - 1)))
- {
- *pd = *vp;
- vp++;
- pd++;
- }
- }
- }
- if (pd < (buf + sizeof(buf) - 1))
- {
- *pd = *p;
- pd++;
- }
- }
- }
- else
- {
- if (esc)
- {
- *pd = *p;
- pd++;
- }
- else
- {
- if (*p == '\\') esc = 1;
- else if (*p == '$')
- {
- invar = 1;
- v1 = p;
- }
- else
- {
- *pd = *p;
- pd++;
- }
- }
- }
- if (*p == 0) break;
- }
- *pd = 0;
- return strdup(buf);
-}
-#endif
-
EINTERN char *
e_util_size_string_get(off_t size)
{
free(s);
}
-#if 0
-static Efreet_Desktop *
-_e_util_default_terminal_get(const char *defaults_list)
-{
- Efreet_Desktop *tdesktop = NULL;
- Efreet_Ini *ini;
- const char *s;
-
- ini = efreet_ini_new(defaults_list);
- if ((ini) && (ini->data) &&
- (efreet_ini_section_set(ini, "Default Applications")) &&
- (ini->section))
- {
- s = efreet_ini_string_get(ini, "x-scheme-handler/terminal");
- if (s) tdesktop = efreet_util_desktop_file_id_find(s);
- }
- if (ini) efreet_ini_free(ini);
- return tdesktop;
-}
-
-E_API Efreet_Desktop *
-e_util_terminal_desktop_get(void)
-{
- const char *terms[] =
- {
- "terminology.desktop",
- "rxvt.desktop",
- "gnome-terminal.desktop",
- "konsole.desktop",
- NULL
- };
- const char *s;
- char buf[PATH_MAX];
- Efreet_Desktop *tdesktop = NULL, *td;
- Eina_List *l;
- int i;
-
- s = efreet_data_home_get();
- if (s)
- {
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list", s);
- tdesktop = _e_util_default_terminal_get(buf);
- }
- if (tdesktop) return tdesktop;
- EINA_LIST_FOREACH(efreet_data_dirs_get(), l, s)
- {
- snprintf(buf, sizeof(buf), "%s/applications/defaults.list", s);
- tdesktop = _e_util_default_terminal_get(buf);
- if (tdesktop) return tdesktop;
- }
-
- for (i = 0; terms[i]; i++)
- {
- tdesktop = efreet_util_desktop_file_id_find(terms[i]);
- if (tdesktop) return tdesktop;
- }
- if (!tdesktop)
- {
- l = efreet_util_desktop_category_list("TerminalEmulator");
- if (l)
- {
- // just take first one since above list doesn't work.
- tdesktop = l->data;
- EINA_LIST_FREE(l, td)
- {
- // free/unref the desktops we are not going to use
- if (td != tdesktop) efreet_desktop_free(td);
- }
- }
- }
- return tdesktop;
-}
-#endif
-
EINTERN char *
e_util_string_append_char(char *str, size_t *size, size_t *len, char c)
{
EINTERN int e_util_edje_collection_exists(const char *file, const char *coll);
EINTERN E_Dialog *e_util_dialog_internal(const char *title, const char *txt);
EINTERN const char *e_util_filename_escape(const char *filename);
-//E_API char *e_util_shell_env_path_eval(const char *path);
EINTERN char *e_util_size_string_get(off_t size);
EINTERN char *e_util_file_time_get(time_t ftime);
EINTERN Eina_Bool e_util_file_realpath_check(const char* path, Eina_Bool del_link);
EINTERN Evas_Object *e_util_icon_add(const char *path, Evas *evas);
-//E_API Evas_Object *e_util_desktop_icon_add(Efreet_Desktop *desktop, unsigned int size, Evas *evas);
EINTERN Evas_Object *e_util_icon_theme_icon_add(const char *icon_name, unsigned int size, Evas *evas);
EINTERN int e_util_dir_check(const char *dir);
EINTERN void e_util_defer_object_del(E_Object *obj);
EINTERN Eina_Bool e_util_fullscreen_any(void);
EINTERN const char *e_util_time_str_get(long int seconds);
EINTERN void e_util_size_debug_set(Evas_Object *obj, Eina_Bool enable);
-//E_API Efreet_Desktop *e_util_terminal_desktop_get(void);
EINTERN char *e_util_string_append_char(char *str, size_t *size, size_t *len, char c);
EINTERN char *e_util_string_append_quoted(char *str, size_t *size, size_t *len, const char *src);
E_API unsigned int e_util_timestamp_get(void);
-static inline Eina_Bool
-isedje(const Evas_Object *obj)
-{
- return obj && !e_util_strcmp(evas_object_type_get(obj), "edje");
-}
-
-static inline Eina_Bool
-dblequal(double a, double b)
-{
- return fabs(a - b) < DBL_EPSILON;
-}
-
#endif
#endif