static Ecore_List *loaded_plugins = NULL;
+static Eina_Bool _hash_keys(const Eina_Hash *hash,
+ const char *key,
+ void *list);
+
/**
* @defgroup Ecore_Plugin Plugin Functions
*
ecore_plugin_available_get(Ecore_Path_Group *group)
{
Ecore_List *avail = NULL;
- Ecore_Hash *plugins = NULL;
+ Eina_Hash *plugins = NULL;
+ Eina_Iterator *it = NULL;
char *path;
CHECK_PARAM_POINTER_RETURN("group", group, NULL);
return NULL;
ecore_list_first_goto(group->paths);
- plugins = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(plugins, free);
+ plugins = eina_hash_string_superfast_new(free);
while ((path = ecore_list_next(group->paths)) != NULL)
{
ext = strrchr(ppath, '.');
*ext = '\0';
- if (!ecore_hash_get(plugins, ppath))
+ if (!eina_hash_find(plugins, ppath))
{
char *key;
key = strdup(ppath);
- ecore_hash_set(plugins, key, key);
+ eina_hash_add(plugins, key, key);
}
}
closedir(dir);
}
- ecore_hash_free_key_cb_set(plugins, NULL);
- avail = ecore_hash_keys(plugins);
+ avail = ecore_list_new();
ecore_list_free_cb_set(avail, free);
- ecore_hash_destroy(plugins);
+
+
+ it = eina_hash_iterator_key_new(plugins);
+ if (it)
+ {
+ eina_iterator_foreach(it, EINA_EACH(_hash_keys), avail);
+ eina_iterator_free(it);
+ }
+
+ eina_hash_free(plugins);
+
return avail;
}
+
+static Eina_Bool
+_hash_keys(const Eina_Hash *hash, const char *key, void *list)
+{
+ ecore_list_append(list, key);
+ return EINA_TRUE;
+}
EAPI void *ecore_con_server_del(Ecore_Con_Server *svr);
EAPI void *ecore_con_server_data_get(Ecore_Con_Server *svr);
EAPI int ecore_con_server_connected_get(Ecore_Con_Server *svr);
- EAPI Ecore_List *ecore_con_server_clients_get(Ecore_Con_Server *svr);
+ EAPI Eina_List *ecore_con_server_clients_get(Ecore_Con_Server *svr);
EAPI int ecore_con_server_send(Ecore_Con_Server *svr, const void *data, int size);
EAPI void ecore_con_server_client_limit_set(Ecore_Con_Server *svr, int client_limit, char reject_excess_clients);
EAPI char *ecore_con_server_ip_get(Ecore_Con_Server *svr);
svr->created = 1;
svr->reject_excess_clients = 0;
svr->client_limit = -1;
- svr->clients = ecore_list_new();
+ svr->clients = NULL;
svr->ppid = getpid();
ecore_con_ssl_server_prepare(svr);
svr->data = (void *)data;
svr->created = 0;
svr->reject_excess_clients = 0;
+ svr->clients = NULL;
svr->client_limit = -1;
- svr->clients = ecore_list_new();
ecore_con_ssl_server_prepare(svr);
type = compl_type & ECORE_CON_TYPE;
* @return The list of clients on this server.
* @ingroup Ecore_Con_Server_Group
*/
-EAPI Ecore_List *
+EAPI Eina_List *
ecore_con_server_clients_get(Ecore_Con_Server *svr)
{
if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_CON_SERVER))
}
else
{
- if (ecore_list_goto(cl->server->clients, cl))
- ecore_list_remove(cl->server->clients);
+ cl->server->clients = eina_list_remove(cl->server->clients, cl);
_ecore_con_client_free(cl);
}
return data;
static void
_ecore_con_server_free(Ecore_Con_Server *svr)
{
+ Ecore_Con_Client *cl;
double t_start, t;
ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE);
}
}
if (svr->write_buf) free(svr->write_buf);
- while (!ecore_list_empty_is(svr->clients))
- _ecore_con_client_free(ecore_list_first_remove(svr->clients));
- ecore_list_destroy(svr->clients);
+ while (svr->clients)
+ {
+ cl = eina_list_data_get(svr->clients);
+ svr->clients = eina_list_remove(svr->clients, cl);
+ _ecore_con_client_free(cl);
+ }
if ((svr->created) && (svr->path) && (svr->ppid == getpid()))
unlink(svr->path);
if (svr->fd >= 0) close(svr->fd);
if (svr->delete_me) return 1;
if ((svr->client_limit >= 0) && (!svr->reject_excess_clients))
{
- if (ecore_list_count(svr->clients) >= svr->client_limit) return 1;
+ if (eina_list_count(svr->clients) >= svr->client_limit) return 1;
}
/* a new client */
size_in = sizeof(struct sockaddr_in);
ecore_main_fd_handler_add(cl->fd, ECORE_FD_READ,
_ecore_con_svr_cl_handler, cl, NULL, NULL);
ECORE_MAGIC_SET(cl, ECORE_MAGIC_CON_CLIENT);
- ecore_list_append(svr->clients, cl);
+ eina_list_append(svr->clients, cl);
if (!svr->path)
{
ip = incoming.sin_addr.s_addr;
}
memcpy(cl->data, &client_addr, sizeof(client_addr));
ECORE_MAGIC_SET(cl, ECORE_MAGIC_CON_CLIENT);
- ecore_list_append(svr->clients, cl);
+ eina_list_append(svr->clients, cl);
ip = client_addr.sin_addr.s_addr;
snprintf(ipbuf, sizeof(ipbuf),
char *path;
void *data;
Ecore_Fd_Handler *fd_handler;
- Ecore_List *clients;
+ Eina_List *clients;
int write_buf_size;
int write_buf_offset;
unsigned char *write_buf;
* space and cycles that just covers up bugs. On the other hand, it makes
* for a more robust library, and it's used everywhere else in ecore.
*/
- Ecore_Hash *data, *group, *Categories, *OnlyShowIn, *NotShowIn, *MimeTypes, *Actions;
+ Eina_Hash *data, *group, *Categories, *OnlyShowIn, *NotShowIn, *MimeTypes, *Actions;
char *original_path;
char *original_lang;
char *eap_name;
struct _Ecore_Desktop_Icon_Theme
{
- Ecore_Hash *data, *group;
+ Eina_Hash *data, *group;
Ecore_List *Inherits;
Ecore_List *Directories;
char *path;
struct _Ecore_Desktop_Icon_Theme_Directory
{
- Ecore_Hash *icons;
+ Eina_Hash *icons;
char *path;
char *full_path;
char *type;
void *data);
EAPI int ecore_desktop_paths_shutdown(void);
- Ecore_Hash *ecore_desktop_paths_to_hash(const char *paths);
+ Eina_Hash *ecore_desktop_paths_to_hash(const char *paths);
Ecore_List *ecore_desktop_paths_to_list(const char *paths);
EAPI int ecore_desktop_init(void);
EAPI int ecore_desktop_shutdown(void);
- Ecore_Hash *ecore_desktop_ini_get(const char *file);
+ Eina_Hash *ecore_desktop_ini_get(const char *file);
Ecore_Desktop *ecore_desktop_get(const char *file, const char *lang);
void ecore_desktop_save(Ecore_Desktop * desktop);
EAPI Ecore_List *ecore_desktop_get_command(Ecore_Desktop * desktop,
const char *icon_size,
const char *icon_theme);
- Ecore_Hash *ecore_desktop_icon_theme_list(void);
+ Eina_Hash *ecore_desktop_icon_theme_list(void);
Ecore_Desktop_Icon_Theme *ecore_desktop_icon_theme_get(const char *file,
const char *lang);
void ecore_desktop_icon_theme_destroy(Ecore_Desktop_Icon_Theme
EAPI void
ecore_desktop_menu_for_each(void (*func)
- (const char *name, const char *path, const char *directory, Ecore_Hash * apps));
+ (const char *name, const char *path, const char *directory, Eina_Hash * apps));
Ecore_Desktop_Tree *ecore_desktop_menu_get(char *file);
Ecore_Desktop_Tree *ecore_desktop_tree_new(char *buffer);
Ecore_Desktop_Tree *
element);
Ecore_Desktop_Tree *ecore_desktop_tree_add_hash(Ecore_Desktop_Tree * tree,
- Ecore_Hash * element);
+ Eina_Hash * element);
void ecore_desktop_tree_remove(Ecore_Desktop_Tree * tree,
int element);
int ecore_desktop_tree_exist(Ecore_Desktop_Tree * tree,
static int init_count = 0;
-static Ecore_Hash *desktop_cache;
+static Eina_Hash *desktop_cache = NULL;
Ecore_Desktop *_ecore_desktop_get(const char *file, const char *lang);
void _ecore_desktop_destroy(Ecore_Desktop * desktop);
-#define IFGETDUP(src, key, dst) src = (char *)ecore_hash_get(result->group, key); if (src) dst = strdup(src); else dst = NULL;
+#define IFGETDUP(src, key, dst) src = (char *)eina_hash_find(result->group, key); if (src) dst = strdup(src); else dst = NULL;
#define IFFREE(src) if (src) free(src); src = NULL;
/**
/**
* Get the contents of a .ini style file.
*
- * The Ecore_Hash returned is a two level hash, the first level
+ * The Eina_Hash returned is a two level hash, the first level
* is the groups in the file, one per group, keyed by the name
* of that group. The value of each of those first level hashes
- * is the second level Ecore_Hash, the contents of each group.
+ * is the second level Eina_Hash, the contents of each group.
*
* @param file Full path to the .ini style file.
- * @return An Ecore_Hash of the files contents.
+ * @return An Eina_Hash of the files contents.
* @ingroup Ecore_Desktop_Main_Group
*/
-Ecore_Hash *
+Eina_Hash *
ecore_desktop_ini_get(const char *file)
{
- Ecore_Hash *result;
+ Eina_Hash *result;
FILE *f;
char buffer[PATH_MAX];
- Ecore_Hash *current = NULL;
+ Eina_Hash *current = NULL;
- result = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ result = eina_hash_string_superfast_new(eina_hash_free);
if (!result) return NULL;
f = fopen(file, "r");
if (!f)
{
fprintf(stderr, "ERROR: Cannot Open File %s\n", file);
- ecore_hash_destroy(result);
+ eina_hash_free(result);
return NULL;
}
- ecore_hash_free_key_cb_set(result, free);
- ecore_hash_free_value_cb_set(result, (Ecore_Free_Cb) ecore_hash_destroy);
*buffer = '\0';
#ifdef DEBUG
fprintf(stdout, "PARSING INI %s\n", file);
while ((*c != ']') && (*c != '\n') && (*c != '\0'))
c++;
*c++ = '\0';
- current = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ current = ein_hash_string_superfast_new(free);
if (current)
{
- ecore_hash_free_key_cb_set(current, free);
- ecore_hash_free_value_cb_set(current, free);
- ecore_hash_set(result, strdup(key), current);
+ eina_hash_add(result, key, current);
#ifdef DEBUG
fprintf(stdout, " GROUP [%s]\n", key);
#endif
c++;
*c++ = '\0';
/* FIXME: should strip space at end, then unescape value. */
- tv = ecore_hash_remove(current, key);
- if (tv) free(tv);
+ eina_hash_del(current, key);
if (value[0] != '\0')
- ecore_hash_set(current, strdup(key), strdup(value));
+ eina_hash_add(current, key, strdup(value));
#ifdef DEBUG
fprintf(stdout, " %s=%s\n", key, value);
#endif
/* Kill the hash, it takes up way too much memory. */
if (result->data)
{
- ecore_hash_destroy(result->data);
+ eina_hash_free(result->data);
result->data = NULL;
}
result->group = NULL;
double begin;
begin = ecore_time_get();
- result = (Ecore_Desktop *) ecore_hash_get(desktop_cache, (char *)file);
+ result = eina_hash_find(desktop_cache, (char *)file);
/* Check if the cache is still valid. */
if (result)
{
{
if (st.st_mtime > result->mtime)
{
- ecore_hash_remove(desktop_cache, result->original_path);
+ eina_hash_del(desktop_cache, result->original_path);
result = NULL;
}
stated = 1;
/* Timestamp the cache, and no need to stat the file twice if the cache was stale. */
if ((stated) || (stat(result->original_path, &st) >= 0))
result->mtime = st.st_mtime;
- result->group = ecore_hash_get(result->data, "Desktop Entry");
+ result->group = eina_hash_find(result->data, "Desktop Entry");
if (!result->group)
- result->group = ecore_hash_get(result->data, "KDE Desktop Entry");
+ result->group = eina_hash_find(result->data, "KDE Desktop Entry");
/* This is a "Desktop" file, probably an application. */
if (result->group)
{
}
}
- value = ecore_hash_get(result->group, "MimeType");
+ value = eina_hash_find(result->group, "MimeType");
if (value)
result->MimeTypes =
ecore_desktop_paths_to_hash(value);
- value = ecore_hash_get(result->group, "Actions");
+ value = eina_hash_find(result->group, "Actions");
if (value)
result->Actions =
ecore_desktop_paths_to_hash(value);
- value = ecore_hash_get(result->group, "OnlyShowIn");
+ value = eina_hash_find(result->group, "OnlyShowIn");
if (value)
result->OnlyShowIn =
ecore_desktop_paths_to_hash(value);
- value = ecore_hash_get(result->group, "NotShowIn");
+ value = eina_hash_find(result->group, "NotShowIn");
if (value)
result->NotShowIn =
ecore_desktop_paths_to_hash(value);
- value = ecore_hash_get(result->group, "X-KDE-StartupNotify");
+ value = eina_hash_find(result->group, "X-KDE-StartupNotify");
if (value)
result->startup = (strcmp(value, "true") == 0);
- value = ecore_hash_get(result->group, "StartupNotify");
+ value = eina_hash_find(result->group, "StartupNotify");
if (value)
result->startup = (strcmp(value, "true") == 0);
- value = ecore_hash_get(result->group, "X-Enlightenment-WaitExit");
+ value = eina_hash_find(result->group, "X-Enlightenment-WaitExit");
if (value)
result->wait_exit = (strcmp(value, "true") == 0);
- value = ecore_hash_get(result->group, "NoDisplay");
+ value = eina_hash_find(result->group, "NoDisplay");
if (value)
result->no_display = (strcmp(value, "true") == 0);
- value = ecore_hash_get(result->group, "Hidden");
+ value = eina_hash_find(result->group, "Hidden");
if (value)
result->hidden = (strcmp(value, "true") == 0);
}
else
{
/*Maybe it's a 'trash' file - which also follows the Desktop FDO spec */
- result->group = ecore_hash_get(result->data, "Trash Info");
+ result->group = eina_hash_find(result->data, "Trash Info");
if (result->group)
{
IFGETDUP(value, "Path", result->path);
result = NULL;
}
else
- ecore_hash_set(desktop_cache, strdup(result->original_path), result);
+ eina_hash_add(desktop_cache, result->original_path, result);
}
error:
return result;
}
+static Eina_Bool
+_hash_keys(Eina_Hash *hash, const void *key, void *data, void *list)
+{
+ ecore_list_append(list, key);
+ return EINA_TRUE;
+}
+
void
ecore_desktop_save(Ecore_Desktop * desktop)
{
{
desktop->data = ecore_desktop_ini_get(desktop->original_path);
desktop->group =
- (Ecore_Hash *) ecore_hash_get(desktop->data, "Desktop Entry");
+ (Eina_Hash *) eina_hash_find(desktop->data, "Desktop Entry");
if (!desktop->group)
desktop->group =
- (Ecore_Hash *) ecore_hash_get(desktop->data,
+ (Eina_Hash *) eina_hash_find(desktop->data,
"KDE Desktop Entry");
if (!desktop->group)
{
trash = 1;
desktop->group =
- (Ecore_Hash *) ecore_hash_get(desktop->data, "Trash Info");
+ (Eina_Hash *) eina_hash_find(desktop->data, "Trash Info");
}
}
else
- {
- desktop->group = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- if (desktop->group)
- {
- ecore_hash_free_key_cb_set(desktop->group, free);
- ecore_hash_free_value_cb_set(desktop->group, free);
- }
- }
+ desktop->group = eina_hash_string_superfast_new(free);
}
if (desktop->group)
real = ecore_file_readlink(desktop->original_path);
if (real)
- ecore_hash_set(desktop->group,
- strdup("X-Enlightenment-OriginalPath"),
- real);
+ eina_hash_add(desktop->group,
+ "X-Enlightenment-OriginalPath",
+ real);
}
}
commands = ecore_desktop_get_command(desktop, NULL, 0);
if (commands)
{
- temp = ecore_list_first(commands);
- if (temp)
- ecore_hash_set(desktop->group, strdup("Exec"), strdup(temp));
- ecore_list_destroy(commands);
+ temp = ecore_list_first(commands);
+ if (temp)
+ eina_hash_add(desktop->group, "Exec", strdup(temp));
+ ecore_list_destroy(commands);
}
if (desktop->name)
- ecore_hash_set(desktop->group, strdup("Name"),
- strdup(desktop->name));
+ eina_hash_add(desktop->group, "Name",
+ strdup(desktop->name));
if (desktop->generic)
- ecore_hash_set(desktop->group, strdup("GenericName"),
- strdup(desktop->generic));
+ eina_hash_add(desktop->group, "GenericName",
+ strdup(desktop->generic));
if (desktop->comment)
- ecore_hash_set(desktop->group, strdup("Comment"),
- strdup(desktop->comment));
+ eina_hash_add(desktop->group, "Comment",
+ strdup(desktop->comment));
if (desktop->type)
- ecore_hash_set(desktop->group, strdup("Type"),
- strdup(desktop->type));
+ eina_hash_add(desktop->group, "Type",
+ strdup(desktop->type));
if (desktop->URL)
- ecore_hash_set(desktop->group, strdup("URL"), strdup(desktop->URL));
+ eina_hash_add(desktop->group, "URL", strdup(desktop->URL));
if (desktop->file)
- ecore_hash_set(desktop->group, strdup("File"),
- strdup(desktop->file));
+ eina_hash_add(desktop->group, "File",
+ strdup(desktop->file));
if (desktop->icon)
- ecore_hash_set(desktop->group, strdup("Icon"),
- strdup(desktop->icon));
+ eina_hash_add(desktop->group, "Icon",
+ strdup(desktop->icon));
if (desktop->icon_theme)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-IconTheme"),
- strdup(desktop->icon_theme));
+ eina_hash_add(desktop->group, "X-Enlightenment-IconTheme",
+ strdup(desktop->icon_theme));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-IconTheme");
+ eina_hash_del(desktop->group, "X-Enlightenment-IconTheme");
if (desktop->icon_class)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-IconClass"),
- strdup(desktop->icon_class));
+ eina_hash_add(desktop->group, "X-Enlightenment-IconClass",
+ strdup(desktop->icon_class));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-IconClass");
+ eina_hash_del(desktop->group, "X-Enlightenment-IconClass");
if (desktop->icon_path)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-IconPath"),
- strdup(desktop->icon_path));
+ eina_hash_add(desktop->group, "X-Enlightenment-IconPath",
+ strdup(desktop->icon_path));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-IconPath");
+ eina_hash_del(desktop->group, "X-Enlightenment-IconPath");
if (desktop->window_class)
- ecore_hash_set(desktop->group, strdup("StartupWMClass"),
- strdup(desktop->window_class));
+ eina_hash_add(desktop->group, "StartupWMClass",
+ strdup(desktop->window_class));
if (desktop->categories)
- ecore_hash_set(desktop->group, strdup("Categories"),
- strdup(desktop->categories));
+ eina_hash_add(desktop->group, "Categories",
+ strdup(desktop->categories));
if (desktop->window_name)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-WindowName"),
- strdup(desktop->window_name));
+ eina_hash_add(desktop->group, "X-Enlightenment-WindowName",
+ strdup(desktop->window_name));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-WindowName");
+ eina_hash_del(desktop->group, "X-Enlightenment-WindowName");
if (desktop->window_title)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-WindowTitle"),
- strdup(desktop->window_title));
+ eina_hash_add(desktop->group, "X-Enlightenment-WindowTitle",
+ strdup(desktop->window_title));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-WindowTitle");
+ eina_hash_del(desktop->group, "X-Enlightenment-WindowTitle");
if (desktop->window_role)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-WindowRole"),
- strdup(desktop->window_role));
+ eina_hash_add(desktop->group, "X-Enlightenment-WindowRole",
+ strdup(desktop->window_role));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-WindowRole");
- ecore_hash_remove(desktop->group, "X-KDE-StartupNotify");
+ eina_hash_del(desktop->group, "X-Enlightenment-WindowRole");
+ eina_hash_del(desktop->group, "X-KDE-StartupNotify");
if (desktop->wait_exit)
- ecore_hash_set(desktop->group, strdup("X-Enlightenment-WaitExit"),
- strdup("true"));
+ eina_hash_add(desktop->group, "X-Enlightenment-WaitExit",
+ strdup("true"));
else
- ecore_hash_remove(desktop->group, "X-Enlightenment-WaitExit");
+ eina_hash_del(desktop->group, "X-Enlightenment-WaitExit");
if (desktop->startup)
- ecore_hash_set(desktop->group, strdup("StartupNotify"),
- strdup("true"));
+ eina_hash_add(desktop->group, "StartupNotify",
+ strdup("true"));
else
- ecore_hash_remove(desktop->group, "StartupNotify");
+ eina_hash_del(desktop->group, "StartupNotify");
if (desktop->no_display)
- ecore_hash_set(desktop->group, strdup("NoDisplay"), strdup("true"));
+ eina_hash_add(desktop->group, "NoDisplay", strdup("true"));
else
- ecore_hash_remove(desktop->group, "NoDisplay");
+ eina_hash_del(desktop->group, "NoDisplay");
if (desktop->hidden)
- ecore_hash_set(desktop->group, strdup("Hidden"), strdup("true"));
+ eina_hash_add(desktop->group, "Hidden", strdup("true"));
else
- ecore_hash_remove(desktop->group, "Hidden");
+ eina_hash_del(desktop->group, "Hidden");
/* FIXME: deal with the ShowIn's and mime stuff. */
if (desktop->path)
- ecore_hash_set(desktop->group, strdup("Path"),
- strdup(desktop->path));
+ eina_hash_add(desktop->group, "Path",
+ strdup(desktop->path));
if (desktop->deletiondate)
- ecore_hash_set(desktop->group, strdup("DeletionDate"),
- strdup(desktop->deletiondate));
+ eina_hash_add(desktop->group, "DeletionDate",
+ strdup(desktop->deletiondate));
if (desktop->original_path)
{
FILE *f;
Ecore_List *list;
char *key;
+ Eina_Iterator *it = NULL;
ecore_file_unlink(desktop->original_path);
f = fopen(desktop->original_path, "wb");
- list = ecore_hash_keys(desktop->group);
+
+ if ((list = ecore_list_new()))
+ return;
+
+ if ((it = eina_hash_iterator_key_new(desktop->group)))
+ {
+ ecore_list_destroy(list);
+ return;
+ }
+
+ eina_iterator_foreach(it, EINA_EACH(_hash_keys), list);
+ eina_iterator_free(it);
+
if ((!f) || (!list))
return;
{
char *value;
- value = (char *)ecore_hash_get(desktop->group, key);
+ value = (char *)eina_hash_find(desktop->group, key);
if ((value) && (value[0] != '\0'))
fprintf(f, "%s=%s\n", key, value);
}
if (desktop->data)
{
- ecore_hash_destroy(desktop->data);
+ eina_hash_free(desktop->data);
desktop->data = NULL;
}
else
- ecore_hash_destroy(desktop->group);
+ eina_hash_free(desktop->group);
desktop->group = NULL;
}
}
return --init_count;
if (!desktop_cache)
- {
- desktop_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- if (desktop_cache)
- {
- ecore_hash_free_key_cb_set(desktop_cache, free);
- ecore_hash_free_value_cb_set(desktop_cache,
- (Ecore_Free_Cb) _ecore_desktop_destroy);
- }
- }
+ desktop_cache = eina_hash_string_superfast_new(_ecore_desktop_destroy);
if (!ecore_desktop_icon_init())
return --init_count;
if (desktop_cache)
{
- ecore_hash_destroy(desktop_cache);
+ eina_hash_free(desktop_cache);
desktop_cache = NULL;
}
IFFREE(desktop->window_name);
IFFREE(desktop->window_title);
IFFREE(desktop->window_role);
- if (desktop->NotShowIn) ecore_hash_destroy(desktop->NotShowIn);
- if (desktop->OnlyShowIn) ecore_hash_destroy(desktop->OnlyShowIn);
- if (desktop->Categories) ecore_hash_destroy(desktop->Categories);
- if (desktop->MimeTypes) ecore_hash_destroy(desktop->MimeTypes);
- if (desktop->Actions) ecore_hash_destroy(desktop->Actions);
+ if (desktop->NotShowIn) eina_hash_free(desktop->NotShowIn);
+ if (desktop->OnlyShowIn) eina_hash_free(desktop->OnlyShowIn);
+ if (desktop->Categories) eina_hash_free(desktop->Categories);
+ if (desktop->MimeTypes) eina_hash_free(desktop->MimeTypes);
+ if (desktop->Actions) eina_hash_free(desktop->Actions);
if (desktop->data)
{
- ecore_hash_destroy(desktop->data);
+ eina_hash_free(desktop->data);
desktop->data = NULL;
}
desktop->group = NULL;
static const char *ext[] =
{ "", ".edj", ".png", ".svgz", ".svg", ".xpm", NULL }; /* "" is in case the icon already has an extension, search for that first. */
static int init_count = 0;
-static Ecore_Hash *icon_theme_cache = NULL;
+static Eina_Hash *icon_theme_cache = NULL;
/**
* @defgroup Ecore_Desktop_Icon_Group icon theme Functions
#ifdef DEBUG
printf("FDO icon = %s\n", path);
#endif
- found = ecore_hash_get(directory->icons, path);
+ found = eina_hash_find(directory->icons, path);
if (found)
{
found = strdup(found);
return found;
}
-Ecore_Hash *
+Eina_Hash*
ecore_desktop_icon_theme_list(void)
{
static int loaded = 0;
return init_count;
if (!icon_theme_cache)
- {
- icon_theme_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- if (icon_theme_cache)
- {
- ecore_hash_free_key_cb_set(icon_theme_cache, free);
- ecore_hash_free_value_cb_set(icon_theme_cache,
- ECORE_FREE_CB(_ecore_desktop_icon_theme_destroy));
- }
- }
+ icon_theme_cache = eina_hash_string_superfast_new(_ecore_desktop_icon_theme_destroy);
return init_count;
}
if (icon_theme_cache)
{
- ecore_hash_destroy(icon_theme_cache);
+ eina_hash_free(icon_theme_cache);
icon_theme_cache = NULL;
}
* Get the contents of an index.theme file.
*
* Everything that is in the index.theme file is returned in the
- * data member of the Ecore_Desktop_Icon_Theme structure, it's an Ecore_Hash
+ * data member of the Ecore_Desktop_Icon_Theme structure, it's an Eina_Hash
* as returned by ecore_desktop_ini_get(). Some of the data in the
* index.theme file is decoded into specific members of the returned
* structure.
#endif
}
- result = ecore_hash_get(icon_theme_cache, icon_theme);
+ result = eina_hash_find(icon_theme_cache, icon_theme);
if (result) goto done;
if (!theme_dir)
{
if (!result) goto error;
result->data = ecore_desktop_ini_get(theme_path);
if (!result->data) goto error;
- result->group = ecore_hash_get(result->data, "Icon Theme");
+ result->group = eina_hash_find(result->data, "Icon Theme");
if (!result->group) goto error;
result->hicolor = 1;
/* According to the spec, name and comment are required, but we can fake those easily enough. */
- value = ecore_hash_get(result->group, "Name");
+ value = eina_hash_find(result->group, "Name");
if (!value) value = icon_theme;
result->name = strdup(value);
- value = ecore_hash_get(result->group, "Comment");
+ value = eina_hash_find(result->group, "Comment");
if (!value) value = "No comment provided.";
result->comment = strdup(value);
- value = ecore_hash_get(result->group, "Inherits");
+ value = eina_hash_find(result->group, "Inherits");
if (value)
{
result->inherits = strdup(value);
if (result->inherits)
result->Inherits = ecore_desktop_paths_to_list(result->inherits);
}
- value = ecore_hash_get(result->group, "Example");
+ value = eina_hash_find(result->group, "Example");
if (!value) value = "exec";
result->example = strdup(value);
- value = ecore_hash_get(result->group, "Directories");
+ value = eina_hash_find(result->group, "Directories");
/* FIXME: Directories is also required, don't feel like faking it for now. */
if (!value) goto error;
result->directories = strdup(value);
ecore_list_first_goto(Directories);
while ((directory = ecore_list_next(Directories)) != NULL)
{
- Ecore_Hash *sub_group;
+ Eina_Hash *sub_group;
Ecore_Desktop_Icon_Theme_Directory *dir;
/* Get the details for this theme directory. */
- sub_group = ecore_hash_get(result->data, directory);
+ sub_group = eina_hash_find(result->data, directory);
dir = calloc(1, sizeof (Ecore_Desktop_Icon_Theme_Directory));
if ((dir) && (sub_group))
{
dir->path = strdup(directory);
snprintf(full_path, PATH_MAX, "%s/%s", theme_dir, directory);
dir->full_path = strdup(full_path);
- value = ecore_hash_get(sub_group, "Type");
+ value = eina_hash_find(sub_group, "Type");
if (!value)
value = "Threshold";
dir->type = strdup(value);
- size = ecore_hash_get(sub_group, "Size");
- minsize = ecore_hash_get(sub_group, "MinSize");
- maxsize = ecore_hash_get(sub_group, "MaxSize");
- threshold = ecore_hash_get(sub_group, "Threshold");
+ size = eina_hash_find(sub_group, "Size");
+ minsize = eina_hash_find(sub_group, "MinSize");
+ maxsize = eina_hash_find(sub_group, "MaxSize");
+ threshold = eina_hash_find(sub_group, "Threshold");
if (size)
{
if (!minsize)
/* This passes the basic validation tests, mark it as real and cache it. */
result->path = strdup(theme_path);
- ecore_hash_set(icon_theme_cache, strdup(icon_theme), result);
- ecore_hash_destroy(result->data);
+ eina_hash_add(icon_theme_cache, icon_theme, result);
+ eina_hash_free(result->data);
result->data = NULL;
result->group = NULL;
if (theme_path) free(theme_path);
if (result)
{
- if (result->data) ecore_hash_destroy(result->data);
+ if (result->data) eina_hash_free(result->data);
_ecore_desktop_icon_theme_destroy(result);
}
return NULL;
if (icon_theme_directory->type)
free(icon_theme_directory->type);
if (icon_theme_directory->icons)
- ecore_hash_destroy(icon_theme_directory->icons);
+ eina_hash_free(icon_theme_directory->icons);
free(icon_theme_directory);
}
{
if (dir->icons)
{
- ecore_hash_destroy(dir->icons);
+ eina_hash_free(dir->icons);
dir->icons = NULL;
}
- dir->icons = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ dir->icons = eina_hash_string_superfast_new(NULL);
if (dir->icons)
{
Ecore_List *files;
- ecore_hash_free_key_cb_set(dir->icons, free);
- ecore_hash_free_value_cb_set(dir->icons, free);
files = ecore_file_ls(dir->full_path);
if (files)
{
while ((file = ecore_list_next(files)))
{
snprintf(full_path, PATH_MAX, "%s/%s", dir->full_path, file);
- ecore_hash_set(dir->icons, strdup(file), strdup(full_path));
+ eina_hash_add(dir->icons, file, strdup(full_path));
}
ecore_list_destroy(files);
}
struct _ecore_desktop_menu_expand_apps_data
{
char *path;
- Ecore_Hash *pool;
+ Eina_Hash *pool;
int length;
};
{
char *name, *path;
Ecore_Desktop_Tree *rules;
- Ecore_Hash *pool, *apps;
+ Eina_Hash *pool, *apps;
int unallocated;
Ecore_Desktop_Tree *rule;
static int _ecore_desktop_menu_expand_apps(struct
_ecore_desktop_menu_unxml_data
*unxml_data, char *app_dir,
- Ecore_Hash * pool);
+ Eina_Hash * pool);
static int _ecore_desktop_menu_check_app(void *data, const char *path);
static int _ecore_desktop_menu_merge(const void *data,
EAPI void
ecore_desktop_menu_for_each(void (*func)
- (const char *name, const char *path, const char *directory, Ecore_Hash * apps))
+ (const char *name, const char *path, const char *directory, Eina_Hash * apps))
{
char *menu_file;
char *path;
char *name;
char *directory;
- Ecore_Hash *apps;
+ Eina_Hash *apps;
void (*func) (char *name, char *path, char *directory,
- Ecore_Hash * apps);
+ Eina_Hash * apps);
func = data;
name = (char *)tree->elements[element].element;
else
directory = NULL;
path = (char *)tree->elements[element + 1].element;
-// pool = (Ecore_Hash *) tree->elements[element + 2].element;
- apps = (Ecore_Hash *) tree->elements[element + 4].element;
+// pool = (Eina_Hash *) tree->elements[element + 2].element;
+ apps = (Eina_Hash *) tree->elements[element + 4].element;
path = &path[11];
#ifdef DEBUG
printf("OUTPUTTING MENU - %s \t\t%s \t\t%s\n", path, name, directory);
_ecore_desktop_menu_create_menu()
{
Ecore_Desktop_Tree *menu, *rules;
- Ecore_Hash *pool, *apps;
+ Eina_Hash *pool, *apps;
menu = ecore_desktop_tree_new(NULL);
rules = ecore_desktop_tree_new(NULL);
- pool = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- apps = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ pool = eina_hash_string_superfast_new(free);
+ apps = eina_hash_string_superfast_new(free);
if ((menu) && (rules) && (pool) && (apps))
{
- ecore_hash_free_key_cb_set(pool, free);
- ecore_hash_free_value_cb_set(pool, free);
- ecore_hash_free_key_cb_set(apps, free);
- ecore_hash_free_value_cb_set(apps, free);
ecore_desktop_tree_extend(menu, "<MENU < > <> <>");
ecore_desktop_tree_extend(menu, "<MENU_PATH ");
ecore_desktop_tree_add_hash(menu, pool);
else
{
if (apps)
- ecore_hash_destroy(apps);
+ eina_hash_free(apps);
if (pool)
- ecore_hash_destroy(pool);
+ eina_hash_free(pool);
if (rules)
ecore_desktop_tree_del(rules);
if (menu)
}
else if (strcmp(".desktop", &file[count - 8]) == 0)
{
- Ecore_Hash *pool;
+ Eina_Hash *pool;
Ecore_Desktop_Tree *rules;
- pool = (Ecore_Hash *) legacy_data->current->elements[2].element;
+ pool = (Eina_Hash *) legacy_data->current->elements[2].element;
rules =
(Ecore_Desktop_Tree *) legacy_data->current->elements[3].element;
if (rules->size == 0)
ecore_desktop_tree_add_child(rules, new_rules);
}
sprintf(temp, "%s%s", legacy_data->prefix, file);
- ecore_hash_set(pool, strdup(temp), strdup(path));
+ eina_hash_add(pool, temp, strdup(path));
#ifdef DEBUG
// printf
// ("POOLING - _ecore_desktop_menu_legacy_menu(void *data, %s) - %s - %s\n",
static int
_ecore_desktop_menu_expand_apps(struct _ecore_desktop_menu_unxml_data
- *unxml_data, char *app_dir, Ecore_Hash * pool)
+ *unxml_data, char *app_dir, Eina_Hash * pool)
{
if (pool)
{
char *file;
file = strdup(path + our_data->length);
- if ((file) && (path))
+ if (file)
{
- for (i = 0; file[i] != '\0'; i++)
- if (file[i] == '/')
- file[i] = '-';
- ecore_hash_set(our_data->pool, file, strdup(path));
+ if (path)
+ {
+ for (i = 0; file[i] != '\0'; i++)
+ if (file[i] == '/')
+ file[i] = '-';
+ eina_hash_add(our_data->pool, file, strdup(path));
+ }
+ free(file);
+ }
#ifdef DEBUG
// printf
// ("POOLING - _ecore_desktop_menu_check_app(void *data, %s) - %s\n",
generate_data.unallocated = unxml_data->unallocated;
generate_data.name = (char *)tree->elements[element].element;
generate_data.path = (char *)tree->elements[element + 1].element;
- generate_data.pool = (Ecore_Hash *) tree->elements[element + 2].element;
+ generate_data.pool = (Eina_Hash *) tree->elements[element + 2].element;
generate_data.rules = (Ecore_Desktop_Tree *) tree->elements[element + 3].element;
- generate_data.apps = (Ecore_Hash *) tree->elements[element + 4].element;
+ generate_data.apps = (Eina_Hash *) tree->elements[element + 4].element;
/* generate and inherit the pools on the first pass, and preparse the include/exclude logic. */
if (!generate_data.unallocated)
{
if (unxml_data->stack->elements[i].type == ECORE_DESKTOP_TREE_ELEMENT_TYPE_HASH)
{
- Ecore_Hash *ancestor;
+ Eina_Hash *ancestor;
- ancestor = (Ecore_Hash *) unxml_data->stack->elements[i].element;
- ecore_hash_for_each_node(ancestor, _ecore_desktop_menu_inherit_apps, generate_data.pool);
+ ancestor = (Eina_Hash *) unxml_data->stack->elements[i].element;
+ eina_hash_foreach(ancestor, _ecore_desktop_menu_inherit_apps, generate_data.pool);
}
}
}
if (type == 'I')
{
generate_data.include = TRUE;
- ecore_hash_for_each_node(generate_data.pool, _ecore_desktop_menu_select_app, &generate_data);
+ eina_hash_foreach(generate_data.pool, _ecore_desktop_menu_select_app, &generate_data);
}
else
{
generate_data.include = FALSE;
- ecore_hash_for_each_node(generate_data.apps, _ecore_desktop_menu_select_app, &generate_data);
+ eina_hash_foreach(generate_data.apps, _ecore_desktop_menu_select_app, &generate_data);
}
}
}
return 0;
}
-static void
-_ecore_desktop_menu_inherit_apps(void *value, void *user_data)
+static Eina_Bool
+_ecore_desktop_menu_inherit_apps(const Eina_Hash *hash, const void *key, void *value, void *user_data)
{
- Ecore_Hash_Node *node;
- Ecore_Hash *pool;
- char *key, *app;
-
- pool = (Ecore_Hash *) user_data;
- node = (Ecore_Hash_Node *) value;
- key = (char *)node->key;
- app = (char *)node->value;
#ifdef DEBUG
// printf("CHECKING %s - %s\n", app, key);
#endif
- if (!ecore_hash_get(pool, key))
- ecore_hash_set(pool, strdup(key), strdup(app));
+ if (!eina_hash_find(user_data, key))
+ eina_hash_add(user_data, key, strdup(value));
}
static void
-_ecore_desktop_menu_select_app(void *value, void *user_data)
+_ecore_desktop_menu_select_app(const Eina_Hash *hash, const void *key, void *value, void *user_data)
{
- Ecore_Hash_Node *node;
Ecore_Desktop *desktop;
struct _ecore_desktop_menu_generate_data *generate_data;
- char *key, *app;
- node = (Ecore_Hash_Node *) value;
generate_data = (struct _ecore_desktop_menu_generate_data *)user_data;
- key = (char *)node->key;
- app = (char *)node->value;
/* FIXME: pass an actuall language parameter. */
- desktop = ecore_desktop_get(app, NULL);
+ desktop = ecore_desktop_get(value, NULL);
if (desktop)
{
desktop->allocated = TRUE;
if (generate_data->include)
{
- ecore_hash_set(generate_data->apps, key, strdup(app));
+ eina_hash_add(generate_data->apps, key, strdup(value));
#ifdef DEBUG
- printf("INCLUDING %s%s - %s\n", ((generate_data->unallocated) ? "UNALLOCATED " : ""), app, key);
+ printf("INCLUDING %s%s - %s\n", ((generate_data->unallocated) ? "UNALLOCATED " : ""), value, key);
#endif
}
else
{
- ecore_hash_remove(generate_data->apps, key);
+ eina_hash_del(generate_data->apps, key);
#ifdef DEBUG
- printf("EXCLUDING %s%s - %s\n", ((generate_data->unallocated) ? "UNALLOCATED " : ""), app, key);
+ printf("EXCLUDING %s%s - %s\n", ((generate_data->unallocated) ? "UNALLOCATED " : ""), value, key);
#endif
}
}
case 'C':
{
/* Try to match a category. */
- if ((desktop->Categories) && (ecore_hash_get(desktop->Categories, &rul[4]) != NULL))
+ if ((desktop->Categories) && (eina_hash_find(desktop->Categories, &rul[4]) != NULL))
sub_result = TRUE;
break;
}
}
#endif
-/** Split a list of paths into an Ecore_Hash.
+/** Split a list of paths into an Eina_Hash.
*
* The list of paths can use any one of ;:, to seperate the paths.
* You can also escape the :;, with \.
*
* @param paths A list of paths.
*/
-Ecore_Hash *
+Eina_Hash*
ecore_desktop_paths_to_hash(const char *paths)
{
- Ecore_Hash *result;
+ Eina_Hash *result;
char *path;
char buf[PATH_MAX], *p, *pp;
if (!paths) return NULL;
- result = ecore_hash_new(ecore_str_hash, ecore_str_compare);
+ result = eina_hash_string_superfast_new(free);
if (!result) return NULL;
- ecore_hash_free_key_cb_set(result, free);
- ecore_hash_free_value_cb_set(result, free);
path = strdup(paths);
if (path)
p++;
}
*pp = '\0';
- if (*buf) ecore_hash_set(result, strdup(buf), strdup(buf));
+ if (*buf) eina_hash_add(result, buf, strdup(buf));
if (*p) p++;
else p = NULL;
}
return result;
}
-/** Split a list of paths into an Ecore_Hash.
+/** Split a list of paths into an Eina_Hash.
*
* The list of paths can use any one of ;:, to seperate the paths.
* You can also escape the :;, with \.
#include "Ecore_Desktop.h"
#include "ecore_desktop_private.h"
-static void ecore_desktop_tree_dump_each_hash_node(void *value,
- void *user_data);
+static Eina_Bool
+ecore_desktop_tree_dump_each_hash_node(const Eina_Hash *hash,
+ const void *key,
+ void *value,
+ void *user_data);
/* Just a quick and dirty tree implemtation that will likely get replaced by
* something much saner at a later date. I wrote most of this while falling
}
Ecore_Desktop_Tree *
-ecore_desktop_tree_add_hash(Ecore_Desktop_Tree * tree, Ecore_Hash * element)
+ecore_desktop_tree_add_hash(Ecore_Desktop_Tree * tree, Eina_Hash * element)
{
tree->elements =
(Ecore_Desktop_Tree_Element *) realloc(tree->elements,
lev = level + 1;
printf("HASH ELEMENT TYPE\n");
- ecore_hash_for_each_node((Ecore_Hash *) tree->elements[i].
- element,
- ecore_desktop_tree_dump_each_hash_node,
- &lev);
+ eina_hash_foreach((Eina_Hash *) tree->elements[i].
+ element,
+ ecore_desktop_tree_dump_each_hash_node,
+ &lev);
}
break;
}
}
-static void
-ecore_desktop_tree_dump_each_hash_node(void *value, void *user_data)
+static Eina_Bool
+ecore_desktop_tree_dump_each_hash_node(const Eina_Hash *hash,
+ const void *key,
+ void *value,
+ void *user_data)
{
- Ecore_Hash_Node *node;
int level;
int j;
- node = (Ecore_Hash_Node *) value;
level = *((int *)user_data);
for (j = 0; j < level; j++)
printf(".");
- printf("%s = %s\n", (char *)node->key, (char *)node->value);
+ printf("%s = %s\n", (char *)key, (char *)value);
}
void
ecore_desktop_tree_del((Ecore_Desktop_Tree *) tree->elements[i].
element);
else if (tree->elements[i].type == ECORE_DESKTOP_TREE_ELEMENT_TYPE_HASH)
- ecore_hash_destroy((Ecore_Hash *) tree->elements[i].element);
+ eina_hash_free((Eina_Hash *) tree->elements[i].element);
}
E_FREE(tree->elements);
static Ecore_Fd_Handler *_input_event_fd_handler_handle = NULL;
/* this hash is to store all the possible key names for fast lookup */
-static Ecore_Hash *_ecore_directfb_key_symbols_hash = NULL;
+static Eina_Hash *_ecore_directfb_key_symbols_hash = NULL;
static IDirectFB *_dfb = NULL; // the main interface
{
case DFEC_INPUT:
key_symbol = evt->input.key_symbol;
- k = ecore_hash_get(_ecore_directfb_key_symbols_hash, &key_symbol);
+ k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
if(!k)
{
case DFEC_WINDOW:
key_symbol = evt->window.key_symbol;
- k = ecore_hash_get(_ecore_directfb_key_symbols_hash, &key_symbol);
+ k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
if(!k)
{
{
case DFEC_INPUT:
key_symbol = evt->input.key_symbol;
- k = ecore_hash_get(_ecore_directfb_key_symbols_hash, &key_symbol);
+ k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
if(!k)
case DFEC_WINDOW:
key_symbol = evt->window.key_symbol;
- k = ecore_hash_get(_ecore_directfb_key_symbols_hash, &key_symbol);
+ k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
if(!k)
{
ECORE_DIRECTFB_EVENT_WHEEL = ecore_event_type_new();;
/* create the hash table for the keynames */
- _ecore_directfb_key_symbols_hash = ecore_hash_new(_ecore_directfb_hash_create,_ecore_directfb_hash_compare);
+ _ecore_directfb_key_symbols_hash = eina_hash_int32_new(NULL);
for(i=0; i<_ecore_directfb_key_symbols_count; i++)
{
struct keymap *k;
k = malloc(sizeof(struct keymap));
k->name = _ecore_directfb_key_symbols[i].name;
k->string = _ecore_directfb_key_symbols[i].string;
- ecore_hash_set(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id, k);
+ eina_hash_add(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id, k);
}
/* create the hash for the windows(key = windowid, val = Ecore_DirectFB_Window struct) */
return _ecore_directfb_init_count;
for(i=0; i<_ecore_directfb_key_symbols_count; i++)
{
struct keymap *k;
- k = ecore_hash_get(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id);
- ecore_hash_remove(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id);
+ k = eina_hash_find(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id);
+ eina_hash_del(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id);
free(k);
}
if (!key) return NULL;
- return evas_hash_find(ee->data, key);
+ return eina_hash_find(ee->data, key);
}
/**
if (!key) return;
- ee->data = evas_hash_del(ee->data, key, NULL);
+ eina_hash_del(ee->data, key, NULL);
if (data)
- ee->data = evas_hash_add(ee->data, key, data);
+ {
+ if (!ee->data)
+ ee->data = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ee->data, key, data);
+ }
}
#define IFC(_ee, _fn) if (_ee->engine.func->_fn) {_ee->engine.func->_fn
{
_ecore_evas_free(ee->sub_ecore_evas->data);
}
- if (ee->data) evas_hash_free(ee->data);
+ if (ee->data) eina_hash_free(ee->data);
if (ee->name) free(ee->name);
if (ee->prop.title) free(ee->prop.title);
if (ee->prop.name) free(ee->prop.name);
static Ecore_Event_Handler *ecore_evas_event_handlers[13];
static Ecore_Evas *ecore_evases = NULL;
-static Evas_Hash *ecore_evases_hash = NULL;
+static Eina_Hash *ecore_evases_hash = NULL;
static Ecore_Idle_Enterer *ecore_evas_directfb_idle_enterer = NULL;
static Ecore_Evas *
_ecore_evas_directfb_match(DFBWindowID win)
-{
+{
Ecore_Evas *ee;
-
- ee = evas_hash_find(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(win));
+
+ ee = eina_hash_find(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(win));
return ee;
}
-
-static void
+
+static void
_ecore_evas_directfb_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timestamp)
{
ee->mouse.x = x;
ee->mouse.y = y;
-
+
if (ee->prop.cursor.object)
{
evas_object_show(ee->prop.cursor.object);
ecore_evas_event_handlers[10] = NULL;
ecore_evas_event_handlers[11] = NULL;
ecore_evas_event_handlers[12] = NULL;
-
+
return _ecore_evas_init_count;
}
/* engine functions */
/********************/
-
+
static void
_ecore_evas_directfb_free(Ecore_Evas *ee)
{
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
ecore_directfb_window_del(ee->engine.directfb.window);
- ecore_evases = _ecore_list2_remove(ecore_evases, ee);
+ ecore_evases = _ecore_list2_remove(ecore_evases, ee);
_ecore_evas_directfb_shutdown();
ecore_directfb_shutdown();
}
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
-
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
+
return ee;
#else
disp_name = NULL;
windowed = x = y = w = h = 0;
return NULL;
-#endif
+#endif
}
Eina_Bool should_be_visible : 1;
Eina_Bool alpha : 1;
- Evas_Hash *data;
+ Eina_Hash *data;
struct {
int x, y;
static Ecore_Event_Handler *ecore_evas_event_handlers[ECORE_EVAS_EVENT_COUNT];
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
static Ecore_Evas *ecore_evases = NULL;
-static Evas_Hash *ecore_evases_hash = NULL;
+static Eina_Hash *ecore_evases_hash = NULL;
static int _ecore_evas_win32_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event);
{
Ecore_Evas *ee;
- ee = evas_hash_find(ecore_evases_hash, _ecore_evas_win32_winid_str_get(window));
+ ee = eina_hash_find(ecore_evases_hash, _ecore_evas_win32_winid_str_get(window));
return ee;
}
_ecore_evas_win32_free(Ecore_Evas *ee)
{
ecore_win32_window_del(ee->engine.win32.window);
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_win32_winid_str_get(ee->engine.win32.window), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_win32_winid_str_get(ee->engine.win32.window), ee);
ecore_evases = _ecore_list2_remove(ecore_evases, ee);
_ecore_evas_win32_shutdown();
ecore_win32_shutdown();
evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_win32_winid_str_get(ee->engine.win32.window), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_win32_winid_str_get(ee->engine.win32.window), ee);
return ee;
}
static Ecore_Event_Handler *ecore_evas_event_handlers[ECORE_EVAS_EVENT_COUNT];
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
static Ecore_Evas *ecore_evases = NULL;
-static Evas_Hash *ecore_evases_hash = NULL;
+static Eina_Hash *ecore_evases_hash = NULL;
static int _ecore_evas_wince_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event);
{
Ecore_Evas *ee;
- ee = evas_hash_find(ecore_evases_hash, _ecore_evas_wince_winid_str_get(window));
+ ee = eina_hash_find(ecore_evases_hash, _ecore_evas_wince_winid_str_get(window));
return ee;
}
_ecore_evas_wince_free(Ecore_Evas *ee)
{
ecore_wince_window_del(ee->engine.wince.window);
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_wince_winid_str_get(ee->engine.wince.window), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_wince_winid_str_get(ee->engine.wince.window), ee);
ecore_evases = _ecore_list2_remove(ecore_evases, ee);
_ecore_evas_wince_shutdown();
ecore_wince_shutdown();
evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_wince_winid_str_get(ee->engine.wince.window), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_wince_winid_str_get(ee->engine.wince.window), ee);
return ee;
}
static int _ecore_evas_fps_debug = 0;
static Ecore_Evas *ecore_evases = NULL;
-static Evas_Hash *ecore_evases_hash = NULL;
+static Eina_Hash *ecore_evases_hash = NULL;
static Ecore_Event_Handler *ecore_evas_event_handlers[18];
static Ecore_Idle_Enterer *ecore_evas_idle_enterer = NULL;
{
Ecore_Evas *ee;
- ee = evas_hash_find(ecore_evases_hash, _ecore_evas_x_winid_str_get(win));
+ ee = eina_hash_find(ecore_evases_hash, _ecore_evas_x_winid_str_get(win));
return ee;
}
#else
ee->engine.x.damages = 0;
#endif /* ! HAVE_ECORE_X_XCB */
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
while (ee->engine.x.win_extra)
{
Ecore_X_Window *winp;
winp = ee->engine.x.win_extra->data;
ee->engine.x.win_extra = eina_list_remove_list(ee->engine.x.win_extra, ee->engine.x.win_extra);
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(*winp), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(*winp), ee);
free(winp);
}
ecore_evases = _ecore_list2_remove(ecore_evases, ee);
ee->shaped = 0;
ee->alpha = alpha;
ecore_x_window_del(ee->engine.x.win);
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
if (ee->alpha)
{
if (ee->prop.override)
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
if (ee->prop.borderless)
ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
if (ee->visible) ecore_x_window_show(ee->engine.x.win);
ee->shaped = 0;
ee->alpha = alpha;
ecore_x_window_del(ee->engine.x.win);
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
if (ee->alpha)
{
if (ee->prop.override)
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
if (ee->prop.borderless)
ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
if (ee->visible) ecore_x_window_show(ee->engine.x.win);
ee->shaped = 0;
ee->alpha = alpha;
ecore_x_window_del(ee->engine.x.win);
- ecore_evases_hash = evas_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ eina_hash_del(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
if (ee->alpha)
{
if (ee->prop.override)
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
ecore_x_window_shape_mask_set(ee->engine.x.win, 0);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
if (ee->prop.borderless)
ecore_x_mwm_borderless_set(ee->engine.x.win, ee->prop.borderless);
if (ee->visible) ecore_x_window_show(ee->engine.x.win);
evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
return ee;
#else
return NULL;
{
*winp = win;
ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee);
}
#else
#endif
evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
# endif /* HAVE_ECORE_X_XCB */
return ee;
evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
return ee;
#else
return NULL;
evas_key_lock_add(ee->evas, "Scroll_Lock");
ecore_evases = _ecore_list2_prepend(ecore_evases, ee);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
+ if (!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(ee->engine.x.win), ee);
return ee;
#else
return NULL;
{
*winp = win;
ee->engine.x.win_extra = eina_list_append(ee->engine.x.win_extra, winp);
- ecore_evases_hash = evas_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee);
+ if(!ecore_evases_hash)
+ ecore_evases_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(ecore_evases_hash, _ecore_evas_x_winid_str_get(win), ee);
}
#else
#endif /* ! BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
static void _ecore_imf_module_free(Ecore_IMF_Module *module);
static int _ecore_imf_modules_exists(const char *ctx_id);
+typedef struct _Ecore_IMF_Selector
+{
+ const char *toselect;
+ void *selected;
+} Ecore_IMF_Selector;
+
static Ecore_Path_Group *ecore_imf_modules_path = NULL;
-static Ecore_Hash *modules = NULL;
+static Eina_Hash *modules = NULL;
void
ecore_imf_module_init(void)
{
if (modules)
{
- ecore_hash_destroy(modules);
+ eina_hash_free(modules);
modules = NULL;
}
ecore_imf_modules_path = NULL;
}
+static Eina_Bool
+_hash_module_available_get(const Eina_Hash *hash, int *data, void *list)
+{
+ ecore_list_append(list, data);
+ return EINA_TRUE;
+}
+
Ecore_List *
ecore_imf_module_available_get(void)
{
Ecore_List *values;
+ Eina_Iterator *it = NULL;
unsigned int i = 0;
if (!modules) return NULL;
- /* ecore_hash_values() */
values = ecore_list_new();
- while (i < ecore_prime_table[modules->size])
- {
- if (modules->buckets[i])
- {
- Ecore_Hash_Node *node;
+ if (!values) return NULL;
- for (node = modules->buckets[i]; node; node = node->next)
- ecore_list_append(values, node->value);
- }
- i++;
+ it = eina_hash_iterator_data_new(modules);
+ if (!it)
+ {
+ ecore_list_destroy(values);
+ return NULL;
}
+
+ eina_iterator_foreach(it, EINA_EACH(_hash_module_available_get), values);
+ eina_iterator_free(it);
+
ecore_list_first_goto(values);
return values;
ecore_imf_module_get(const char *ctx_id)
{
if (!modules) return NULL;
- return ecore_hash_get(modules, ctx_id);
+ return eina_hash_find(modules, ctx_id);
}
Ecore_IMF_Context *
Ecore_IMF_Context *ctx = NULL;
if (!modules) return NULL;
- module = ecore_hash_get(modules, ctx_id);
+ module = eina_hash_find(modules, ctx_id);
if (module)
{
ctx = module->create();
return ctx;
}
+static Eina_Bool
+_hash_ids_get(const Eina_Hash *hash, const char *key, void *list)
+{
+ ecore_list_append(list, key);
+ return EINA_TRUE;
+}
+
Ecore_List *
ecore_imf_module_context_ids_get(void)
{
+ Ecore_List *l = NULL;
+ Eina_Iterator *it = NULL;
+
if (!modules) return NULL;
- return ecore_hash_keys(modules);
+
+ l = ecore_list_new();
+ if (!l) return NULL;
+
+ it = eina_hash_iterator_key_new(modules);
+ if (!it)
+ {
+ ecore_list_destroy(l);
+ return NULL;
+ }
+
+ eina_iterator_foreach(it, EINA_EACH(_hash_ids_get), l);
+ eina_iterator_free(it);
+
+ return l;
+}
+
+static Eina_Bool
+_hash_ids_by_canvas_type_get(const Eina_Hash *hash, int *data, void *fdata)
+{
+ Ecore_IMF_Module *module = data;
+ Ecore_IMF_Selector *selector = fdata;
+
+ if (!strcmp(module->info->canvas_type, selector->toselect))
+ ecore_list_append(selector->selected, (void *)module->info->id);
+
+ return EINA_TRUE;
}
Ecore_List *
ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type)
{
+ Ecore_IMF_Selector selector;
Ecore_List *values;
+ Eina_Iterator *it = NULL;
unsigned int i = 0;
if (!modules) return NULL;
return ecore_imf_module_context_ids_get();
values = ecore_list_new();
- while (i < ecore_prime_table[modules->size])
+ if (!values) return NULL;
+
+ it = eina_hash_iterator_data_new(modules);
+ if (!it)
{
- if (modules->buckets[i])
- {
- Ecore_Hash_Node *node;
-
- for (node = modules->buckets[i]; node; node = node->next)
- {
- Ecore_IMF_Module *module = node->value;
- if (strcmp(module->info->canvas_type, canvas_type) == 0)
- ecore_list_append(values, (void *) module->info->id);
- }
- }
- i++;
+ ecore_list_destroy(values);
+ return NULL;
}
+
+ selector.toselect = canvas_type;
+ selector.selected = values;
+ eina_iterator_foreach(it, EINA_EACH(_hash_ids_by_canvas_type_get), &selector);
+ eina_iterator_free(it);
+
ecore_list_first_goto(values);
return values;
Ecore_IMF_Module *module;
if (!modules)
- {
- modules = ecore_hash_new(ecore_str_hash, ecore_str_compare);
- ecore_hash_free_key_cb_set(modules, free);
- ecore_hash_free_value_cb_set(modules, (Ecore_Free_Cb) _ecore_imf_module_free);
- }
+ modules = eina_hash_string_superfast_new(_ecore_imf_module_free);
module = malloc(sizeof(Ecore_IMF_Module));
module->plugin = plugin;
/* cache imf_module_create as it may be used several times */
module->create = imf_module_create;
- ecore_hash_set(modules, strdup(info->id), module);
+ eina_hash_add(modules, info->id, module);
}
static void
static int
_ecore_imf_modules_exists(const char *ctx_id)
{
+ Eina_Iterator *it = NULL;
+
if (!modules) return 0;
- return (ecore_hash_get(modules, ctx_id) != NULL);
+ if (!ctx_id) return 0;
+
+ if (eina_hash_find(modules, ctx_id))
+ return 1;
+
+ return 0;
}
* Local variables
*/
-static Ecore_Hash *startup_info = NULL;
+static Eina_Hash *startup_info = NULL;
/**
* Initialize the NetWM module
EAPI void
ecore_x_netwm_init(void)
{
- startup_info = ecore_hash_new(ecore_direct_hash, ecore_direct_compare);
- if (startup_info)
- {
- ecore_hash_free_value_cb_set(startup_info, _ecore_x_netwm_startup_info_free);
- }
+ startup_info = eina_hash_string_superfast_new(_ecore_x_netwm_startup_info_free);
}
/**
ecore_x_netwm_shutdown(void)
{
if (startup_info)
- ecore_hash_destroy(startup_info);
+ eina_hash_free(startup_info);
startup_info = NULL;
}
{
#if 0
Ecore_X_Startup_Info *info;
+ unsigned char exists = 0;
if (!startup_info) return 0;
- info = ecore_hash_get(startup_info, (void *)window);
+ info = eina_hash_find(startup_info, (void *)window);
if (info)
{
+ exists = 1;
printf("Already got info for win: 0x%x\n", window);
_ecore_x_netwm_startup_info_free(info);
}
memcpy(info->buffer, data, 20);
info->length += 20;
info->buffer[info->length] = 0;
- ecore_hash_set(startup_info, (void *)info->win, info);
+ if (exists)
+ eina_hash_modify(startup_info, (void *)info->win, info);
+ else
+ eina_hash_add(startup_info, (void *)info->win, info);
if (strlen(info->buffer) != 20)
{
/* We have a '\0' in there, the message is done */
char *p;
if (!startup_info) return 0;
- info = ecore_hash_get(startup_info, (void *)window);
+ info = eina_hash_find(startup_info, (void *)window);
if (!info) return 0;
if ((info->length + 20) > info->buffer_size)
{
info->buffer = realloc(info->buffer, info->buffer_size * sizeof(char));
if (!info->buffer)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
p = strchr(info->buffer, ':');
if (!p)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
event = ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE;
else
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
if (!_ecore_x_netwm_startup_info_parse(info, p))
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
e = calloc(1, sizeof(Ecore_X_Event_Startup_Sequence));
if (!e)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
if (event == ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
}
else
* Local variables
*/
-static Ecore_Hash *startup_info = NULL;
+static Eina_Hash *startup_info = NULL;
EAPI void
ecore_x_netwm_init(void)
{
- startup_info = ecore_hash_new(ecore_direct_hash, ecore_direct_compare);
- if (startup_info)
- ecore_hash_free_value_cb_set(startup_info, _ecore_x_netwm_startup_info_free);
+ startup_info = eina_hash_string_superfast_new(_ecore_x_netwm_startup_info_free);
}
EAPI void
ecore_x_netwm_shutdown(void)
{
if (startup_info)
- ecore_hash_destroy(startup_info);
+ eina_hash_free(startup_info);
startup_info = NULL;
}
{
#if 0
Ecore_X_Startup_Info *info;
+ unsigned char *exists = 0;
if (!startup_info) return 0;
- info = ecore_hash_get(startup_info, (void *)win);
+ info = eina_hash_find(startup_info, (void *)win);
if (info)
{
+ exists = 1;
printf("Already got info for win: 0x%x\n", win);
_ecore_x_netwm_startup_info_free(info);
}
memcpy(info->buffer, data, 20);
info->length += 20;
info->buffer[info->length] = 0;
- ecore_hash_set(startup_info, (void *)info->win, info);
+ if (exists)
+ eina_hash_modify(startup_info, (void *)info->win, info);
+ else
+ eina_hash_add(startup_info, (void *)info->win, info);
if (strlen(info->buffer) != 20)
{
/* We have a '\0' in there, the message is done */
char *p;
if (!startup_info) return 0;
- info = ecore_hash_get(startup_info, (void *)win);
+ info = eina_hash_find(startup_info, (void *)win);
if (!info) return 0;
if ((info->length + 20) > info->buffer_size)
{
info->buffer = realloc(info->buffer, info->buffer_size * sizeof(char));
if (!info->buffer)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
p = strchr(info->buffer, ':');
if (!p)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
event = ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE;
else
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
if (!_ecore_x_netwm_startup_info_parse(info, p))
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
e = calloc(1, sizeof(Ecore_X_Event_Startup_Sequence));
if (!e)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
return 0;
}
if (event == ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE)
{
- ecore_hash_remove(startup_info, (void *)info->win);
+ eina_hash_del(startup_info, (void *)info->win);
_ecore_x_netwm_startup_info_free(info);
}
else