forked from enlightenment/efl
Compare commits
9 Commits
9d7fc64ca3
...
1704758e79
Author | SHA1 | Date |
---|---|---|
Dmitri Chudinov | 1704758e79 | |
Dmitri Chudinov | 53d18f0409 | |
Dmitri Chudinov | c0e260d308 | |
Dmitri Chudinov | c260bcbd33 | |
Vincent Torri | 8272318d71 | |
Dmitri Chudinov | cc66b5d011 | |
Dmitri Chudinov | 58ccd1031a | |
Dmitri Chudinov | 472cee52b2 | |
Carsten Haitzler | 9447fb6bad |
|
@ -889,6 +889,7 @@ ICON("preferences-desktop-screensaver", "i-screen")
|
||||||
ICON("preferences-desktop-wallpaper", "i-picture-landscape")
|
ICON("preferences-desktop-wallpaper", "i-picture-landscape")
|
||||||
ICON("preferences-system", "i-gear")
|
ICON("preferences-system", "i-gear")
|
||||||
ICON("preferences-other", "i-gear-spanner")
|
ICON("preferences-other", "i-gear-spanner")
|
||||||
|
ICON("preferences-etc", "i-utilities")
|
||||||
ICON("system-file-manager", "i-folder")
|
ICON("system-file-manager", "i-folder")
|
||||||
ICON("applications-accessories", "i-scissor-rule")
|
ICON("applications-accessories", "i-scissor-rule")
|
||||||
ICON("applications-development", "i-gear-curly-braces")
|
ICON("applications-development", "i-gear-curly-braces")
|
||||||
|
|
|
@ -360,7 +360,7 @@ I160("i-monitor-speakers", "monitor-speakers")
|
||||||
I160("i-briefcase", "briefcase")
|
I160("i-briefcase", "briefcase")
|
||||||
I160("i-app-window", "app-window")
|
I160("i-app-window", "app-window")
|
||||||
I160("i-beaker", "beaker")
|
I160("i-beaker", "beaker")
|
||||||
// not used yet I160("i-utilities", "utilities")
|
I160("i-utilities", "utilities")
|
||||||
I160("i-sun", "sun")
|
I160("i-sun", "sun")
|
||||||
I160("i-moon", "moon")
|
I160("i-moon", "moon")
|
||||||
I160("i-moon-clouds", "moon-clouds")
|
I160("i-moon-clouds", "moon-clouds")
|
||||||
|
|
|
@ -3376,7 +3376,7 @@ _profiles_list_unselect_cb(void *data EINA_UNUSED,
|
||||||
Evas_Object *obj,
|
Evas_Object *obj,
|
||||||
void *event_info EINA_UNUSED)
|
void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
if (elm_list_selected_item_get(obj)) return;
|
if (!elm_list_selected_item_get(obj)) return;
|
||||||
elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
|
elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
|
||||||
EINA_TRUE);
|
EINA_TRUE);
|
||||||
elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
|
elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
|
||||||
|
@ -4383,11 +4383,16 @@ _status_config_full(Evas_Object *win,
|
||||||
"Audio", _cf_audio, win);
|
"Audio", _cf_audio, win);
|
||||||
elm_toolbar_item_append(tb, "preferences-profile",
|
elm_toolbar_item_append(tb, "preferences-profile",
|
||||||
"Profiles", _cf_profiles, win);
|
"Profiles", _cf_profiles, win);
|
||||||
elm_toolbar_item_append(tb, NULL, "Scrolling", _cf_scrolling, win);
|
elm_toolbar_item_append(tb, "system-run",
|
||||||
elm_toolbar_item_append(tb, NULL, "Rendering", _cf_rendering, win);
|
"Scrolling", _cf_scrolling, win);
|
||||||
elm_toolbar_item_append(tb, NULL, "Caches", _cf_caches, win);
|
elm_toolbar_item_append(tb, "preferences-desktop",
|
||||||
elm_toolbar_item_append(tb, NULL, "Focus", _cf_focus, win);
|
"Rendering", _cf_rendering, win);
|
||||||
elm_toolbar_item_append(tb, NULL, "Etc", _cf_etc, win);
|
elm_toolbar_item_append(tb, "appointment-new",
|
||||||
|
"Caches", _cf_caches, win);
|
||||||
|
elm_toolbar_item_append(tb, "magnifying-glass",
|
||||||
|
"Focus", _cf_focus, win);
|
||||||
|
elm_toolbar_item_append(tb, "preferences-etc",
|
||||||
|
"Etc", _cf_etc, win);
|
||||||
|
|
||||||
elm_box_pack_end(bx0, tb);
|
elm_box_pack_end(bx0, tb);
|
||||||
evas_object_show(tb);
|
evas_object_show(tb);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Compile with:
|
// Compile with:
|
||||||
// gcc -o ecore_audio_custom ecore_audio_custom.c `pkg-config --libs --cflags ecore ecore-audio`
|
// gcc -o ecore_audio_custom ecore_audio_custom.c `pkg-config --libs --cflags ecore ecore-audio`
|
||||||
|
#ifndef EFL_BETA_API_SUPPORT
|
||||||
# define EFL_BETA_API_SUPPORT
|
# define EFL_BETA_API_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Compile with:
|
// Compile with:
|
||||||
// gcc -o ecore_audio_playback ecore_audio_playback.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
// gcc -o ecore_audio_playback ecore_audio_playback.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
||||||
|
#ifndef EFL_BETA_API_SUPPORT
|
||||||
# define EFL_BETA_API_SUPPORT
|
# define EFL_BETA_API_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Compile with:
|
// Compile with:
|
||||||
// gcc -o ecore_audio_to_ogg ecore_audio_to_ogg.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
// gcc -o ecore_audio_to_ogg ecore_audio_to_ogg.c `pkg-config --libs --cflags ecore eina ecore-audio`
|
||||||
|
#ifndef EFL_BETA_API_SUPPORT
|
||||||
# define EFL_BETA_API_SUPPORT
|
# define EFL_BETA_API_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
|
|
@ -447,7 +447,11 @@ _ecore_main_fdh_poll_add(Efl_Loop_Data *pd EINA_UNUSED, Ecore_Fd_Handler *fdh)
|
||||||
fdh->gfd.events = _gfd_events_from_fdh(fdh);
|
fdh->gfd.events = _gfd_events_from_fdh(fdh);
|
||||||
fdh->gfd.revents = 0;
|
fdh->gfd.revents = 0;
|
||||||
DBG("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
|
DBG("adding gpoll on %d %08x", fdh->fd, fdh->gfd.events);
|
||||||
|
if (ecore_glib_source)
|
||||||
g_source_add_poll(ecore_glib_source, &fdh->gfd);
|
g_source_add_poll(ecore_glib_source, &fdh->gfd);
|
||||||
|
else
|
||||||
|
ERR("Failed to add gpoll on %d %08x. GSource is NULL",
|
||||||
|
fdh->fd, fdh->gfd.events);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
@ -939,29 +943,6 @@ quit:
|
||||||
static void
|
static void
|
||||||
_ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
|
_ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
|
||||||
{
|
{
|
||||||
// Please note that this function is being also called in case of a bad
|
|
||||||
// fd to reset the main loop.
|
|
||||||
#ifdef HAVE_SYS_EPOLL_H
|
|
||||||
pd->epoll_fd = epoll_create(1);
|
|
||||||
if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
|
|
||||||
else
|
|
||||||
{
|
|
||||||
eina_file_close_on_exec(pd->epoll_fd, EINA_TRUE);
|
|
||||||
|
|
||||||
pd->epoll_pid = getpid();
|
|
||||||
|
|
||||||
// add polls on all our file descriptors
|
|
||||||
Ecore_Fd_Handler *fdh;
|
|
||||||
EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
|
|
||||||
{
|
|
||||||
if (fdh->delete_me) continue;
|
|
||||||
_ecore_epoll_add(pd->epoll_fd, fdh->fd,
|
|
||||||
_ecore_poll_events_from_fdh(fdh), fdh);
|
|
||||||
_ecore_main_fdh_poll_add(pd, fdh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (obj == ML_OBJ)
|
if (obj == ML_OBJ)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBUV
|
#ifdef HAVE_LIBUV
|
||||||
|
@ -1072,6 +1053,30 @@ _ecore_main_loop_setup(Eo *obj, Efl_Loop_Data *pd)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Please note that this function is being also called in case of a bad
|
||||||
|
// fd to reset the main loop.
|
||||||
|
#ifdef HAVE_SYS_EPOLL_H
|
||||||
|
pd->epoll_fd = epoll_create(1);
|
||||||
|
if (pd->epoll_fd < 0) WRN("Failed to create epoll fd!");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eina_file_close_on_exec(pd->epoll_fd, EINA_TRUE);
|
||||||
|
|
||||||
|
pd->epoll_pid = getpid();
|
||||||
|
|
||||||
|
// add polls on all our file descriptors
|
||||||
|
Ecore_Fd_Handler *fdh;
|
||||||
|
EINA_INLIST_FOREACH(pd->fd_handlers, fdh)
|
||||||
|
{
|
||||||
|
if (fdh->delete_me) continue;
|
||||||
|
_ecore_epoll_add(pd->epoll_fd, fdh->fd,
|
||||||
|
_ecore_poll_events_from_fdh(fdh), fdh);
|
||||||
|
_ecore_main_fdh_poll_add(pd, fdh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
_ecore_main_timechanges_start(obj);
|
_ecore_main_timechanges_start(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ eet_dictionary_free(Eet_Dictionary *ed)
|
||||||
if (!ed) return;
|
if (!ed) return;
|
||||||
eina_rwlock_free(&ed->rwlock);
|
eina_rwlock_free(&ed->rwlock);
|
||||||
|
|
||||||
|
if ((ed->all_allocated) && (ed->all))
|
||||||
|
{
|
||||||
for (i = 0; i < ed->count; i++)
|
for (i = 0; i < ed->count; i++)
|
||||||
{
|
{
|
||||||
if (ed->all_allocated[i >> 3] & (1 << (i & 0x7)))
|
if (ed->all_allocated[i >> 3] & (1 << (i & 0x7)))
|
||||||
|
@ -38,6 +40,7 @@ eet_dictionary_free(Eet_Dictionary *ed)
|
||||||
eina_stringshare_del(ed->all[i].str);
|
eina_stringshare_del(ed->all[i].str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
free(ed->all);
|
free(ed->all);
|
||||||
free(ed->all_hash);
|
free(ed->all_hash);
|
||||||
free(ed->all_allocated);
|
free(ed->all_allocated);
|
||||||
|
|
|
@ -1527,7 +1527,7 @@ eet_open(const char *file,
|
||||||
{
|
{
|
||||||
Eina_File *fp;
|
Eina_File *fp;
|
||||||
Eet_File *ef;
|
Eet_File *ef;
|
||||||
int file_len;
|
int file_len, ret;
|
||||||
unsigned long int size;
|
unsigned long int size;
|
||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
|
@ -1566,6 +1566,11 @@ eet_open(const char *file,
|
||||||
/* try open the file based on mode */
|
/* try open the file based on mode */
|
||||||
if ((mode == EET_FILE_MODE_READ) || (mode == EET_FILE_MODE_READ_WRITE))
|
if ((mode == EET_FILE_MODE_READ) || (mode == EET_FILE_MODE_READ_WRITE))
|
||||||
{
|
{
|
||||||
|
if (mode == EET_FILE_MODE_READ_WRITE)
|
||||||
|
{
|
||||||
|
ret = access(file, W_OK);
|
||||||
|
if ((ret != 0) && (errno != ENOENT)) return NULL;
|
||||||
|
}
|
||||||
/* Prevent garbage in futur comparison. */
|
/* Prevent garbage in futur comparison. */
|
||||||
fp = eina_file_open(file, EINA_FALSE);
|
fp = eina_file_open(file, EINA_FALSE);
|
||||||
if (!fp)
|
if (!fp)
|
||||||
|
@ -1601,6 +1606,8 @@ open_error:
|
||||||
size = 0;
|
size = 0;
|
||||||
|
|
||||||
fp = NULL;
|
fp = NULL;
|
||||||
|
ret = access(file, W_OK);
|
||||||
|
if ((ret != 0) && (errno != ENOENT)) return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We found one */
|
/* We found one */
|
||||||
|
|
|
@ -833,7 +833,7 @@ efreet_desktop_command_path_absolute(const char *path)
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
/* relative url */
|
/* relative url */
|
||||||
if (path[0] != '/')
|
if (eina_file_path_relative(path))
|
||||||
{
|
{
|
||||||
if (!(buf = malloc(size))) return NULL;
|
if (!(buf = malloc(size))) return NULL;
|
||||||
if (!getcwd(buf, size))
|
if (!getcwd(buf, size))
|
||||||
|
|
|
@ -3125,7 +3125,7 @@ efreet_menu_path_get(Efreet_Menu_Internal *internal, const char *suffix)
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
/* see if we've got an absolute or relative path */
|
/* see if we've got an absolute or relative path */
|
||||||
if (suffix[0] == '/')
|
if (!eina_file_path_relative(suffix))
|
||||||
snprintf(path, sizeof(path), "%s", suffix);
|
snprintf(path, sizeof(path), "%s", suffix);
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -245,6 +245,19 @@ struct _Eina_File_Line
|
||||||
*/
|
*/
|
||||||
#define EINA_FILE_DIR_LIST_CB(function) ((Eina_File_Dir_List_Cb)function)
|
#define EINA_FILE_DIR_LIST_CB(function) ((Eina_File_Dir_List_Cb)function)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determines if a path is relative or absolute.
|
||||||
|
*
|
||||||
|
* @param[in] path The path to check.
|
||||||
|
*
|
||||||
|
* @return #EINA_TRUE if the path is relative, #EINA_FALSE otherwise.
|
||||||
|
*
|
||||||
|
* The implementation simply checks if the first char in the path is
|
||||||
|
* '/' on POSIX systems. On Windows, absolute paths begin with '\' or
|
||||||
|
* 'C:\' (or other letter). If it is not, the path is considered relative.
|
||||||
|
* If @p path is @c NULL, this function returns #EINA_FALSE.
|
||||||
|
*/
|
||||||
|
EINA_API Eina_Bool eina_file_path_relative(const char *path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Lists all the files on the directory by calling the function for every file found.
|
* @brief Lists all the files on the directory by calling the function for every file found.
|
||||||
|
|
|
@ -178,18 +178,6 @@ struct _Eina_Lines_Iterator
|
||||||
/** Macro for logging Eina debug messages */
|
/** Macro for logging Eina debug messages */
|
||||||
#define DBG(...) EINA_LOG_DOM_DBG(_eina_file_log_dom, __VA_ARGS__)
|
#define DBG(...) EINA_LOG_DOM_DBG(_eina_file_log_dom, __VA_ARGS__)
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Determines if a path is relative or absolute.
|
|
||||||
* The implementation simply checks if the first char in the path is '/'. If it
|
|
||||||
* is not, the path is considered relative.
|
|
||||||
*
|
|
||||||
* @param[in] path The path to check.
|
|
||||||
*
|
|
||||||
* @return EINA_TRUE if the path is relative, EINA_FALSE otherwise.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Eina_Bool eina_file_path_relative(const char *path);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Gets the current directory and optionally appends a path to it.
|
* @brief Gets the current directory and optionally appends a path to it.
|
||||||
* If a string was passed in via the @p path parameter, it will
|
* If a string was passed in via the @p path parameter, it will
|
||||||
|
|
|
@ -521,13 +521,6 @@ eina_file_mmap_faulty(void *addr, long page_size)
|
||||||
* Simplified logic for portability layer with eina_file_common *
|
* Simplified logic for portability layer with eina_file_common *
|
||||||
* ================================================================ */
|
* ================================================================ */
|
||||||
|
|
||||||
Eina_Bool
|
|
||||||
eina_file_path_relative(const char *path)
|
|
||||||
{
|
|
||||||
if (*path != '/') return EINA_TRUE;
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
Eina_Tmpstr *
|
Eina_Tmpstr *
|
||||||
eina_file_current_directory_get(const char *path, size_t len)
|
eina_file_current_directory_get(const char *path, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -562,6 +555,15 @@ eina_file_cleanup(Eina_Tmpstr *path)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EINA_API Eina_Bool
|
||||||
|
eina_file_path_relative(const char *path)
|
||||||
|
{
|
||||||
|
if (!path)
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
return *path != '/';
|
||||||
|
}
|
||||||
|
|
||||||
EINA_API Eina_Bool
|
EINA_API Eina_Bool
|
||||||
eina_file_dir_list(const char *dir,
|
eina_file_dir_list(const char *dir,
|
||||||
Eina_Bool recursive,
|
Eina_Bool recursive,
|
||||||
|
|
|
@ -515,12 +515,6 @@ _eina_file_mkdtemp(char *__template)
|
||||||
* Simplified logic for portability layer with eina_file_common *
|
* Simplified logic for portability layer with eina_file_common *
|
||||||
* ================================================================ */
|
* ================================================================ */
|
||||||
|
|
||||||
Eina_Bool
|
|
||||||
eina_file_path_relative(const char *path)
|
|
||||||
{
|
|
||||||
return !evil_path_is_absolute(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
Eina_Tmpstr *
|
Eina_Tmpstr *
|
||||||
eina_file_current_directory_get(const char *path, size_t len)
|
eina_file_current_directory_get(const char *path, size_t len)
|
||||||
{
|
{
|
||||||
|
@ -559,6 +553,29 @@ eina_file_cleanup(Eina_Tmpstr *path)
|
||||||
* API *
|
* API *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
|
|
||||||
|
EINA_API Eina_Bool
|
||||||
|
eina_file_path_relative(const char *path)
|
||||||
|
{
|
||||||
|
/* see
|
||||||
|
* https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#paths
|
||||||
|
* absolute path if:
|
||||||
|
* - is an UNC path (begins with \\)
|
||||||
|
* - has a drive letter (C:\). \ is important here, otherwise it is relative
|
||||||
|
* - begins with \
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!path || *path == '\\')
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
if ((((*path >= 'a') && (*path <= 'z')) ||
|
||||||
|
((*path >= 'A') && (*path <= 'Z'))) &&
|
||||||
|
(path[1] == ':') &&
|
||||||
|
((path[2] == '\\') || (path[2] == '/')))
|
||||||
|
return EINA_FALSE;
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
EINA_API Eina_Bool
|
EINA_API Eina_Bool
|
||||||
eina_file_dir_list(const char *dir,
|
eina_file_dir_list(const char *dir,
|
||||||
Eina_Bool recursive,
|
Eina_Bool recursive,
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <direct.h> /* getcwd */
|
# include <direct.h> /* getcwd */
|
||||||
# include <evil_private.h> /* path_is_absolute realpath dladdr */
|
# include <evil_private.h> /* realpath dladdr */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "eina_config.h"
|
#include "eina_config.h"
|
||||||
|
@ -166,16 +166,6 @@ _path_sep_fix(char *buf)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
|
||||||
_path_absolute_check(const char *path)
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
|
||||||
return evil_path_is_absolute(path);
|
|
||||||
#else
|
|
||||||
return (path[0] == EINA_PATH_SEP_C);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_fallback(Eina_Prefix *pfx, const char *pkg_bin, const char *pkg_lib,
|
_fallback(Eina_Prefix *pfx, const char *pkg_bin, const char *pkg_lib,
|
||||||
const char *pkg_data, const char *pkg_locale, const char *envprefix)
|
const char *pkg_data, const char *pkg_locale, const char *envprefix)
|
||||||
|
@ -284,7 +274,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0)
|
||||||
char buf[PATH_MAX], buf2[PATH_MAX];
|
char buf[PATH_MAX], buf2[PATH_MAX];
|
||||||
|
|
||||||
/* 1. is argv0 abs path? */
|
/* 1. is argv0 abs path? */
|
||||||
if (_path_absolute_check(argv0))
|
if (!eina_file_path_relative(argv0))
|
||||||
{
|
{
|
||||||
if (access(argv0, X_OK) == 0)
|
if (access(argv0, X_OK) == 0)
|
||||||
{
|
{
|
||||||
|
@ -579,7 +569,7 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
{
|
{
|
||||||
if (info_dl.dli_fname)
|
if (info_dl.dli_fname)
|
||||||
{
|
{
|
||||||
if (_path_absolute_check(info_dl.dli_fname))
|
if (!eina_file_path_relative(info_dl.dli_fname))
|
||||||
{
|
{
|
||||||
INF("dladdr for symbol=%p: %s", symbol, info_dl.dli_fname);
|
INF("dladdr for symbol=%p: %s", symbol, info_dl.dli_fname);
|
||||||
char *rlink = realpath(info_dl.dli_fname, NULL);
|
char *rlink = realpath(info_dl.dli_fname, NULL);
|
||||||
|
|
|
@ -2164,25 +2164,6 @@ _icon_size_min_get(Evas_Object *image)
|
||||||
return MAX(16, MIN(w, h));
|
return MAX(16, MIN(w, h));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: move this code to ecore */
|
|
||||||
#ifdef _WIN32
|
|
||||||
static Eina_Bool
|
|
||||||
_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
//TODO: Check if this works with all absolute paths in windows
|
|
||||||
return (isalpha(*path)) && (*(path + 1) == ':') &&
|
|
||||||
((*(path + 2) == '\\') || (*(path + 2) == '/'));
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
static Eina_Bool
|
|
||||||
_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
return *path == '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo)
|
_internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo)
|
||||||
{
|
{
|
||||||
|
@ -2217,7 +2198,7 @@ _internal_efl_ui_image_icon_set(Evas_Object *obj, const char *name, Eina_Bool *f
|
||||||
else
|
else
|
||||||
eina_stringshare_replace(&sd->stdicon, NULL);
|
eina_stringshare_replace(&sd->stdicon, NULL);
|
||||||
|
|
||||||
if (_path_is_absolute(name))
|
if (!eina_file_path_relative(name))
|
||||||
{
|
{
|
||||||
if (fdo)
|
if (fdo)
|
||||||
*fdo = EINA_FALSE;
|
*fdo = EINA_FALSE;
|
||||||
|
|
|
@ -2903,25 +2903,6 @@ _icon_size_min_get(Evas_Object *image)
|
||||||
return MAX(16, MIN(w, h));
|
return MAX(16, MIN(w, h));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: move this code to ecore */
|
|
||||||
#ifdef _WIN32
|
|
||||||
static Eina_Bool
|
|
||||||
_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
//TODO: Check if this works with all absolute paths in windows
|
|
||||||
return (isalpha(*path)) && (*(path + 1) == ':') &&
|
|
||||||
((*(path + 2) == '\\') || (*(path + 2) == '/'));
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
static Eina_Bool
|
|
||||||
_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
return *path == '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_internal_efl_ui_image_zoomable_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo, Eina_Bool resize)
|
_internal_efl_ui_image_zoomable_icon_set(Evas_Object *obj, const char *name, Eina_Bool *fdo, Eina_Bool resize)
|
||||||
{
|
{
|
||||||
|
@ -2956,7 +2937,7 @@ _internal_efl_ui_image_zoomable_icon_set(Evas_Object *obj, const char *name, Ein
|
||||||
else
|
else
|
||||||
eina_stringshare_replace(&sd->stdicon, NULL);
|
eina_stringshare_replace(&sd->stdicon, NULL);
|
||||||
|
|
||||||
if (_path_is_absolute(name))
|
if (!eina_file_path_relative(name))
|
||||||
{
|
{
|
||||||
if (fdo)
|
if (fdo)
|
||||||
*fdo = EINA_FALSE;
|
*fdo = EINA_FALSE;
|
||||||
|
|
|
@ -28,25 +28,6 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* FIXME: move this code to ecore */
|
|
||||||
#ifdef _WIN32
|
|
||||||
static Eina_Bool
|
|
||||||
_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
//TODO: Check if this works with all absolute paths in windows
|
|
||||||
return (isalpha(*path)) && (*(path + 1) == ':') &&
|
|
||||||
((*(path + 2) == '\\') || (*(path + 2) == '/'));
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
static Eina_Bool
|
|
||||||
_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
return *path == '/';
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
_icon_size_min_get(Evas_Object *icon)
|
_icon_size_min_get(Evas_Object *icon)
|
||||||
{
|
{
|
||||||
|
@ -462,7 +443,7 @@ _internal_elm_icon_standard_set(Evas_Object *obj,
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_path_is_absolute(name))
|
if (!eina_file_path_relative(name))
|
||||||
{
|
{
|
||||||
if (fdo)
|
if (fdo)
|
||||||
*fdo = EINA_FALSE;
|
*fdo = EINA_FALSE;
|
||||||
|
|
|
@ -1308,7 +1308,7 @@ elm_quicklaunch_exe_path_get(const char *exe, const char *cwd)
|
||||||
const char *pathitr;
|
const char *pathitr;
|
||||||
const Eina_List *l;
|
const Eina_List *l;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
if (exe[0] == '/') return strdup(exe);
|
if (!eina_file_path_relative(exe)) return strdup(exe);
|
||||||
if (cwd)
|
if (cwd)
|
||||||
pathlist = eina_list_append(pathlist, eina_stringshare_add(cwd));
|
pathlist = eina_list_append(pathlist, eina_stringshare_add(cwd));
|
||||||
else
|
else
|
||||||
|
|
|
@ -203,7 +203,7 @@ _elm_module_add(const char *name, const char *as)
|
||||||
{
|
{
|
||||||
Elm_Module *m;
|
Elm_Module *m;
|
||||||
|
|
||||||
if (name[0] == '/') return NULL;
|
if (!eina_file_path_relative(name)) return NULL;
|
||||||
|
|
||||||
m = eina_hash_find(modules, name);
|
m = eina_hash_find(modules, name);
|
||||||
if (m)
|
if (m)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# include <evil_private.h> /* strsep evil_path_absolute */
|
# include <evil_private.h> /* strsep */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EFL_ACCESS_OBJECT_PROTECTED
|
#define EFL_ACCESS_OBJECT_PROTECTED
|
||||||
|
@ -1816,11 +1816,7 @@ elm_prefs_file_set(Eo *obj, const char *file, const char *page)
|
||||||
sd->file = eina_stringshare_printf("%s/%s", prefix, "preferences.epb");
|
sd->file = eina_stringshare_printf("%s/%s", prefix, "preferences.epb");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
if (eina_file_path_relative(file))
|
||||||
if (*file != '/') /* relative */
|
|
||||||
#else
|
|
||||||
if (!evil_path_is_absolute(file)) /* relative */
|
|
||||||
#endif
|
|
||||||
sd->file = eina_stringshare_printf("%s/%s", prefix, file);
|
sd->file = eina_stringshare_printf("%s/%s", prefix, file);
|
||||||
else
|
else
|
||||||
sd->file = eina_stringshare_add(file);
|
sd->file = eina_stringshare_add(file);
|
||||||
|
|
|
@ -107,10 +107,9 @@ _elm_theme_file_item_add(Eina_Inlist **files, const char *item, Eina_Bool prepen
|
||||||
home = eina_environment_home_get();
|
home = eina_environment_home_get();
|
||||||
buf = eina_strbuf_new();
|
buf = eina_strbuf_new();
|
||||||
|
|
||||||
if ((item[0] == '/') ||
|
if (!eina_file_path_relative(item) ||
|
||||||
((item[0] == '.') && (item[1] == '/')) ||
|
((item[0] == '.') && (item[1] == '/')) ||
|
||||||
((item[0] == '.') && (item[1] == '.') && (item[2] == '/')) ||
|
((item[0] == '.') && (item[1] == '.') && (item[2] == '/')))
|
||||||
((isalpha(item[0])) && (item[1] == ':')))
|
|
||||||
{
|
{
|
||||||
f = eina_file_open(item, EINA_FALSE);
|
f = eina_file_open(item, EINA_FALSE);
|
||||||
if (!f) goto on_error;
|
if (!f) goto on_error;
|
||||||
|
@ -898,9 +897,9 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
|
||||||
if (!home) home = "";
|
if (!home) home = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((f[0] == '/') || ((f[0] == '.') && (f[1] == '/')) ||
|
if (!eina_file_path_relative(f) ||
|
||||||
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')) ||
|
((f[0] == '.') && (f[1] == '/')) ||
|
||||||
((isalpha(f[0])) && (f[1] == ':')))
|
((f[0] == '.') && (f[1] == '.') && (f[2] == '/')))
|
||||||
{
|
{
|
||||||
if (in_search_path) *in_search_path = EINA_FALSE;
|
if (in_search_path) *in_search_path = EINA_FALSE;
|
||||||
return strdup(f);
|
return strdup(f);
|
||||||
|
|
|
@ -193,11 +193,13 @@ elua_state_new(const char *progname)
|
||||||
lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr1");
|
lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr1");
|
||||||
lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr2");
|
lua_setfield(L, LUA_REGISTRYINDEX, "elua_ptr2");
|
||||||
return ret;
|
return ret;
|
||||||
|
#ifdef ENABLE_LUA_OLD
|
||||||
err:
|
err:
|
||||||
lua_close(L);
|
lua_close(L);
|
||||||
eina_stringshare_del(ret->progname);
|
eina_stringshare_del(ret->progname);
|
||||||
free(ret);
|
free(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
|
|
@ -2,10 +2,6 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
# include <evil_private.h> /* evil_path_is_absolute */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Eet.h>
|
#include <Eet.h>
|
||||||
|
|
||||||
#ifdef HAVE_FONTCONFIG
|
#ifdef HAVE_FONTCONFIG
|
||||||
|
@ -67,17 +63,6 @@ static FcConfig *fc_config = NULL;
|
||||||
/* get the casefold feature! */
|
/* get the casefold feature! */
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
int
|
|
||||||
_file_path_is_full_path(const char *path)
|
|
||||||
{
|
|
||||||
if (!path) return 0;
|
|
||||||
#ifdef _WIN32
|
|
||||||
if (evil_path_is_absolute(path)) return 1;
|
|
||||||
#else
|
|
||||||
if (path[0] == '/') return 1;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static DATA64
|
static DATA64
|
||||||
_file_modified_time(const char *file)
|
_file_modified_time(const char *file)
|
||||||
|
@ -787,7 +772,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
|
||||||
}
|
}
|
||||||
if (!font) /* Source load failed */
|
if (!font) /* Source load failed */
|
||||||
{
|
{
|
||||||
if (_file_path_is_full_path((char *)nm)) /* Try filename */
|
if (!eina_file_path_relative((char *)nm)) /* Try filename */
|
||||||
font = (Evas_Font_Set *)evas_common_font_load((char *)nm, size, wanted_rend, bitmap_scalable);
|
font = (Evas_Font_Set *)evas_common_font_load((char *)nm, size, wanted_rend, bitmap_scalable);
|
||||||
else /* search font path */
|
else /* search font path */
|
||||||
{
|
{
|
||||||
|
@ -856,7 +841,7 @@ evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *
|
||||||
}
|
}
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
if (_file_path_is_full_path((char *)nm))
|
if (!eina_file_path_relative((char *)nm))
|
||||||
evas_common_font_add((RGBA_Font *)font, (char *)nm, size, wanted_rend, bitmap_scalable);
|
evas_common_font_add((RGBA_Font *)font, (char *)nm, size, wanted_rend, bitmap_scalable);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,10 +15,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
# include <evil_private.h> /* evil_path_is_absolute */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "evas_common_private.h"
|
#include "evas_common_private.h"
|
||||||
#include "evas_private.h"
|
#include "evas_private.h"
|
||||||
|
|
||||||
|
@ -28,18 +24,6 @@
|
||||||
# define EVAS_PATH_SEPARATOR "/"
|
# define EVAS_PATH_SEPARATOR "/"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
|
||||||
evas_file_path_is_full_path(const char *path)
|
|
||||||
{
|
|
||||||
if (!path) return 0;
|
|
||||||
#ifdef _WIN32
|
|
||||||
if (evil_path_is_absolute(path)) return 1;
|
|
||||||
#else
|
|
||||||
if (path[0] == '/') return 1;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
evas_file_path_join(const char *path, const char *end)
|
evas_file_path_join(const char *path, const char *end)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define _EVAS_PATH_H
|
#define _EVAS_PATH_H
|
||||||
|
|
||||||
|
|
||||||
int evas_file_path_is_full_path (const char *path);
|
|
||||||
char *evas_file_path_join (const char *path, const char *end);
|
char *evas_file_path_join (const char *path, const char *end);
|
||||||
int evas_file_path_exists (const char *path);
|
int evas_file_path_exists (const char *path);
|
||||||
int evas_file_path_is_file (const char *path);
|
int evas_file_path_is_file (const char *path);
|
||||||
|
|
|
@ -188,25 +188,3 @@ _evil_last_error_display(const char *fct)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "[Evil] [%s] ERROR: %s\n", fct, evil_last_error_get());
|
fprintf(stderr, "[Evil] [%s] ERROR: %s\n", fct, evil_last_error_get());
|
||||||
}
|
}
|
||||||
|
|
||||||
EVIL_API int
|
|
||||||
evil_path_is_absolute(const char *path)
|
|
||||||
{
|
|
||||||
size_t length;
|
|
||||||
|
|
||||||
if (!path)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (*path == '/' || *path == '\\') return 1;
|
|
||||||
|
|
||||||
length = strlen(path);
|
|
||||||
if (length < 3) return 0;
|
|
||||||
|
|
||||||
if ((((*path >= 'a') && (*path <= 'z')) ||
|
|
||||||
((*path >= 'A') && (*path <= 'Z'))) &&
|
|
||||||
(path[1] == ':') &&
|
|
||||||
((path[2] == '/') || (path[2] == '\\')))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
|
@ -81,27 +81,4 @@ EVIL_API const char *evil_format_message(long err);
|
||||||
|
|
||||||
EVIL_API const char *evil_last_error_get(void);
|
EVIL_API const char *evil_last_error_get(void);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief check if the given path is absolute.
|
|
||||||
*
|
|
||||||
* @param path The path to check.
|
|
||||||
* @return 1 if the given path is absolute, 0 otherwise.
|
|
||||||
*
|
|
||||||
* Check if the path @p path is absolute or not. An absolute path must
|
|
||||||
* begin with a letter (upper or lower case), followed by by the char
|
|
||||||
* ':', followed by the char '/' or '\'. If @p path is absolute this
|
|
||||||
* function returns 1, otherwise it returns 0. If @p path is @c NULL,
|
|
||||||
* it returns 0.
|
|
||||||
*
|
|
||||||
* Conformity: Non applicable.
|
|
||||||
*
|
|
||||||
* Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
|
|
||||||
* Windows XP.
|
|
||||||
*
|
|
||||||
* @since 1.7
|
|
||||||
*
|
|
||||||
* @ingroup Evil
|
|
||||||
*/
|
|
||||||
EVIL_API int evil_path_is_absolute(const char *path);
|
|
||||||
|
|
||||||
#endif /* __EVIL_UTIL_H__ */
|
#endif /* __EVIL_UTIL_H__ */
|
||||||
|
|
|
@ -458,7 +458,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
|
||||||
};
|
};
|
||||||
|
|
||||||
static Ecore_Evas*
|
static Ecore_Evas*
|
||||||
_ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
|
_ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe EINA_UNUSED, int alpha)
|
||||||
{
|
{
|
||||||
Ecore_Evas_SDL_Switch_Data *swd;
|
Ecore_Evas_SDL_Switch_Data *swd;
|
||||||
Ecore_Evas *ee;
|
Ecore_Evas *ee;
|
||||||
|
|
|
@ -21,9 +21,9 @@ EFL_START_TEST(elua_api)
|
||||||
lua_State *lst;
|
lua_State *lst;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int fd;
|
int fd;
|
||||||
char *cargv[2];
|
const char *cargv[2];
|
||||||
char arg1[] = "test";
|
const char arg1[] = "test";
|
||||||
char arg2[] = "test";
|
const char arg2[] = "test";
|
||||||
int quit = 0;
|
int quit = 0;
|
||||||
cargv[0] = arg1;
|
cargv[0] = arg1;
|
||||||
cargv[1] = arg2;
|
cargv[1] = arg2;
|
||||||
|
@ -106,14 +106,14 @@ EFL_START_TEST(elua_api)
|
||||||
fprintf(f, "return true");
|
fprintf(f, "return true");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
cargv[1] = tmpf;
|
cargv[1] = tmpf;
|
||||||
fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit));
|
fail_if(!elua_util_script_run(st, 2, (char **)cargv, 1, &quit));
|
||||||
fail_if(quit != 1);
|
fail_if(quit != 1);
|
||||||
|
|
||||||
f = fopen(tmpf, "wb");
|
f = fopen(tmpf, "wb");
|
||||||
fail_if(!f);
|
fail_if(!f);
|
||||||
fprintf(f, "return false");
|
fprintf(f, "return false");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
fail_if(!elua_util_script_run(st, 2, cargv, 1, &quit));
|
fail_if(!elua_util_script_run(st, 2, (char **)cargv, 1, &quit));
|
||||||
fail_if(quit != 0);
|
fail_if(quit != 0);
|
||||||
fail_if(remove(tmpf));
|
fail_if(remove(tmpf));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue