This commit is huge. I did test it a lot on my computer, and it run fine here.

But is so big i fear i could have broken some piece of code. So report any wrong
behaviour to me (cedric on #edevelop).

So moving e17 and efreet to eina_hash. With a little efreet API break so they
must come together.


SVN revision: 38185
devs/princeamd/enlightenment-0.17-elive
Cedric BAIL 14 years ago
parent e29866312c
commit 773d102291
  1. 18
      src/bin/e_actions.c
  2. 89
      src/bin/e_border.c
  3. 10
      src/bin/e_config_data.c
  4. 9
      src/bin/e_config_data.h
  5. 8
      src/bin/e_configure.c
  6. 14
      src/bin/e_datastore.c
  7. 31
      src/bin/e_dnd.c
  8. 24
      src/bin/e_exec.c
  9. 52
      src/bin/e_filereg.c
  10. 4
      src/bin/e_fm.c
  11. 117
      src/bin/e_fm_custom.c
  12. 2
      src/bin/e_fm_main.c
  13. 115
      src/bin/e_fm_mime.c
  14. 16
      src/bin/e_fm_shared.h
  15. 42
      src/bin/e_font.c
  16. 4
      src/bin/e_font.h
  17. 15
      src/bin/e_gadcon.c
  18. 247
      src/bin/e_int_config_modules.c
  19. 105
      src/bin/e_int_menus.c
  20. 29
      src/bin/e_intl.c
  21. 18
      src/bin/e_ipc_codec.c
  22. 21
      src/bin/e_manager.c
  23. 35
      src/bin/e_menu.c
  24. 60
      src/bin/e_module.c
  25. 40
      src/bin/e_path.c
  26. 8
      src/bin/e_path.h
  27. 10
      src/bin/e_remote_main.c
  28. 12
      src/bin/e_shelf.c
  29. 24
      src/bin/e_stolen.c
  30. 13
      src/bin/e_sys_main.c
  31. 94
      src/bin/e_theme.c
  32. 11
      src/bin/e_thumb.c
  33. 6
      src/modules/conf_fonts/e_int_config_fonts.c
  34. 52
      src/modules/conf_imc/e_int_config_imc.c
  35. 204
      src/modules/conf_intl/e_int_config_intl.c
  36. 58
      src/modules/exebuf/e_exebuf.c
  37. 27
      src/modules/fileman/e_fwin.c
  38. 26
      src/modules/illume/e_kbd_dict.c
  39. 4
      src/modules/illume/e_kbd_dict.h
  40. 2
      src/modules/illume/e_mod_win.c
  41. 18
      src/modules/mixer/e_mod_main.c
  42. 2
      src/modules/mixer/e_mod_main.h
  43. 1
      src/modules/syscon/e_mod_main.c
  44. 32
      src/modules/temperature/e_mod_main.c
  45. 2
      src/modules/temperature/e_mod_main.h
  46. 23
      src/preload/e_precache.c

@ -2256,7 +2256,7 @@ ACT_FN_END_MOUSE(delayed_action)
}
/* local subsystem globals */
static Evas_Hash *actions = NULL;
static Eina_Hash *actions = NULL;
static Eina_List *action_list = NULL;
static Eina_List *action_names = NULL;
static Eina_List *action_groups = NULL;
@ -2268,8 +2268,9 @@ e_actions_init(void)
{
E_Action *act;
actions = eina_hash_string_superfast_new(NULL);
ACT_GO(window_move);
e_action_predef_name_set(_("Window : Actions"), _("Move"),
e_action_predef_name_set(_("Window : Actions"), _("Move"),
"window_move", NULL, NULL, 0);
ACT_GO_MOUSE(window_move);
@ -2655,7 +2656,7 @@ e_actions_shutdown(void)
{
e_action_predef_name_all_del();
action_names = eina_list_free(action_names);
evas_hash_free(actions);
eina_hash_free(actions);
actions = NULL;
E_FREE_LIST(action_list, e_object_del);
@ -2672,14 +2673,14 @@ EAPI E_Action *
e_action_add(const char *name)
{
E_Action *act;
act = e_action_find(name);
if (!act)
{
act = E_OBJECT_ALLOC(E_Action, E_ACTION_TYPE, _e_action_free);
if (!act) return NULL;
act->name = name;
actions = evas_hash_direct_add(actions, act->name, act);
eina_hash_direct_add(actions, act->name, act);
action_names = eina_list_append(action_names, name);
action_list = eina_list_append(action_list, act);
}
@ -2691,7 +2692,7 @@ e_action_del(const char *name)
{
E_Action *act;
act = evas_hash_find(actions, name);
act = eina_hash_find(actions, name);
if (act)
_e_action_free(act);
}
@ -2700,8 +2701,7 @@ EAPI E_Action *
e_action_find(const char *name)
{
E_Action *act;
act = evas_hash_find(actions, name);
act = eina_hash_find(actions, name);
return act;
}
@ -2870,7 +2870,7 @@ e_action_groups_get(void)
static void
_e_action_free(E_Action *act)
{
actions = evas_hash_del(actions, act->name, act);
eina_hash_del(actions, act->name, act);
action_names = eina_list_remove(action_names, act->name);
action_list = eina_list_remove(action_list, act);
free(act);

@ -107,7 +107,7 @@ static void _e_border_hook_call(E_Border_Hook_Point hookpoint, E_Border *bd);
/* local subsystem globals */
static Eina_List *handlers = NULL;
static Eina_List *borders = NULL;
static Evas_Hash *borders_hash = NULL;
static Eina_Hash *borders_hash = NULL;
static E_Border *focused = NULL;
static E_Border *resize = NULL;
@ -183,12 +183,12 @@ e_border_init(void)
ecore_x_passive_grab_replay_func_set(_e_border_cb_grab_replay, NULL);
handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_POINTER_WARP, _e_border_cb_pointer_warp, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_DESKTOP_LIST_CHANGE, _e_border_cb_efreet_desktop_list_change, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(EFREET_EVENT_DESKTOP_CHANGE, _e_border_cb_efreet_desktop_change, NULL));
handlers = eina_list_append(handlers, ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME, _e_border_cb_config_icon_theme, NULL));
if (!borders_hash) borders_hash = eina_hash_string_superfast_new(NULL);
E_EVENT_BORDER_ADD = ecore_event_type_new();
E_EVENT_BORDER_REMOVE = ecore_event_type_new();
E_EVENT_BORDER_DESK_SET = ecore_event_type_new();
@ -218,6 +218,9 @@ e_border_shutdown(void)
{
E_FREE_LIST(handlers, ecore_event_handler_del);
if (borders_hash) eina_hash_free(borders_hash);
borders_hash = NULL;
return 1;
}
@ -471,7 +474,7 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
*/
/* ecore_x_window_reparent(win, bd->client.shell_win, 0, 0); */
bd->need_reparent = 1;
ecore_x_window_border_width_set(win, 0);
ecore_x_window_show(bd->event_win);
ecore_x_window_show(bd->client.shell_win);
@ -486,7 +489,7 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
bd->desk = e_desk_current_get(bd->zone);
e_container_border_add(bd);
borders = eina_list_append(borders, bd);
bd2 = evas_hash_find(borders_hash, e_util_winid_str_get(bd->client.win));
bd2 = eina_hash_find(borders_hash, e_util_winid_str_get(bd->client.win));
if (bd2)
{
printf("EEEEK! 2 borders with same client window id in them! very bad!\n");
@ -495,13 +498,13 @@ e_border_new(E_Container *con, Ecore_X_Window win, int first_map, int internal)
printf("bd=%p, bd->references=%i, bd->deleted=%i, bd->client.win=%x\n",
bd2, bd2->e_obj_inherit.references, bd2->e_obj_inherit.deleted,
bd2->client.win);
borders_hash = evas_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd2);
borders_hash = evas_hash_del(borders_hash, e_util_winid_str_get(bd2->bg_win), bd2);
borders_hash = evas_hash_del(borders_hash, e_util_winid_str_get(bd2->win), bd2);
eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd2);
eina_hash_del(borders_hash, e_util_winid_str_get(bd2->bg_win), bd2);
eina_hash_del(borders_hash, e_util_winid_str_get(bd2->win), bd2);
}
borders_hash = evas_hash_add(borders_hash, e_util_winid_str_get(bd->client.win), bd);
borders_hash = evas_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
borders_hash = evas_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd);
eina_hash_add(borders_hash, e_util_winid_str_get(bd->client.win), bd);
eina_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd);
managed = 1;
ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1);
ecore_x_window_prop_card32_set(win, E_ATOM_CONTAINER, &bd->zone->container->num, 1);
@ -2401,40 +2404,40 @@ e_border_unstick(E_Border *bd)
}
EAPI void
e_border_pinned_set(E_Border *bd, int set)
e_border_pinned_set(E_Border *bd, int set)
{
int layer;
int stacking;
if (bd)
{
bd->borderless = set;
bd->user_skip_winlist = set;
if (set)
{
int stacking;
if (bd)
{
bd->borderless = set;
bd->user_skip_winlist = set;
if (set)
{
layer = 50;
stacking = E_STACKING_BELOW;
}
else
{
}
else
{
layer = 100;
stacking = E_STACKING_NONE;
}
e_border_layer_set(bd, layer);
e_hints_window_stacking_set(bd, stacking);
}
bd->client.border.changed = 1;
bd->changed = 1;
}
}
e_border_layer_set(bd, layer);
e_hints_window_stacking_set(bd, stacking);
bd->client.border.changed = 1;
bd->changed = 1;
}
}
EAPI E_Border *
e_border_find_by_client_window(Ecore_X_Window win)
{
E_Border *bd;
bd = evas_hash_find(borders_hash, e_util_winid_str_get(win));
bd = eina_hash_find(borders_hash, e_util_winid_str_get(win));
if ((bd) && (!e_object_is_del(E_OBJECT(bd))) &&
(bd->client.win == win))
return bd;
@ -2445,8 +2448,8 @@ EAPI E_Border *
e_border_find_all_by_client_window(Ecore_X_Window win)
{
E_Border *bd;
bd = evas_hash_find(borders_hash, e_util_winid_str_get(win));
bd = eina_hash_find(borders_hash, e_util_winid_str_get(win));
if ((bd) && (bd->client.win == win))
return bd;
return NULL;
@ -2456,8 +2459,8 @@ EAPI E_Border *
e_border_find_by_frame_window(Ecore_X_Window win)
{
E_Border *bd;
bd = evas_hash_find(borders_hash, e_util_winid_str_get(win));
bd = eina_hash_find(borders_hash, e_util_winid_str_get(win));
if ((bd) && (!e_object_is_del(E_OBJECT(bd))) &&
(bd->bg_win == win))
return bd;
@ -2468,8 +2471,8 @@ EAPI E_Border *
e_border_find_by_window(Ecore_X_Window win)
{
E_Border *bd;
bd = evas_hash_find(borders_hash, e_util_winid_str_get(win));
bd = eina_hash_find(borders_hash, e_util_winid_str_get(win));
if ((bd) && (!e_object_is_del(E_OBJECT(bd))) &&
(bd->win == win))
return bd;
@ -3709,13 +3712,13 @@ _e_border_free(E_Border *bd)
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
ecore_x_window_del(bd->win);
borders_hash = evas_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd);
borders_hash = evas_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
borders_hash = evas_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd);
eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd);
eina_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd);
eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd);
borders = eina_list_remove(borders, bd);
focus_stack = eina_list_remove(focus_stack, bd);
raise_stack = eina_list_remove(raise_stack, bd);
e_container_border_remove(bd);
free(bd);
}

@ -17,11 +17,11 @@ e_config_descriptor_new(const char *name, int size)
eddc.func.list_append = (void *(*)(void *l, void *d)) eina_list_append;
eddc.func.list_data = (void *(*)(void *)) eina_list_data_get;
eddc.func.list_free = (void *(*)(void *)) eina_list_free;
eddc.func.hash_foreach =
(void (*) (void *, int (*) (void *, const char *, void *, void *), void *))
evas_hash_foreach;
eddc.func.hash_add = (void *(*) (void *, const char *, void *)) evas_hash_add;
eddc.func.hash_free = (void (*) (void *)) evas_hash_free;
eddc.func.hash_foreach =
(void (*) (const Eina_Hash *, Eina_Bool (*) (const Eina_Hash *, const void *, void *, void *), const void *))
eina_hash_foreach;
eddc.func.hash_add = (Eina_Hash* (*) (Eina_Hash *, const void *, void *)) eet_eina_hash_add_alloc;
eddc.func.hash_free = (void (*) (Eina_Hash *)) eina_hash_free;
eddc.name = name;
eddc.size = size;
return (E_Config_DD *)eet_data_descriptor2_new(&eddc);

@ -29,6 +29,15 @@ typedef Eet_Data_Descriptor E_Config_DD;
#ifndef E_CONFIG_DATA_H
#define E_CONFIG_DATA_H
static inline Eina_Hash *
eet_eina_hash_add_alloc(Eina_Hash *hash, const void *key, void *data)
{
if (!hash) hash = eina_hash_string_superfast_new(NULL);
if (!hash) return NULL;
eina_hash_add(hash, key, data);
return hash;
}
EAPI E_Config_DD *e_config_descriptor_new(const char *name, int size);
#endif

@ -92,11 +92,11 @@ _e_configure_efreet_desktop_update(void)
label = NULL;
if (desktop->x)
{
cfg_cat_cfg = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category");
s = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Priority");
cfg_cat_cfg = eina_hash_find(desktop->x, "X-Enlightenment-Config-Category");
s = eina_hash_find(desktop->x, "X-Enlightenment-Config-Priority");
if (s) cfg_pri = atoi(s);
cfg_cat_name = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category-Name");
cfg_cat_icon = ecore_hash_get(desktop->x, "X-Enlightenment-Config-Category-Icon");
cfg_cat_name = eina_hash_find(desktop->x, "X-Enlightenment-Config-Category-Name");
cfg_cat_icon = eina_hash_find(desktop->x, "X-Enlightenment-Config-Category-Icon");
if (cfg_cat_icon)
{
if (cfg_cat_icon[0] == '/')

@ -6,26 +6,30 @@
/* local subsystem functions */
/* local subsystem globals */
static Evas_Hash *store = NULL;
static Eina_Hash *store = NULL;
/* externally accessible functions */
EAPI void
e_datastore_set(char *key, void *data)
{
store = evas_hash_del(store, key, NULL);
store = evas_hash_add(store, key, data);
if (!store) store = eina_hash_string_superfast_new(NULL);
eina_hash_del(store, key, NULL);
eina_hash_add(store, key, data);
}
EAPI void *
e_datastore_get(char *key)
{
return evas_hash_find(store, key);
return eina_hash_find(store, key);
}
EAPI void
e_datastore_del(char *key)
{
store = evas_hash_del(store, key, NULL);
eina_hash_del(store, key, NULL);
if (eina_hash_population(store)) return;
eina_hash_free(store);
store = NULL;
}
/* local subsystem functions */

@ -55,7 +55,7 @@ struct _XDnd
static Eina_List *_event_handlers = NULL;
static Eina_List *_drop_handlers = NULL;
static Evas_Hash *_drop_win_hash = NULL;
static Eina_Hash *_drop_win_hash = NULL;
static Ecore_X_Window _drag_win = 0;
static Ecore_X_Window _drag_win_root = 0;
@ -65,7 +65,7 @@ static E_Drag *_drag_current = NULL;
static XDnd *_xdnd = NULL;
static Evas_Hash *_drop_handlers_responsives;
static Eina_Hash *_drop_handlers_responsives;
static Ecore_X_Atom _action;
/* externally accessible functions */
@ -73,6 +73,9 @@ static Ecore_X_Atom _action;
EAPI int
e_dnd_init(void)
{
_drop_win_hash = eina_hash_string_superfast_new(NULL);
_drop_handlers_responsives = eina_hash_string_superfast_new(NULL);
_event_handlers = eina_list_append(_event_handlers,
ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP,
_e_dnd_cb_mouse_up, NULL));
@ -138,11 +141,11 @@ e_dnd_shutdown(void)
eina_list_free(_event_handlers);
_event_handlers = NULL;
evas_hash_free(_drop_win_hash);
eina_hash_free(_drop_win_hash);
eina_list_free(_drop_handlers);
_drop_handlers = NULL;
evas_hash_free(_drop_handlers_responsives);
eina_hash_free(_drop_handlers_responsives);
return 1;
}
@ -425,16 +428,16 @@ e_drop_xdnd_register_set(Ecore_X_Window win, int reg)
id = e_util_winid_str_get(win);
if (reg)
{
if (!evas_hash_find(_drop_win_hash, id))
if (!eina_hash_find(_drop_win_hash, id))
{
ecore_x_dnd_aware_set(win, 1);
_drop_win_hash = evas_hash_add(_drop_win_hash, id, (void *)1);
eina_hash_add(_drop_win_hash, id, (void *)1);
}
}
else
{
ecore_x_dnd_aware_set(win, 0);
_drop_win_hash = evas_hash_del(_drop_win_hash, id, (void *) 1);
eina_hash_del(_drop_win_hash, id, (void *) 1);
}
return 1;
}
@ -514,7 +517,7 @@ e_drop_handler_responsive_set(E_Drop_Handler *handler)
Ecore_X_Window hwin = _e_drag_win_get(handler, 1);
const char *wid = e_util_winid_str_get(hwin);
_drop_handlers_responsives = evas_hash_add(_drop_handlers_responsives, wid, (void *)handler);
eina_hash_add(_drop_handlers_responsives, wid, (void *)handler);
}
EAPI int
@ -523,7 +526,7 @@ e_drop_handler_responsive_get(E_Drop_Handler *handler)
Ecore_X_Window hwin = _e_drag_win_get(handler, 1);
const char *wid = e_util_winid_str_get(hwin);
return evas_hash_find(_drop_handlers_responsives, wid) == (void *)handler;
return eina_hash_find(_drop_handlers_responsives, wid) == (void *)handler;
}
EAPI void
@ -1186,7 +1189,7 @@ _e_dnd_cb_event_dnd_enter(void *data, int type, void *event)
ev = event;
id = e_util_winid_str_get(ev->win);
if (!evas_hash_find(_drop_win_hash, id)) return 1;
if (!eina_hash_find(_drop_win_hash, id)) return 1;
for (l = _drop_handlers; l; l = l->next)
{
E_Drop_Handler *h;
@ -1258,7 +1261,7 @@ _e_dnd_cb_event_dnd_leave(void *data, int type, void *event)
ev = event;
id = e_util_winid_str_get(ev->win);
if (!evas_hash_find(_drop_win_hash, id)) return 1;
if (!eina_hash_find(_drop_win_hash, id)) return 1;
leave_ev.x = 0;
leave_ev.y = 0;
@ -1304,7 +1307,7 @@ _e_dnd_cb_event_dnd_position(void *data, int type, void *event)
ev = event;
// double t1 = ecore_time_get(); ////
id = e_util_winid_str_get(ev->win);
if (!evas_hash_find(_drop_win_hash, id))
if (!eina_hash_find(_drop_win_hash, id))
{
// double t2 = ecore_time_get() - t1; ////
// printf("DND POS EV 1 %3.7f\n", t2); ////
@ -1396,7 +1399,7 @@ _e_dnd_cb_event_dnd_drop(void *data, int type, void *event)
ev = event;
id = e_util_winid_str_get(ev->win);
if (!evas_hash_find(_drop_win_hash, id)) return 1;
if (!eina_hash_find(_drop_win_hash, id)) return 1;
ecore_x_selection_xdnd_request(ev->win, _xdnd->type);
@ -1415,7 +1418,7 @@ _e_dnd_cb_event_dnd_selection(void *data, int type, void *event)
ev = event;
id = e_util_winid_str_get(ev->win);
if (!evas_hash_find(_drop_win_hash, id)) return 1;
if (!eina_hash_find(_drop_win_hash, id)) return 1;
if (ev->selection != ECORE_X_SELECTION_XDND) return 1;
if (!strcmp("text/uri-list", _xdnd->type))

@ -47,7 +47,7 @@ static E_Exec_Instance *_e_exec_cb_exec(void *data, Efreet_Desktop *desktop, cha
static int _e_exec_cb_expire_timer(void *data);
static int _e_exec_cb_exit(void *data, int type, void *event);
static Evas_Bool _e_exec_startup_id_pid_find(const Evas_Hash *hash __UNUSED__, const void *key __UNUSED__, void *value, void *data);
static Evas_Bool _e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *value, void *data);
static void _e_exec_error_dialog(Efreet_Desktop *desktop, const char *exec, Ecore_Exe_Event_Del *event, Ecore_Exe_Event_Data *error, Ecore_Exe_Event_Data *read);
static void _fill_data(E_Config_Dialog_Data *cfdata);
@ -60,7 +60,7 @@ static void _dialog_save_cb(void *data, void *data2);
/* local subsystem globals */
static Eina_List *e_exec_start_pending = NULL;
static Evas_Hash *e_exec_instances = NULL;
static Eina_Hash *e_exec_instances = NULL;
static int startup_id = 0;
static Ecore_Event_Handler *_e_exec_exit_handler = NULL;
@ -70,6 +70,8 @@ static Ecore_Event_Handler *_e_exec_border_add_handler = NULL;
EAPI int
e_exec_init(void)
{
e_exec_instances = eina_hash_string_superfast_new(NULL);
_e_exec_exit_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _e_exec_cb_exit, NULL);
#if 0
@ -89,7 +91,7 @@ e_exec_shutdown(void)
if (_e_exec_exit_handler) ecore_event_handler_del(_e_exec_exit_handler);
if (_e_exec_border_add_handler) ecore_event_handler_del(_e_exec_border_add_handler);
evas_hash_free(e_exec_instances);
eina_hash_free(e_exec_instances);
eina_list_free(e_exec_start_pending);
return 1;
}
@ -132,7 +134,7 @@ e_exec_startup_id_pid_find(int startup_id, pid_t pid)
search.desktop = NULL;
search.startup_id = startup_id;
search.pid = pid;
evas_hash_foreach(e_exec_instances, _e_exec_startup_id_pid_find, &search);
eina_hash_foreach(e_exec_instances, _e_exec_startup_id_pid_find, &search);
return search.desktop;
}
@ -242,16 +244,16 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
inst->launch_time = ecore_time_get();
inst->expire_timer = ecore_timer_add(10.0, _e_exec_cb_expire_timer, inst);
l = evas_hash_find(e_exec_instances, desktop->orig_path);
l = eina_hash_find(e_exec_instances, desktop->orig_path);
if (l)
{
l = eina_list_append(l, inst);
evas_hash_modify(e_exec_instances, desktop->orig_path, l);
eina_hash_modify(e_exec_instances, desktop->orig_path, l);
}
else
{
l = eina_list_append(l, inst);
e_exec_instances = evas_hash_add(e_exec_instances, desktop->orig_path, l);
eina_hash_add(e_exec_instances, desktop->orig_path, l);
}
e_exec_start_pending = eina_list_append(e_exec_start_pending, desktop);
}
@ -344,14 +346,14 @@ _e_exec_cb_exit(void *data, int type, void *event)
}
if (inst->desktop)
{
instances = evas_hash_find(e_exec_instances, inst->desktop->orig_path);
instances = eina_hash_find(e_exec_instances, inst->desktop->orig_path);
if (instances)
{
instances = eina_list_remove(instances, inst);
if (instances)
evas_hash_modify(e_exec_instances, inst->desktop->orig_path, instances);
eina_hash_modify(e_exec_instances, inst->desktop->orig_path, instances);
else
e_exec_instances = evas_hash_del(e_exec_instances, inst->desktop->orig_path, NULL);
eina_hash_del(e_exec_instances, inst->desktop->orig_path, NULL);
}
}
e_exec_start_pending = eina_list_remove(e_exec_start_pending, inst->desktop);
@ -362,7 +364,7 @@ _e_exec_cb_exit(void *data, int type, void *event)
}
static Evas_Bool
_e_exec_startup_id_pid_find(const Evas_Hash *hash __UNUSED__, const void *key __UNUSED__, void *value, void *data)
_e_exec_startup_id_pid_find(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *value, void *data)
{
E_Exec_Search *search;
Eina_List *instances, *l;

@ -8,7 +8,7 @@
* currently being used by E in core components should be registered
* here and will be protected as best as E can. :)
*/
static Evas_Hash *_e_filereg = NULL;
static Eina_Hash *_e_filereg = NULL;
typedef struct _Filereg_Item Filereg_Item;
struct _Filereg_Item
@ -17,33 +17,35 @@ struct _Filereg_Item
int ref_count;
};
static Evas_Bool _filereg_hash_cb_free(const Evas_Hash *hash __UNUSED__,
const void *key __UNUSED__,
static Eina_Bool _filereg_hash_cb_free(const Eina_Hash *hash __UNUSED__,
const void *key __UNUSED__,
void *data, void *fdata __UNUSED__);
/* Externally accessible functions */
EAPI int
e_filereg_init(void)
e_filereg_init(void)
{
_e_filereg = eina_hash_string_superfast_new(NULL);
return 1;
}
EAPI int
e_filereg_shutdown(void)
e_filereg_shutdown(void)
{
evas_hash_foreach(_e_filereg, _filereg_hash_cb_free, NULL);
evas_hash_free(_e_filereg);
eina_hash_foreach(_e_filereg, _filereg_hash_cb_free, NULL);
eina_hash_free(_e_filereg);
_e_filereg = NULL;
return 1;
}
EAPI int
e_filereg_register(const char *path)
e_filereg_register(const char *path)
{
Filereg_Item *fi = NULL;
fi = evas_hash_find(_e_filereg, path);
if (fi)
fi = eina_hash_find(_e_filereg, path);
if (fi)
{
fi->ref_count++;
return 1;
@ -52,22 +54,22 @@ e_filereg_register(const char *path)
if (!fi) return 0;
fi->path = eina_stringshare_add(path);
fi->ref_count = 1;
_e_filereg = evas_hash_add(_e_filereg, path, fi);
eina_hash_add(_e_filereg, path, fi);
return 1;
}
EAPI void
e_filereg_deregister(const char *path)
e_filereg_deregister(const char *path)
{
Filereg_Item *fi = NULL;
fi = evas_hash_find(_e_filereg, path);
if (fi)
fi = eina_hash_find(_e_filereg, path);
if (fi)
{
fi->ref_count--;
if (fi->ref_count == 0)
if (fi->ref_count == 0)
{
_e_filereg = evas_hash_del(_e_filereg, path, fi);
eina_hash_del(_e_filereg, path, fi);
if (fi->path) eina_stringshare_del(fi->path);
E_FREE(fi);
}
@ -75,22 +77,22 @@ e_filereg_deregister(const char *path)
}
EAPI Evas_Bool
e_filereg_file_protected(const char *path)
e_filereg_file_protected(const char *path)
{
Filereg_Item *fi = NULL;
fi = evas_hash_find(_e_filereg, path);
fi = eina_hash_find(_e_filereg, path);
if (!fi) return 0;
else return 1;
}
/* Private Functions */
static Evas_Bool
_filereg_hash_cb_free(const Evas_Hash *hash __UNUSED__, const void *key __UNUSED__,
void *data, void *fdata __UNUSED__)
static Evas_Bool
_filereg_hash_cb_free(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__,
void *data, void *fdata __UNUSED__)
{
Filereg_Item *fi;
fi = data;
if (!fi) return 1;
if (fi->path) eina_stringshare_del(fi->path);

@ -3922,7 +3922,7 @@ _e_fm2_icon_desktop_load(E_Fm2_Icon *ic)
{
const char *type;
type = ecore_hash_get(desktop->x, "X-Enlightenment-Type");
type = eina_hash_find(desktop->x, "X-Enlightenment-Type");
if (type)
{
if (!strcmp(type, "Mount")) ic->info.mount = 1;
@ -3937,7 +3937,7 @@ _e_fm2_icon_desktop_load(E_Fm2_Icon *ic)
goto error;
}
}
type = ecore_hash_get(desktop->x, "X-Enlightenment-Removable-State");
type = eina_hash_find(desktop->x, "X-Enlightenment-Removable-State");
if (type)
{
if (!strcmp(type, "Full"))

@ -3,12 +3,12 @@
*/
#include "e.h"
static Evas_Bool _e_fm2_custom_file_hash_foreach_list(const Evas_Hash *hash, const void *key, void *data, void *fdata);
static Eina_List *_e_fm2_custom_hash_key_base_list(Evas_Hash *hash, const char *str);
//static Evas_Bool _e_fm2_custom_file_hash_foreach_sub_list(Evas_Hash *hash, const char *key, void *data, void *fdata);
//static Eina_List *_e_fm2_custom_hash_key_sub_list(Evas_Hash *hash, const char *str);
static Evas_Bool _e_fm2_custom_file_hash_foreach(const Evas_Hash *hash, const void *key, void *data, void *fdata);
static Evas_Bool _e_fm2_custom_file_hash_foreach_save(const Evas_Hash *hash, const void *key, void *data, void *fdata);
static Eina_Bool _e_fm2_custom_file_hash_foreach_list(const Eina_Hash *hash, const void *key, void *data, void *fdata);
static Eina_List *_e_fm2_custom_hash_key_base_list(Eina_Hash *hash, const char *str);
//static Eina_Bool _e_fm2_custom_file_hash_foreach_sub_list(Eina_Hash *hash, const char *key, void *data, void *fdata);
//static Eina_List *_e_fm2_custom_hash_key_sub_list(Eina_Hash *hash, const char *str);
static Eina_Bool _e_fm2_custom_file_hash_foreach(const Eina_Hash *hash, const void *key, void *data, void *fdata);
static Eina_Bool _e_fm2_custom_file_hash_foreach_save(const Eina_Hash *hash, const void *key, void *data, void *fdata);
static void _e_fm2_custom_file_info_load(void);
static void _e_fm2_custom_file_info_save(void);
static void _e_fm2_custom_file_info_free(void);
@ -17,10 +17,9 @@ static void _e_fm2_custom_file_cb_defer_save(void *data);
static E_Powersave_Deferred_Action*_e_fm2_flush_defer = NULL;
static Eet_File *_e_fm2_custom_file = NULL;
static Eet_Data_Descriptor *_e_fm2_custom_file_edd = NULL;
static Evas_Hash *_e_fm2_custom_hash = NULL;
static Eina_Hash *_e_fm2_custom_hash = NULL;
static int _e_fm2_custom_writes = 0;
/* FIXME: this uses a flat path key for custom file info. this is fine as
* long as we only expect a limited number of custom info nodes. if we
* start to see whole dire trees stored this way things will suck. we need
@ -44,14 +43,14 @@ e_fm2_custom_file_init(void)
eddc.func.list_free = (void *(*)(void *)) eina_list_free;
eddc.func.hash_foreach =
(void (*) (void *, int (*) (void *, const char *, void *, void *), void *))
evas_hash_foreach;
eddc.func.hash_add = (void *(*) (void *, const char *, void *)) evas_hash_add;
eddc.func.hash_free = (void (*) (void *)) evas_hash_free;
eina_hash_foreach;
eddc.func.hash_add = (void* (*) (void *, const char *, void *)) eet_eina_hash_add_alloc;
eddc.func.hash_free = (void (*) (Eina_Hash *)) eina_hash_free;
eddc.name = "e_fm_custom_file";
eddc.size = sizeof(E_Fm2_Custom_File);
_e_fm2_custom_file_edd = eet_data_descriptor2_new(&eddc);
#define DAT(x, y, z) EET_DATA_DESCRIPTOR_ADD_BASIC(_e_fm2_custom_file_edd, E_Fm2_Custom_File, x, y, z)
#define DAT(x, y, z) EET_DATA_DESCRIPTOR_ADD_BASIC(_e_fm2_custom_file_edd, E_Fm2_Custom_File, x, y, z)
DAT("g.x", geom.x, EET_T_INT);
DAT("g.y", geom.y, EET_T_INT);
DAT("g.w", geom.w, EET_T_INT);
@ -85,11 +84,11 @@ EAPI E_Fm2_Custom_File *
e_fm2_custom_file_get(const char *path)
{
E_Fm2_Custom_File *cf;
_e_fm2_custom_file_info_load();
if (!_e_fm2_custom_file) return NULL;
if (_e_fm2_flush_defer) e_fm2_custom_file_flush();
cf = evas_hash_find(_e_fm2_custom_hash, path);
cf = eina_hash_find(_e_fm2_custom_hash, path);
return cf;
}
@ -99,10 +98,10 @@ e_fm2_custom_file_set(const char *path, E_Fm2_Custom_File *cf)
_e_fm2_custom_file_info_load();
if (!_e_fm2_custom_file) return;
if (_e_fm2_flush_defer) e_fm2_custom_file_flush();
if (evas_hash_find(_e_fm2_custom_hash, path) != cf)
if (eina_hash_find(_e_fm2_custom_hash, path) != cf)
{
E_Fm2_Custom_File *cf2;
cf2 = calloc(1, sizeof(E_Fm2_Custom_File));
if (cf2)
{
@ -111,7 +110,9 @@ e_fm2_custom_file_set(const char *path, E_Fm2_Custom_File *cf)
cf2->icon.icon = eina_stringshare_add(cf->icon.icon);
if (cf->label)
cf2->label = eina_stringshare_add(cf->label);
_e_fm2_custom_hash = evas_hash_add(_e_fm2_custom_hash, path, cf2);
if (!_e_fm2_custom_hash)
_e_fm2_custom_hash = eina_hash_string_superfast_new(NULL);
eina_hash_add(_e_fm2_custom_hash, path, cf2);
}
}
_e_fm2_custom_writes = 1;
@ -122,21 +123,20 @@ e_fm2_custom_file_del(const char *path)
{
Eina_List *list, *l;
E_Fm2_Custom_File *cf2;
_e_fm2_custom_file_info_load();
if (!_e_fm2_custom_file) return;
if (_e_fm2_flush_defer) e_fm2_custom_file_flush();
list = _e_fm2_custom_hash_key_base_list(_e_fm2_custom_hash, path);
if (list)
{
for (l = list; l; l = l->next)
{
cf2 = evas_hash_find(_e_fm2_custom_hash, l->data);
cf2 = eina_hash_find(_e_fm2_custom_hash, l->data);
if (cf2)
{
_e_fm2_custom_hash = evas_hash_del(_e_fm2_custom_hash,
l->data, cf2);
eina_hash_del(_e_fm2_custom_hash, l->data, cf2);
if (cf2->icon.icon) eina_stringshare_del(cf2->icon.icon);
if (cf2->label) eina_stringshare_del(cf2->label);
free(cf2);
@ -156,42 +156,40 @@ e_fm2_custom_file_rename(const char *path, const char *new_path)
_e_fm2_custom_file_info_load();
if (!_e_fm2_custom_file) return;
if (_e_fm2_flush_defer) e_fm2_custom_file_flush();
cf2 = evas_hash_find(_e_fm2_custom_hash, path);
cf2 = eina_hash_find(_e_fm2_custom_hash, path);
if (cf2)
{
_e_fm2_custom_hash = evas_hash_del(_e_fm2_custom_hash, path, cf2);
cf = evas_hash_find(_e_fm2_custom_hash, new_path);
eina_hash_del(_e_fm2_custom_hash, path, cf2);
cf = eina_hash_find(_e_fm2_custom_hash, new_path);
if (cf)
{
if (cf->icon.icon) eina_stringshare_del(cf->icon.icon);
if (cf->label) eina_stringshare_del(cf->label);
free(cf);
}
_e_fm2_custom_hash = evas_hash_add(_e_fm2_custom_hash, new_path, cf2);
eina_hash_add(_e_fm2_custom_hash, new_path, cf2);
}
list = _e_fm2_custom_hash_key_base_list(_e_fm2_custom_hash, path);
if (list)
{
for (l = list; l; l = l->next)
{
cf2 = evas_hash_find(_e_fm2_custom_hash, l->data);
cf2 = eina_hash_find(_e_fm2_custom_hash, l->data);
if (cf2)
{
char buf[PATH_MAX];
strcpy(buf, new_path);
strcat(buf, (char *)l->data + strlen(path));
_e_fm2_custom_hash = evas_hash_del(_e_fm2_custom_hash,
l->data, cf2);
cf = evas_hash_find(_e_fm2_custom_hash, buf);
eina_hash_del(_e_fm2_custom_hash, l->data, cf2);
cf = eina_hash_find(_e_fm2_custom_hash, buf);
if (cf)
{
if (cf->icon.icon) eina_stringshare_del(cf->icon.icon);
if (cf->label) eina_stringshare_del(cf->label);
free(cf);
}
_e_fm2_custom_hash = evas_hash_add(_e_fm2_custom_hash,
buf, cf2);
eina_hash_add(_e_fm2_custom_hash, buf, cf2);
}
}
eina_list_free(list);
@ -219,36 +217,35 @@ struct _E_Custom_List
int base_len;
};
static Evas_Bool
_e_fm2_custom_file_hash_foreach_list(const Evas_Hash *hash, const void *key, void *data, void *fdata)
static Eina_Bool
_e_fm2_custom_file_hash_foreach_list(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
struct _E_Custom_List *cl;
cl = fdata;
if (!strncmp(cl->base, key, cl->base_len))
cl->l = eina_list_append(cl->l, key);
return 1;
}
static Eina_List *
_e_fm2_custom_hash_key_base_list(Evas_Hash *hash, const char *str)
_e_fm2_custom_hash_key_base_list(Eina_Hash *hash, const char *str)
{
struct _E_Custom_List cl;
cl.l = NULL;
cl.base = str;
cl.base_len = strlen(cl.base);
evas_hash_foreach(hash,
_e_fm2_custom_file_hash_foreach_list, &cl);
eina_hash_foreach(hash, _e_fm2_custom_file_hash_foreach_list, &cl);
return cl.l;
}
/*
static Evas_Bool
_e_fm2_custom_file_hash_foreach_sub_list(const Evas_Hash *hash, const void *key, void *data, void *fdata)
static Eina_Bool
_e_fm2_custom_file_hash_foreach_sub_list(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
struct _E_Custom_List *cl;
cl = fdata;
if (!strncmp(cl->base, key, strlen(key)))
cl->l = eina_list_append(cl->l, key);
@ -258,23 +255,23 @@ _e_fm2_custom_file_hash_foreach_sub_list(const Evas_Hash *hash, const void *key,
/*
static Eina_List *
_e_fm2_custom_hash_key_sub_list(const Evas_Hash *hash, const void *str)
_e_fm2_custom_hash_key_sub_list(const Eina_Hash *hash, const void *str)
{
struct _E_Custom_List cl;
cl.l = NULL;
cl.base = str;
evas_hash_foreach(hash,
eina_hash_foreach(hash,
_e_fm2_custom_file_hash_foreach_sub_list, &cl);
return cl.l;
}
*/
static Evas_Bool
_e_fm2_custom_file_hash_foreach(const Evas_Hash *hash, const void *key, void *data, void *fdata)
static Eina_Bool
_e_fm2_custom_file_hash_foreach(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
E_Fm2_Custom_File *cf;
cf = data;
if (cf->icon.icon) eina_stringshare_del(cf->icon.icon);
if (cf->label) eina_stringshare_del(cf->label);
@ -282,12 +279,12 @@ _e_fm2_custom_file_hash_foreach(const Evas_Hash *hash, const void *key, void *da
return 1;
}
static Evas_Bool
_e_fm2_custom_file_hash_foreach_save(const Evas_Hash *hash, const void *key, void *data, void *fdata)
static Eina_Bool
_e_fm2_custom_file_hash_foreach_save(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
Eet_File *ef;
E_Fm2_Custom_File *cf;
ef = fdata;
cf = data;
eet_data_write(ef, _e_fm2_custom_file_edd, key, cf, 1);
@ -320,8 +317,12 @@ _e_fm2_custom_file_info_load(void)
cf = eet_data_read(_e_fm2_custom_file,
_e_fm2_custom_file_edd, list[i]);
if (cf)
_e_fm2_custom_hash = evas_hash_add(_e_fm2_custom_hash,
list[i], cf);
{
if (!_e_fm2_custom_hash)
_e_fm2_custom_hash =
eina_hash_string_superfast_new(NULL);
eina_hash_add(_e_fm2_custom_hash, list[i], cf);
}
}
free(list);
}
@ -341,7 +342,7 @@ _e_fm2_custom_file_info_save(void)
e_user_homedir_get());
ef = eet_open(buf, EET_FILE_MODE_WRITE);
if (!ef) return;
evas_hash_foreach(_e_fm2_custom_hash,
eina_hash_foreach(_e_fm2_custom_hash,
_e_fm2_custom_file_hash_foreach_save, ef);
eet_close(ef);
snprintf(buf2, sizeof(buf2), "%s/.e/e/fileman/custom.cfg",
@ -368,9 +369,9 @@ _e_fm2_custom_file_info_free(void)
}
if (_e_fm2_custom_hash)
{
evas_hash_foreach(_e_fm2_custom_hash,
eina_hash_foreach(_e_fm2_custom_hash,
_e_fm2_custom_file_hash_foreach, NULL);
evas_hash_free(_e_fm2_custom_hash);
eina_hash_free(_e_fm2_custom_hash);
_e_fm2_custom_hash = NULL;
}
}

@ -39,9 +39,11 @@
#include "config.h"
#define E_TYPEDEFS
#include "e_config_data.h"
#include "e_fm_op.h"
#include "e_prefix.h"
#undef E_TYPEDEFS
#include "e_config_data.h"
#include "e_fm_op.h"
#include "e_prefix.h"

@ -12,12 +12,12 @@ struct _E_Fm2_Mime_Handler_Tuple
};
/* local subsystem functions */
static Evas_Bool _e_fm2_mime_handler_glob_match_foreach(const Evas_Hash *hash __UNUSED__, const void *key, void *data, void *fdata);
static Evas_Bool _e_fm_mime_icon_foreach(const Evas_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
static Eina_Bool _e_fm2_mime_handler_glob_match_foreach(const Eina_Hash *hash __UNUSED__, const void *key, void *data, void *fdata);
static Eina_Bool _e_fm_mime_icon_foreach(const Eina_Hash *hash __UNUSED__, const void *key __UNUSED__, void *data, void *fdata);
static Evas_Hash *icon_map = NULL;
static Evas_Hash *_mime_handlers = NULL;
static Evas_Hash *_glob_handlers = NULL;
static Eina_Hash *icon_map = NULL;
static Eina_Hash *_mime_handlers = NULL;
static Eina_Hash *_glob_handlers = NULL;
/* externally accessible functions */
EAPI const char *
@ -40,18 +40,18 @@ e_fm_mime_icon_get(const char *mime)
const char *homedir = NULL;
Eina_List *l = NULL;
E_Config_Mime_Icon *mi;
/* 0.0 clean out hash cache once it has mroe than 512 entries in it */
if (evas_hash_size(icon_map) > 512) e_fm_mime_icon_cache_flush();
if (eina_hash_population(icon_map) > 512) e_fm_mime_icon_cache_flush();
/* 0. look in mapping cache */
val = evas_hash_find(icon_map, mime);
val = eina_hash_find(icon_map, mime);
if (val) return val;
ecore_strlcpy(buf2, mime, sizeof(buf2));
val = strchr(buf2, '/');
if (val) *val = 0;
/* 1. look up in mapping to file or thumb (thumb has flag)*/
for (l = e_config->mime_icons; l; l = l->next)
{
@ -100,12 +100,13 @@ e_fm_mime_icon_get(const char *mime)
if (ecore_file_exists(buf)) goto ok;
snprintf(buf, sizeof(buf), "%s/data/icons/%s.png", e_prefix_data_get(), buf2);
if (ecore_file_exists(buf)) goto ok;
return NULL;
ok:
val = (char *)eina_stringshare_add(buf);
icon_map = evas_hash_add(icon_map, mime, val);
if (!icon_map) icon_map = eina_hash_string_superfast_new(NULL);
eina_hash_add(icon_map, mime, val);
return val;
}
@ -113,20 +114,20 @@ EAPI void
e_fm_mime_icon_cache_flush(void)
{
Eina_List *freelist = NULL;
evas_hash_foreach(icon_map, _e_fm_mime_icon_foreach, &freelist);
eina_hash_foreach(icon_map, _e_fm_mime_icon_foreach, &freelist);
while (freelist)
{
eina_stringshare_del(freelist->data);
freelist = eina_list_remove_list(freelist, freelist);
}
evas_hash_free(icon_map);
eina_hash_free(icon_map);
icon_map = NULL;
}
/* create (allocate), set properties, and return a new mime handler */
EAPI E_Fm2_Mime_Handler *
e_fm2_mime_handler_new(const char *label, const char *icon_group,
e_fm2_mime_handler_new(const char *label, const char *icon_group,
void (*action_func) (Evas_Object *obj, const char *path, void *data),
void *action_data,
int (test_func) (Evas_Object *obj, const char *path, void *data),
@ -145,22 +146,22 @@ e_fm2_mime_handler_new(const char *label, const char *icon_group,
handler->action_data = action_data;
handler->test_func = test_func;
handler->test_data = test_data;
return handler;
}
EAPI void
e_fm2_mime_handler_free(E_Fm2_Mime_Handler *handler)
e_fm2_mime_handler_free(E_Fm2_Mime_Handler *handler)
{
if (!handler) return;
eina_stringshare_del(handler->label);
if (handler->icon_group) eina_stringshare_del(handler->icon_group);
E_FREE(handler);
}
/* associate a certain mime type with a handler */
EAPI Evas_Bool
EAPI Eina_Bool
e_fm2_mime_handler_mime_add(E_Fm2_Mime_Handler *handler, const char *mime)
{
Eina_List *handlers = NULL;
@ -168,23 +169,24 @@ e_fm2_mime_handler_mime_add(E_Fm2_Mime_Handler *handler, const char *mime)
if ((!handler) || (!mime)) return 0;
/* if there's an entry for this mime already, then append to its list */
if ((handlers = evas_hash_find(_mime_handlers, mime)))
if ((handlers = eina_hash_find(_mime_handlers, mime)))
{
handlers = eina_list_append(handlers, handler);
evas_hash_modify(_mime_handlers, mime, handlers);
eina_hash_modify(_mime_handlers, mime, handlers);
}
else
{
/* no previous entry for this mime, lets add one */
handlers = eina_list_append(handlers, handler);
_mime_handlers = evas_hash_add(_mime_handlers, mime, handlers);
if (!_mime_handlers) _mime_handlers = eina_hash_string_superfast_new(NULL);
eina_hash_add(_mime_handlers, mime, handlers);
}
return 1;
}
/* associate a certain glob with a handler */
EAPI Evas_Bool
EAPI Eina_Bool
e_fm2_mime_handler_glob_add(E_Fm2_Mime_Handler *handler, const char *glob)
{
Eina_List *handlers = NULL;
@ -192,16 +194,17 @@ e_fm2_mime_handler_glob_add(E_Fm2_Mime_Handler *handler, const char *glob)
if ((!handler) || (!glob)) return 0;
/* if there's an entry for this glob already, then append to its list */
if ((handler