aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bin/e.h10
-rw-r--r--src/bin/e_actions.c60
-rw-r--r--src/bin/e_bg.c45
-rw-r--r--src/bin/e_bindings.c25
-rw-r--r--src/bin/e_border.c209
-rw-r--r--src/bin/e_box.c40
-rw-r--r--src/bin/e_canvas.c35
-rw-r--r--src/bin/e_color_class.c9
-rw-r--r--src/bin/e_config.c36
-rw-r--r--src/bin/e_config_dialog.c11
-rw-r--r--src/bin/e_container.c197
-rw-r--r--src/bin/e_desk.c41
-rw-r--r--src/bin/e_desklock.c56
-rw-r--r--src/bin/e_dnd.c17
-rw-r--r--src/bin/e_exehist.c45
-rw-r--r--src/bin/e_flowlayout.c39
-rw-r--r--src/bin/e_fm.c94
-rw-r--r--src/bin/e_fm_custom.c16
-rw-r--r--src/bin/e_fm_hal.c40
-rw-r--r--src/bin/e_fm_main.c58
-rw-r--r--src/bin/e_fm_mime.c28
-rw-r--r--src/bin/e_fm_op.c2
-rw-r--r--src/bin/e_fm_prop.c3
-rw-r--r--src/bin/e_fm_shared.h7
-rw-r--r--src/bin/e_font.c65
-rw-r--r--src/bin/e_gadcon.c488
-rw-r--r--src/bin/e_hints.c39
-rw-r--r--src/bin/e_ilist.c57
-rw-r--r--src/bin/e_init.c12
-rw-r--r--src/bin/e_init_main.c8
-rw-r--r--src/bin/e_int_border_remember.c5
-rw-r--r--src/bin/e_int_config_modules.c15
-rw-r--r--src/bin/e_int_gadcon_config.c42
-rw-r--r--src/bin/e_int_menus.c46
-rw-r--r--src/bin/e_int_shelf_config.c31
-rw-r--r--src/bin/e_intl.c34
-rw-r--r--src/bin/e_ipc_codec.c26
-rw-r--r--src/bin/e_ipc_handlers.h166
-rw-r--r--src/bin/e_layout.c23
-rw-r--r--src/bin/e_main.c39
-rw-r--r--src/bin/e_manager.c69
-rw-r--r--src/bin/e_maximize.c43
-rw-r--r--src/bin/e_menu.c111
-rw-r--r--src/bin/e_module.c22
-rw-r--r--src/bin/e_msg.c14
-rw-r--r--src/bin/e_msgbus.c21
-rw-r--r--src/bin/e_object.c12
-rw-r--r--src/bin/e_order.c69
-rw-r--r--src/bin/e_path.c49
-rw-r--r--src/bin/e_place.c30
-rw-r--r--src/bin/e_pointer.c42
-rw-r--r--src/bin/e_popup.c15
-rw-r--r--src/bin/e_powersave.c8
-rw-r--r--src/bin/e_remember.c29
-rw-r--r--src/bin/e_resist.c44
-rw-r--r--src/bin/e_shelf.c24
-rw-r--r--src/bin/e_slidecore.c8
-rw-r--r--src/bin/e_sys.c12
-rw-r--r--src/bin/e_table.c51
-rw-r--r--src/bin/e_test.c35
-rw-r--r--src/bin/e_thumb.c29
-rw-r--r--src/bin/e_thumb_main.c5
-rw-r--r--src/bin/e_toolbar.c38
-rw-r--r--src/bin/e_utils.c54
-rw-r--r--src/bin/e_widget.c67
-rw-r--r--src/bin/e_widget_csel.c19
-rw-r--r--src/bin/e_widget_desk_preview.c18
-rw-r--r--src/bin/e_widget_fsel.c7
-rw-r--r--src/bin/e_widget_ilist.c18
-rw-r--r--src/bin/e_widget_radio.c14
-rw-r--r--src/bin/e_widget_toolbook.c8
-rw-r--r--src/bin/e_xinerama.c36
-rw-r--r--src/bin/e_zone.c48
73 files changed, 1262 insertions, 2026 deletions
diff --git a/src/bin/e.h b/src/bin/e.h
index 708aad49b..5c19be750 100644
--- a/src/bin/e.h
+++ b/src/bin/e.h
@@ -126,14 +126,12 @@ typedef struct _E_Rect E_Rect;
{ \
if (list) \
{ \
- Eina_List *tmp; \
- tmp = list; \
- list = NULL; \
- while (tmp) \
+ void *data; \
+ EINA_LIST_FREE(list, data) \
{ \
- free(tmp->data); \
- tmp = eina_list_remove_list(tmp, tmp); \
+ free(data); \
} \
+ list = NULL; \
} \
} \
while (0)
diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c
index 0378bbfcb..bf9b717fa 100644
--- a/src/bin/e_actions.c
+++ b/src/bin/e_actions.c
@@ -1286,12 +1286,9 @@ ACT_FN_GO(desk_linear_flip_to)
E_Container *con; \
E_Manager *man; \
\
- for (lm = e_manager_list(); lm; lm = lm->next) { \
- man = lm->data; \
- for (lc = man->containers; lc; lc = lc->next) { \
- con = lc->data; \
- for (lz = con->zones; lz; lz = lz->next) { \
- zone = lz->data; \
+ EINA_LIST_FOREACH(e_manager_list(), lm, man) { \
+ EINA_LIST_FOREACH(man->containers, lc, con) { \
+ EINA_LIST_FOREACH(con->zones, lz, zone) { \
act; \
} \
} \
@@ -1441,26 +1438,20 @@ if ((con_num < 0) || (zone_num < 0)) { \
E_Manager *man; \
if ((con_num >= 0) && (zone_num < 0)) /* con=1 zone=all */ { \
con = e_util_container_number_get(con_num); \
- for (l = con->zones; l; l = l->next) { \
- zone = l->data; \
+ EINA_LIST_FOREACH(con->zones, l, zone) { \
act; \
} } \
else if ((con_num < 0) && (zone_num >= 0)) /* con=all zone=1 */ { \
- for (l = e_manager_list(); l; l = l->next) { \
- man = l->data; \
- for (ll = man->containers; ll; ll = ll->next) { \
- con = ll->data; \
+ EINA_LIST_FOREACH(e_manager_list(), l, man) { \
+ EINA_LIST_FOREACH(man->containers, ll, con) { \
zone = e_container_zone_number_get(con, zone_num); \
if (zone) \
act; \
} } } \
else if ((con_num < 0) && (zone_num < 0)) /* con=all zone=all */ { \
- for (l = e_manager_list(); l; l = l->next) { \
- man = l->data; \
- for (ll = man->containers; ll; ll = ll->next) { \
- con = ll->data; \
- for (lll = con->zones; lll; lll = lll->next) { \
- zone = lll->data; \
+ EINA_LIST_FOREACH(e_manager_list(), l, man) { \
+ EINA_LIST_FOREACH(man->containers, ll, con) { \
+ EINA_LIST_FOREACH(con->zones, lll, zone) { \
act; \
} } } } } \
else { \
@@ -2367,12 +2358,10 @@ static void
_delayed_action_key_del(E_Object *obj, const char *params, Ecore_Event_Key *ev)
{
Eina_List *l;
-
- for (l = _delayed_actions; l; l = l->next)
+ Delayed_Action *da;
+
+ EINA_LIST_FOREACH(_delayed_actions, l, da)
{
- Delayed_Action *da;
-
- da = l->data;
if ((da->obj == obj) && (!da->mouse) &&
(!strcmp(da->keyname, ev->keyname)))
{
@@ -2406,12 +2395,10 @@ static void
_delayed_action_mouse_del(E_Object *obj, const char *params, Ecore_Event_Mouse_Button *ev)
{
Eina_List *l;
+ Delayed_Action *da;
- for (l = _delayed_actions; l; l = l->next)
+ EINA_LIST_FOREACH(_delayed_actions, l, da)
{
- Delayed_Action *da;
-
- da = l->data;
if ((da->obj == obj) && (da->mouse) &&
(ev->buttons == da->button))
{
@@ -2928,7 +2915,6 @@ e_action_predef_label_get(const char *action, const char *params)
{
EINA_LIST_FOREACH(actg->acts, l2, actd)
{
- actd = l2->data;
if (!strcmp(actd->act_cmd, action))
{
if ((params) && (actd->act_params))
@@ -3002,9 +2988,8 @@ e_action_predef_name_del(const char *act_grp, const char *act_name)
E_Action_Description *actd = NULL;
Eina_List *l;
- for (l = action_groups; l; l = l->next)
+ EINA_LIST_FOREACH(action_groups, l, actg)
{
- actg = l->data;
if (!strcmp(actg->act_grp, act_grp))
break;
actg = NULL;
@@ -3012,9 +2997,8 @@ e_action_predef_name_del(const char *act_grp, const char *act_name)
if (!actg) return;
- for (l = actg->acts; l; l = l->next)
+ EINA_LIST_FOREACH(actg->acts, l, actd)
{
- actd = l->data;
if (!strcmp(actd->act_name, act_name))
{
actg->acts = eina_list_remove(actg->acts, actd);
@@ -3043,27 +3027,19 @@ e_action_predef_name_all_del(void)
E_Action_Group *actg = NULL;
E_Action_Description *actd = NULL;
- while (action_groups)
+ EINA_LIST_FREE(action_groups, actg)
{
- actg = action_groups->data;
-
- while (actg->acts)
+ EINA_LIST_FREE(actg->acts, actd)
{
- actd = actg->acts->data;
-
if (actd->act_name) eina_stringshare_del(actd->act_name);
if (actd->act_cmd) eina_stringshare_del(actd->act_cmd);
if (actd->act_params) eina_stringshare_del(actd->act_params);
if (actd->param_example) eina_stringshare_del(actd->param_example);
E_FREE(actd);
-
- actg->acts = eina_list_remove_list(actg->acts, actg->acts);
}
if (actg->act_grp) eina_stringshare_del(actg->act_grp);
E_FREE(actg);
-
- action_groups = eina_list_remove_list(action_groups, action_groups);
}
action_groups = NULL;
}
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index ab05368b2..092874b77 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -32,6 +32,7 @@ EAPI int
e_bg_init(void)
{
Eina_List *l = NULL;
+ E_Config_Desktop_Background *cfbg = NULL;
/* Register mime handler */
bg_hdl = e_fm2_mime_handler_new(_("Set As Background"),
@@ -44,11 +45,8 @@ e_bg_init(void)
if (e_config->desktop_default_background)
e_filereg_register(e_config->desktop_default_background);
- for (l = e_config->desktop_backgrounds; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
- E_Config_Desktop_Background *cfbg;
-
- cfbg = l->data;
if (!cfbg) continue;
e_filereg_register(cfbg->file);
}
@@ -61,6 +59,7 @@ EAPI int
e_bg_shutdown(void)
{
Eina_List *l = NULL;
+ E_Config_Desktop_Background *cfbg = NULL;
/* Deregister mime handler */
if (bg_hdl)
@@ -73,11 +72,8 @@ e_bg_shutdown(void)
if (e_config->desktop_default_background)
e_filereg_deregister(e_config->desktop_default_background);
- for (l = e_config->desktop_backgrounds; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
- E_Config_Desktop_Background *cfbg;
-
- cfbg = l->data;
if (!cfbg) continue;
e_filereg_deregister(cfbg->file);
}
@@ -94,19 +90,18 @@ EAPI const E_Config_Desktop_Background *
e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
{
Eina_List *l, *ll, *entries;
- E_Config_Desktop_Background *bg = NULL;
+ E_Config_Desktop_Background *bg = NULL, *cfbg = NULL;
const char *bgfile = "";
+ char *entry;
int current_spec = 0; /* how specific the setting is - we want the least general one that applies */
/* look for desk specific background. */
if (container_num >= 0 || zone_num >= 0 || desk_x >= 0 || desk_y >= 0)
{
- for (l = e_config->desktop_backgrounds; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
- E_Config_Desktop_Background *cfbg;
int spec;
- cfbg = l->data;
if (!cfbg) continue;
spec = 0;
if (cfbg->container == container_num) spec++;
@@ -133,9 +128,9 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
entries = edje_file_collection_list(bgfile);
if (entries)
{
- for (ll = entries; ll; ll = ll->next)
+ EINA_LIST_FOREACH(entries, ll, entry)
{
- if (!strcmp(ll->data, "e/desktop/background"))
+ if (!strcmp(entry, "e/desktop/background"))
{
bg = cfbg;
current_spec = spec;
@@ -154,6 +149,7 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
const E_Config_Desktop_Background *cfbg;
Eina_List *l, *entries;
const char *bgfile = "";
+ char *entry;
int ok = 0;
cfbg = e_bg_config_get(container_num, zone_num, desk_x, desk_y);
@@ -189,9 +185,9 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
entries = edje_file_collection_list(bgfile);
if (entries)
{
- for (l = entries; l; l = l->next)
+ EINA_LIST_FOREACH(entries, l, entry)
{
- if (!strcmp(l->data, "e/desktop/background"))
+ if (!strcmp(entry, "e/desktop/background"))
{
ok = 1;
break;
@@ -442,13 +438,11 @@ EAPI void
e_bg_del(int container, int zone, int desk_x, int desk_y)
{
Eina_List *l = NULL;
+ E_Config_Desktop_Background *cfbg = NULL;
E_Event_Bg_Update *ev;
-
- for (l = e_config->desktop_backgrounds; l; l = l->next)
+
+ EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
{
- E_Config_Desktop_Background *cfbg;
-
- cfbg = l->data;
if (!cfbg) continue;
if ((cfbg->container == container) && (cfbg->zone == zone) &&
(cfbg->desk_x == desk_x) && (cfbg->desk_y == desk_y))
@@ -477,15 +471,12 @@ e_bg_update(void)
E_Container *con;
E_Zone *zone;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- con = ll->data;
- for (lll = con->zones; lll; lll = lll->next)
+ EINA_LIST_FOREACH(con->zones, lll, zone)
{
- zone = lll->data;
e_zone_bg_reconfigure(zone);
}
}
diff --git a/src/bin/e_bindings.c b/src/bin/e_bindings.c
index 2336f1ece..ed42e7876 100644
--- a/src/bin/e_bindings.c
+++ b/src/bin/e_bindings.c
@@ -87,26 +87,11 @@ e_bindings_init(void)
EAPI int
e_bindings_shutdown(void)
{
- E_Binding_Signal *binds;
- E_Binding_Mouse *bindm;
- E_Binding_Wheel *bindw;
- E_Binding_Edge *binde;
- E_Binding_Key *bindk;
-
- EINA_LIST_FREE(mouse_bindings, bindm)
- _e_bindings_mouse_free(bindm);
-
- EINA_LIST_FREE(key_bindings, bindk)
- _e_bindings_key_free(bindk);
-
- EINA_LIST_FREE(edge_bindings, binde)
- _e_bindings_edge_free(binde);
-
- EINA_LIST_FREE(signal_bindings, binds)
- _e_bindings_signal_free(binds);
-
- EINA_LIST_FREE(wheel_bindings, bindw)
- _e_bindings_wheel_free(bindw);
+ E_FREE_LIST(mouse_bindings, _e_bindings_mouse_free);
+ E_FREE_LIST(key_bindings, _e_bindings_key_free);
+ E_FREE_LIST(edge_bindings, _e_bindings_edge_free);
+ E_FREE_LIST(signal_bindings, _e_bindings_signal_free);
+ E_FREE_LIST(wheel_bindings, _e_bindings_wheel_free);
return 1;
}
diff --git a/src/bin/e_border.c b/src/bin/e_border.c
index ca3993b40..439b6f09a 100644
--- a/src/bin/e_border.c
+++ b/src/bin/e_border.c
@@ -701,11 +701,9 @@ e_border_desk_set(E_Border *bd, E_Desk *desk)
if (e_config->transient.desktop)
{
Eina_List *l;
- for (l = bd->transients; l; l = l->next)
+ E_Border *child;
+ EINA_LIST_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
e_border_desk_set(child, bd->desk);
}
}
@@ -1207,6 +1205,7 @@ e_border_layer_set(E_Border *bd, int layer)
if (e_config->transient.layer)
{
Eina_List *l;
+ E_Border *child;
/* We need to set raise to one, else the child wont
* follow to the new layer. It should be like this,
@@ -1214,11 +1213,8 @@ e_border_layer_set(E_Border *bd, int layer)
* the transients.
*/
e_config->transient.raise = 1;
- for (l = bd->transients; l; l = l->next)
+ EINA_LIST_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
child->layer = layer;
}
}
@@ -1230,7 +1226,7 @@ EAPI void
e_border_raise(E_Border *bd)
{
E_Event_Border_Stack *ev;
- E_Border *last = NULL;
+ E_Border *last = NULL, *child;
Eina_List *l;
E_OBJECT_CHECK(bd);
@@ -1240,11 +1236,8 @@ e_border_raise(E_Border *bd)
if (e_config->transient.raise)
{
- for (l = eina_list_last(bd->transients); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
/* Don't stack iconic transients. If the user wants these shown,
* thats another option.
*/
@@ -1320,7 +1313,7 @@ EAPI void
e_border_lower(E_Border *bd)
{
E_Event_Border_Stack *ev;
- E_Border *last = NULL;
+ E_Border *last = NULL, *child;
Eina_List *l;
E_OBJECT_CHECK(bd);
@@ -1330,11 +1323,8 @@ e_border_lower(E_Border *bd)
if (e_config->transient.lower)
{
- for (l = eina_list_last(bd->transients); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
/* Don't stack iconic transients. If the user wants these shown,
* thats another option.
*/
@@ -1410,7 +1400,7 @@ e_border_stack_above(E_Border *bd, E_Border *above)
{
/* TODO: Should stack above allow the border to change level */
E_Event_Border_Stack *ev;
- E_Border *last = NULL;
+ E_Border *last = NULL, *child;
Eina_List *l;
E_OBJECT_CHECK(bd);
@@ -1420,11 +1410,8 @@ e_border_stack_above(E_Border *bd, E_Border *above)
if (e_config->transient.raise)
{
- for (l = eina_list_last(bd->transients); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
/* Don't stack iconic transients. If the user wants these shown,
* thats another option.
*/
@@ -1468,7 +1455,7 @@ e_border_stack_below(E_Border *bd, E_Border *below)
{
/* TODO: Should stack below allow the border to change level */
E_Event_Border_Stack *ev;
- E_Border *last = NULL;
+ E_Border *last = NULL, *child;
Eina_List *l;
E_OBJECT_CHECK(bd);
@@ -1478,11 +1465,8 @@ e_border_stack_below(E_Border *bd, E_Border *below)
if (e_config->transient.lower)
{
- for (l = eina_list_last(bd->transients); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
/* Don't stack iconic transients. If the user wants these shown,
* thats another option.
*/
@@ -2457,12 +2441,10 @@ e_border_iconify(E_Border *bd)
if (e_config->transient.iconify)
{
Eina_List *l;
+ E_Border *child;
- for (l = bd->transients; l; l = l->next)
+ EINA_LIST_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
e_border_iconify(child);
}
}
@@ -2502,12 +2484,10 @@ e_border_uniconify(E_Border *bd)
if (e_config->transient.iconify)
{
Eina_List *l;
+ E_Border *child;
- for (l = bd->transients; l; l = l->next)
+ EINA_LIST_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
e_border_uniconify(child);
}
}
@@ -2530,11 +2510,9 @@ e_border_stick(E_Border *bd)
if (e_config->transient.desktop)
{
Eina_List *l;
- for (l = bd->transients; l; l = l->next)
+ E_Border *child;
+ EINA_LIST_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
child->sticky = 1;
e_hints_window_sticky_set(child, 1);
e_border_show(child);
@@ -2566,11 +2544,9 @@ e_border_unstick(E_Border *bd)
if (e_config->transient.desktop)
{
Eina_List *l;
- for (l = bd->transients; l; l = l->next)
+ E_Border *child;
+ EINA_LIST_FOREACH(bd->transients, l, child)
{
- E_Border *child;
-
- child = l->data;
child->sticky = 0;
e_hints_window_sticky_set(child, 0);
}
@@ -2668,12 +2644,10 @@ EAPI E_Border *
e_border_find_by_alarm(Ecore_X_Sync_Alarm alarm)
{
Eina_List *l;
-
- for (l = borders; l; l = l->next)
+ E_Border *bd;
+
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if ((bd) && (!e_object_is_del(E_OBJECT(bd))) &&
(bd->client.netwm.sync.alarm == alarm))
return bd;
@@ -2691,22 +2665,18 @@ EAPI void
e_border_idler_before(void)
{
Eina_List *ml, *cl;
+ E_Manager *man;
+ E_Container *con;
if (!borders)
return;
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, man)
{
- E_Manager *man;
-
- man = ml->data;
- for (cl = man->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(man->containers, cl, con)
{
- E_Container *con;
E_Border_List *bl;
E_Border *bd;
-
- con = cl->data;
// pass 1 - eval0. fetch properties on new or on change and
// call hooks to decide what to do - maybe move/resize
@@ -3354,12 +3324,10 @@ EAPI void
e_border_button_bindings_ungrab_all(void)
{
Eina_List *l;
-
- for (l = borders; l; l = l->next)
+ E_Border *bd;
+
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
e_focus_setdown(bd);
e_bindings_mouse_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
e_bindings_wheel_ungrab(E_BINDING_CONTEXT_BORDER, bd->win);
@@ -3370,12 +3338,10 @@ EAPI void
e_border_button_bindings_grab_all(void)
{
Eina_List *l;
+ E_Border *bd;
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
e_bindings_mouse_grab(E_BINDING_CONTEXT_BORDER, bd->win);
e_bindings_wheel_grab(E_BINDING_CONTEXT_BORDER, bd->win);
e_focus_setup(bd);
@@ -3398,15 +3364,13 @@ EAPI Eina_List *
e_border_lost_windows_get(E_Zone *zone)
{
Eina_List *list = NULL, *l;
+ E_Border *bd;
int loss_overlap = 5;
E_OBJECT_CHECK_RETURN(zone, NULL);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, NULL);
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (bd->zone)
{
if ((bd->zone == zone) ||
@@ -3538,12 +3502,10 @@ EAPI Eina_List *
e_border_immortal_windows_get(void)
{
Eina_List *list = NULL, *l;
+ E_Border *bd;
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (bd->lock_life)
list = eina_list_append(list, bd);
}
@@ -3799,11 +3761,7 @@ _e_border_free(E_Border *bd)
ecore_poller_del(bd->ping_poller);
bd->ping_poller = NULL;
}
- while (bd->pending_move_resize)
- {
- free(bd->pending_move_resize->data);
- bd->pending_move_resize = eina_list_remove_list(bd->pending_move_resize, bd->pending_move_resize);
- }
+ E_FREE_LIST(bd->pending_move_resize, free);
if (bd->shade.anim) ecore_animator_del(bd->shade.anim);
if (bd->border_menu) e_menu_deactivate(bd->border_menu);
@@ -3930,6 +3888,7 @@ static void
_e_border_del(E_Border *bd)
{
E_Event_Border_Remove *ev;
+ E_Border *child;
if (bd->fullscreen) bd->desk->fullscreen_borders--;
@@ -4000,13 +3959,9 @@ _e_border_del(E_Border *bd)
}
bd->parent = NULL;
}
- while (bd->transients)
+ EINA_LIST_FREE(bd->transients, child)
{
- E_Border *child;
-
- child = bd->transients->data;
child->parent = NULL;
- bd->transients = eina_list_remove_list(bd->transients, bd->transients);
}
if (bd->leader)
@@ -4023,13 +3978,9 @@ _e_border_del(E_Border *bd)
}
bd->leader = NULL;
}
- while (bd->group)
+ EINA_LIST_FREE(bd->group, child)
{
- E_Border *child;
-
- child = bd->group->data;
child->leader = NULL;
- bd->group = eina_list_remove_list(bd->group, bd->group);
}
}
@@ -5043,13 +4994,11 @@ static int
_e_border_cb_efreet_desktop_list_change(void *data, int ev_type, void *ev)
{
Eina_List *l;
+ E_Border *bd;
/* mark all borders for desktop/icon updates */
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (!bd->desktop)
{
bd->changes.icon = 1;
@@ -5066,6 +5015,7 @@ _e_border_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
{
Efreet_Event_Desktop_Change *event;
Eina_List *l;
+ E_Border *bd;
event = ev;
e_init_status_set(_("Desktop file scan"));
@@ -5073,11 +5023,8 @@ _e_border_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
{
case EFREET_DESKTOP_CHANGE_ADD:
/* If a desktop is added, make the borders without icon retry */
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (!bd->desktop)
{
bd->changes.icon = 1;
@@ -5087,11 +5034,8 @@ _e_border_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
break;
case EFREET_DESKTOP_CHANGE_REMOVE:
/* If a desktop is removed, drop the .desktop pointer */
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (bd->desktop == event->current)
{
efreet_desktop_free(bd->desktop);
@@ -5103,12 +5047,8 @@ _e_border_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
break;
case EFREET_DESKTOP_CHANGE_UPDATE:
/* If a desktop is updated, point to the new desktop and update the icon */
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
-
if (bd->desktop == event->previous)
{
efreet_desktop_free(bd->desktop);
@@ -5132,13 +5072,11 @@ static int
_e_border_cb_config_icon_theme(void *data, int ev_type, void *ev)
{
Eina_List *l;
+ E_Border *bd;
/* mark all borders for desktop/icon updates */
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
bd->changes.icon = 1;
bd->changed = 1;
}
@@ -5717,11 +5655,9 @@ _e_border_eval0(E_Border *bd)
else
{
Eina_List *l;
- for (l = bd->leader->group; l; l = l->next)
+ E_Border *child;
+ EINA_LIST_FOREACH(bd->leader->group, l, child)
{
- E_Border *child;
-
- child = l->data;
if ((child != bd) && (child->focused))
e_border_focus_set(bd, 1, 1);
}
@@ -6198,11 +6134,9 @@ _e_border_eval0(E_Border *bd)
else
{
Eina_List *l;
- for (l = bd->leader->group; l; l = l->next)
+ E_Border *child;
+ EINA_LIST_FOREACH(bd->leader->group, l, child)
{
- E_Border *child;
-
- child = l->data;
if ((child != bd) && (child->focused))
e_border_focus_set(bd, 1, 1);
}
@@ -6669,6 +6603,7 @@ static void
_e_border_eval(E_Border *bd)
{
E_Event_Border_Property *event;
+ E_Border_Pending_Move_Resize *pnd;
int rem_change = 0;
int send_event = 1;
int zx, zy, zw, zh;
@@ -6805,11 +6740,8 @@ _e_border_eval(E_Border *bd)
}
}
}
- while (bd->pending_move_resize)
+ EINA_LIST_FREE(bd->pending_move_resize, pnd)
{
- E_Border_Pending_Move_Resize *pnd;
-
- pnd = bd->pending_move_resize->data;
if ((!bd->lock_client_location) && (pnd->move))
{
bd->x = pnd->x;
@@ -6831,8 +6763,6 @@ _e_border_eval(E_Border *bd)
bd->changes.size = 1;
}
free(pnd);
- bd->pending_move_resize = eina_list_remove_list(bd->pending_move_resize,
- bd->pending_move_resize);
}
/* Recreate state */
@@ -7954,6 +7884,7 @@ _e_border_zone_update(E_Border *bd)
{
E_Container *con;
Eina_List *l;
+ E_Zone *zone;
/* still within old zone - leave it there */
if (E_INTERSECTS(bd->x, bd->y, bd->w, bd->h,
@@ -7961,11 +7892,8 @@ _e_border_zone_update(E_Border *bd)
return;
/* find a new zone */
con = bd->zone->container;
- for (l = con->zones; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
{
- E_Zone *zone;
-
- zone = l->data;
if (E_INTERSECTS(bd->x, bd->y, bd->w, bd->h,
zone->x, zone->y, zone->w, zone->h))
{
@@ -8284,18 +8212,14 @@ static int _e_border_hooks_walking = 0;
static void
_e_border_hooks_clean(void)
{
- Eina_List *l, *pl;
+ Eina_List *l, *ln;
+ E_Border_Hook *bh;
- for (l = _e_border_hooks; l;)
+ EINA_LIST_FOREACH_SAFE(_e_border_hooks, l, ln, bh)
{
- E_Border_Hook *bh;
-
- bh = l->data;
- pl = l;
- l = l->next;
if (bh->delete_me)
{
- _e_border_hooks = eina_list_remove_list(_e_border_hooks, pl);
+ _e_border_hooks = eina_list_remove_list(_e_border_hooks, l);
free(bh);
}
}
@@ -8305,13 +8229,11 @@ static void
_e_border_hook_call(E_Border_Hook_Point hookpoint, void *bd)
{
Eina_List *l;
+ E_Border_Hook *bh;
_e_border_hooks_walking++;
- for (l = _e_border_hooks; l; l = l->next)
+ EINA_LIST_FOREACH(_e_border_hooks, l, bh)
{
- E_Border_Hook *bh;
-
- bh = l->data;
if (bh->delete_me) continue;
if (bh->hookpoint == hookpoint) bh->func(bh->data, bd);
}
@@ -8362,7 +8284,7 @@ e_border_focus_track_thaw(void)
EAPI E_Border *
e_border_under_pointer_get(E_Desk *desk, E_Border *exclude)
{
- E_Border *bd = NULL;
+ E_Border *bd = NULL, *cbd;
Eina_List *l;
int x, y;
@@ -8376,11 +8298,8 @@ e_border_under_pointer_get(E_Desk *desk, E_Border *exclude)
else
return NULL;
- for (l = e_border_raise_stack_get(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_raise_stack_get(), l, cbd)
{
- E_Border *cbd;
-
- cbd = l->data;
if (!cbd) continue;
/* If a border was specified which should be excluded from the list
* (because it will be closed shortly for example), skip */
diff --git a/src/bin/e_box.c b/src/bin/e_box.c
index 27134e664..17a13e572 100644
--- a/src/bin/e_box.c
+++ b/src/bin/e_box.c
@@ -164,15 +164,17 @@ e_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before)
E_Smart_Data *sd;
int i = 0;
Eina_List *l;
+ Evas_Object *item;
if (!child) return 0;
sd = evas_object_smart_data_get(obj);
if (!sd) return 0;
_e_box_smart_adopt(sd, child);
sd->items = eina_list_prepend_relative(sd->items, child, before);
- for (i = 0, l = sd->items; l; l = l->next, i++)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- if (l->data == child) break;
+ if (item == child) break;
+ i++;
}
sd->changed = 1;
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
@@ -185,15 +187,17 @@ e_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after)
E_Smart_Data *sd;
int i = 0;
Eina_List *l;
+ Evas_Object *item;
if (!child) return 0;
sd = evas_object_smart_data_get(obj);
if (!sd) return 0;
_e_box_smart_adopt(sd, child);
sd->items = eina_list_append_relative(sd->items, child, after);
- for (i = 0, l = sd->items; l; l = l->next, i++)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- if (l->data == child) break;
+ if (item == child) break;
+ i++;
}
sd->changed = 1;
if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
@@ -405,6 +409,7 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
{
Evas_Coord x, y, w, h, xx, yy;
Eina_List *l;
+ Evas_Object *obj;
int minw, minh, wdif, hdif;
int count, expand;
@@ -430,12 +435,9 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
y = y + ((h - minh) * (1.0 - sd->align.y));
h = minh;
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Box_Item *bi;
- Evas_Object *obj;
-
- obj = l->data;
bi = evas_object_data_get(obj, "e_box_data");
if (bi)
{
@@ -466,12 +468,10 @@ _e_box_smart_reconfigure(E_Smart_Data *sd)
hdif = h - minh;
xx = x;
yy = y;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Box_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_box_data");
if (bi)
{
@@ -578,6 +578,7 @@ static void
_e_box_smart_extents_calculate(E_Smart_Data *sd)
{
Eina_List *l;
+ Evas_Object *obj;
int minw, minh;
/* FIXME: need to calc max */
@@ -588,12 +589,10 @@ _e_box_smart_extents_calculate(E_Smart_Data *sd)
minh = 0;
if (sd->homogenous)
{
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Box_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_box_data");
if (bi)
{
@@ -608,12 +607,10 @@ _e_box_smart_extents_calculate(E_Smart_Data *sd)
}
else
{
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Box_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_box_data");
if (bi)
{
@@ -698,7 +695,7 @@ _e_box_smart_del(Evas_Object *obj)
{
Evas_Object *child;
- child = sd->items->data;
+ child = eina_list_data_get(sd->items);
e_box_unpack(child);
}
e_box_thaw(obj);
@@ -718,16 +715,17 @@ _e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
if ((x == sd->x) && (y == sd->y)) return;
{
Eina_List *l;
+ Evas_Object *item;
Evas_Coord dx, dy;
dx = x - sd->x;
dy = y - sd->y;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
Evas_Coord ox, oy;
- evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
- evas_object_move(l->data, ox + dx, oy + dy);
+ evas_object_geometry_get(item, &ox, &oy, NULL, NULL);
+ evas_object_move(item, ox + dx, oy + dy);
}
}
sd->x = x;
diff --git a/src/bin/e_canvas.c b/src/bin/e_canvas.c
index 7aade599c..ec7471890 100644
--- a/src/bin/e_canvas.c
+++ b/src/bin/e_canvas.c
@@ -80,13 +80,12 @@ EAPI void
e_canvas_recache(void)
{
Eina_List *l;
-
- for (l = _e_canvases; l; l = l->next)
+ Ecore_Evas *ee;
+
+ EINA_LIST_FOREACH(_e_canvases, l, ee)
{
- Ecore_Evas *ee;
Evas *e;
- ee = l->data;
e = ecore_evas_get(ee);
evas_image_cache_set(e, e_config->image_cache * 1024);
evas_font_cache_set(e, e_config->font_cache * 1024);
@@ -111,13 +110,12 @@ EAPI void
e_canvas_cache_flush(void)
{
Eina_List *l;
-
- for (l = _e_canvases; l; l = l->next)
+ Ecore_Evas *ee;
+
+ EINA_LIST_FOREACH(_e_canvases, l, ee)
{
- Ecore_Evas *ee;
Evas *e;
- ee = l->data;
e = ecore_evas_get(ee);
evas_image_cache_flush(e);
evas_font_cache_flush(e);
@@ -130,13 +128,12 @@ EAPI void
e_canvas_cache_reload(void)
{
Eina_List *l;
-
- for (l = _e_canvases; l; l = l->next)
+ Ecore_Evas *ee;
+
+ EINA_LIST_FOREACH(_e_canvases, l, ee)
{
- Ecore_Evas *ee;
Evas *e;
- ee = l->data;
e = ecore_evas_get(ee);
evas_image_cache_reload(e);
}
@@ -146,13 +143,12 @@ EAPI void
e_canvas_idle_flush(void)
{
Eina_List *l;
-
- for (l = _e_canvases; l; l = l->next)
+ Ecore_Evas *ee;
+
+ EINA_LIST_FOREACH(_e_canvases, l, ee)
{
- Ecore_Evas *ee;
Evas *e;
- ee = l->data;
e = ecore_evas_get(ee);
evas_render_idle_flush(e);
}
@@ -162,13 +158,12 @@ EAPI void
e_canvas_rehint(void)
{
Eina_List *l;
-
- for (l = _e_canvases; l; l = l->next)
+ Ecore_Evas *ee;
+
+ EINA_LIST_FOREACH(_e_canvases, l, ee)
{
- Ecore_Evas *ee;
Evas *e;
- ee = l->data;
e = ecore_evas_get(ee);
if (e_config->font_hinting == 0)
evas_font_hinting_set(e, EVAS_FONT_HINTING_BYTECODE);
diff --git a/src/bin/e_color_class.c b/src/bin/e_color_class.c
index 63cc9d0aa..98bfd76d4 100644
--- a/src/bin/e_color_class.c
+++ b/src/bin/e_color_class.c
@@ -7,12 +7,10 @@ EAPI int
e_color_class_init(void)
{
Eina_List *l;
+ E_Color_Class *cc;
- for (l = e_config->color_classes; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->color_classes, l, cc)
{
- E_Color_Class *cc;
-
- cc = l->data;
if (!cc) continue;
printf("INIT CC: %s, %d %d %d %d\n", cc->name, cc->r, cc->g, cc->b, cc->a);
@@ -90,9 +88,8 @@ e_color_class_find(const char *name)
Eina_List *l;
E_Color_Class *cc = NULL;
- for (l = e_config->color_classes; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->color_classes, l, cc)
{
- cc = l->data;
if (!cc) continue;
if (!strcmp(cc->name, name))
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index c0ee7cea7..737ab2871 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -1303,8 +1303,6 @@ e_config_domain_load(const char *domain, E_Config_DD *edd)
for (i =1; i <= _e_config_revisions; i++)
{
- char buf2[4096];
-
e_user_dir_snprintf(buf, sizeof(buf), "config/%s/%s.%i.cfg",
_e_config_profile, domain, i);
ef = eet_open(buf, EET_FILE_MODE_READ);
@@ -1450,12 +1448,10 @@ EAPI E_Config_Binding_Mouse *
e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in)
{
Eina_List *l;
-
- for (l = e_config->mouse_bindings; l; l = l->next)
+ E_Config_Binding_Mouse *eb;
+
+ EINA_LIST_FOREACH(e_config->mouse_bindings, l, eb)
{
- E_Config_Binding_Mouse *eb;
-
- eb = l->data;
if ((eb->context == eb_in->context) &&
(eb->button == eb_in->button) &&
(eb->modifiers == eb_in->modifiers) &&
@@ -1473,12 +1469,10 @@ EAPI E_Config_Binding_Key *
e_config_binding_key_match(E_Config_Binding_Key *eb_in)
{
Eina_List *l;
+ E_Config_Binding_Key *eb;
- for (l = e_config->key_bindings; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->mouse_bindings, l, eb)
{
- E_Config_Binding_Key *eb;
-
- eb = l->data;
if ((eb->context == eb_in->context) &&
(eb->modifiers == eb_in->modifiers) &&
(eb->any_mod == eb_in->any_mod) &&
@@ -1497,12 +1491,10 @@ EAPI E_Config_Binding_Edge *
e_config_binding_edge_match(E_Config_Binding_Edge *eb_in)
{
Eina_List *l;
+ E_Config_Binding_Edge *eb;
- for (l = e_config->edge_bindings; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->edge_bindings, l, eb)
{
- E_Config_Binding_Edge *eb;
-
- eb = l->data;
if ((eb->context == eb_in->context) &&
(eb->modifiers == eb_in->modifiers) &&
(eb->any_mod == eb_in->any_mod) &&
@@ -1521,12 +1513,10 @@ EAPI E_Config_Binding_Signal *
e_config_binding_signal_match(E_Config_Binding_Signal *eb_in)
{
Eina_List *l;
+ E_Config_Binding_Signal *eb;
- for (l = e_config->signal_bindings; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->signal_bindings, l, eb)
{
- E_Config_Binding_Signal *eb;
-
- eb = l->data;
if ((eb->context == eb_in->context) &&
(eb->modifiers == eb_in->modifiers) &&
(eb->any_mod == eb_in->any_mod) &&
@@ -1547,12 +1537,10 @@ EAPI E_Config_Binding_Wheel *
e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in)
{
Eina_List *l;
-
- for (l = e_config->wheel_bindings; l; l = l->next)
+ E_Config_Binding_Wheel *eb;
+
+ EINA_LIST_FOREACH(e_config->wheel_bindings, l, eb)
{
- E_Config_Binding_Wheel *eb;
-
- eb = l->data;
if ((eb->context == eb_in->context) &&
(eb->direction == eb_in->direction) &&
(eb->z == eb_in->z) &&
diff --git a/src/bin/e_config_dialog.c b/src/bin/e_config_dialog.c
index cf02f84d1..7836a7725 100644
--- a/src/bin/e_config_dialog.c
+++ b/src/bin/e_config_dialog.c
@@ -83,10 +83,8 @@ e_config_dialog_find(const char *name, const char *class)
Eina_List *l;
E_Config_Dialog *cfd;
- for (l = _e_config_dialog_list; l; l = l->next)
+ EINA_LIST_FOREACH(_e_config_dialog_list, l, cfd)
{
- cfd = l->data;
-
if ((!e_util_strcmp(name, cfd->name)) &&
(!e_util_strcmp(class, cfd->class)))
{
@@ -116,12 +114,11 @@ EAPI E_Config_Dialog *
e_config_dialog_get(const char *name, const char *class)
{
Eina_List *l;
+ E_Config_Dialog *cfd;
- for (l = _e_config_dialog_list; l; l = l->next)
+ EINA_LIST_FOREACH(_e_config_dialog_list, l, cfd)
{
- E_Config_Dialog *cfd;
-
- if (!(cfd = l->data)) continue;
+ if (!cfd) continue;
if ((!e_util_strcmp(name, cfd->name)) &&
(!e_util_strcmp(class, cfd->class)))
{
diff --git a/src/bin/e_container.c b/src/bin/e_container.c
index b79b9ddf3..a5f6a56a9 100644
--- a/src/bin/e_container.c
+++ b/src/bin/e_container.c
@@ -51,11 +51,7 @@ e_container_init(void)
EAPI int
e_container_shutdown(void)
{
- while (handlers)
- {
- ecore_event_handler_del(handlers->data);
- handlers = eina_list_remove_list(handlers, handlers);
- }
+ E_FREE_LIST(handlers, ecore_event_handler_del);
return 1;
}
@@ -159,11 +155,9 @@ e_container_new(E_Manager *man)
screens = (Eina_List *)e_xinerama_screens_get();
if (screens)
{
- for (l = screens; l; l = l->next)
+ E_Screen *scr;
+ EINA_LIST_FOREACH(screens, l, scr)
{
- E_Screen *scr;
-
- scr = l->data;
zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
}
}
@@ -208,35 +202,32 @@ EAPI E_Container *
e_container_current_get(E_Manager *man)
{
Eina_List *l;
+ E_Container *con;
E_OBJECT_CHECK_RETURN(man, NULL);
E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
- for (l = man->containers; l; l = l->next)
+ EINA_LIST_FOREACH(man->containers, l, con)
{
- E_Container *con;
-
- if (!(con = l->data)) continue;
+ if (!con) continue;
if (con->visible) return con;
}
/* If noone is available, return the first */
if (!man->containers) return NULL;
l = man->containers;
- return (E_Container *)l->data;
+ return (E_Container *)eina_list_data_get(l);
}
EAPI E_Container *
e_container_number_get(E_Manager *man, int num)
{
Eina_List *l;
+ E_Container *con;
E_OBJECT_CHECK_RETURN(man, NULL);
E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL);
- for (l = man->containers; l; l = l->next)
+ EINA_LIST_FOREACH(man->containers, l, con)
{
- E_Container *con;
-
- con = l->data;
if (con->num == num) return con;
}
return NULL;
@@ -306,14 +297,12 @@ EAPI E_Zone *
e_container_zone_at_point_get(E_Container *con, int x, int y)
{
Eina_List *l = NULL;
+ E_Zone *zone = NULL;
E_OBJECT_CHECK_RETURN(con, NULL);
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
- for (l = con->zones; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
{
- E_Zone *zone;
-
- zone = l->data;
if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h))
return zone;
}
@@ -324,14 +313,12 @@ EAPI E_Zone *
e_container_zone_number_get(E_Container *con, int num)
{
Eina_List *l = NULL;
+ E_Zone *zone = NULL;
E_OBJECT_CHECK_RETURN(con, NULL);
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
- for (l = con->zones; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
{
- E_Zone *zone;
-
- zone = l->data;
if (zone->num == num) return zone;
}
return NULL;
@@ -341,14 +328,12 @@ EAPI E_Zone *
e_container_zone_id_get(E_Container *con, int id)
{
Eina_List *l = NULL;
+ E_Zone *zone = NULL;
E_OBJECT_CHECK_RETURN(con, NULL);
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
- for (l = con->zones; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
{
- E_Zone *zone;
-
- zone = l->data;
if (zone->id == id) return zone;
}
return NULL;
@@ -459,15 +444,13 @@ EAPI void
e_container_shape_change_callback_del(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data)
{
Eina_List *l = NULL;
+ E_Container_Shape_Callback *cb = NULL;
/* FIXME: if we call this from within a callback we are in trouble */
E_OBJECT_CHECK(con);
E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
- for (l = con->shape_change_cb; l; l = l->next)
+ EINA_LIST_FOREACH(con->shape_change_cb, l, cb)
{
- E_Container_Shape_Callback *cb;
-
- cb = l->data;
if ((cb->func == func) && (cb->data == data))
{
con->shape_change_cb = eina_list_remove_list(con->shape_change_cb, l);
@@ -488,7 +471,6 @@ e_container_shape_rects_get(E_Container_Shape *es)
EAPI void
e_container_shape_rects_set(E_Container_Shape *es, Ecore_X_Rectangle *rects, int num)
{
- Eina_List *l = NULL;
int i;
E_Rect *r;
@@ -496,9 +478,7 @@ e_container_shape_rects_set(E_Container_Shape *es, Ecore_X_Rectangle *rects, int
E_OBJECT_TYPE_CHECK(es, E_CONTAINER_SHAPE_TYPE);
if (es->shape)
{
- for (l = es->shape; l; l = l->next)
- free(l->data);
- eina_list_free(es->shape);
+ E_FREE_LIST(es->shape, free);
es->shape = NULL;
}
if ((rects) && (num == 1) &&
@@ -668,8 +648,8 @@ e_container_border_raise(E_Border *bd)
/* Find the window below this one */
l = eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd);
- if (l->prev)
- above = l->prev->data;
+ if (eina_list_prev(l))
+ above = eina_list_data_get(eina_list_prev(l));
else
{
/* Need to check the layers below */
@@ -678,7 +658,7 @@ e_container_border_raise(E_Border *bd)
if ((bd->zone->container->layers[i].clients) &&
(l = eina_list_last(bd->zone->container->layers[i].clients)))
{
- above = l->data;
+ above = eina_list_data_get(l);
break;
}
}
@@ -722,8 +702,8 @@ e_container_border_lower(E_Border *bd)
/* Find the window above this one */
l = eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd);
- if (l->next)
- below = l->next->data;
+ if (eina_list_next(l))
+ below = eina_list_data_get(eina_list_next(l));
else
{
/* Need to check the layers above */
@@ -731,7 +711,7 @@ e_container_border_lower(E_Border *bd)
{
if (bd->zone->container->layers[i].clients)
{
- below = bd->zone->container->layers[i].clients->data;
+ below = eina_list_data_get(bd->zone->container->layers[i].clients);
break;
}
}
@@ -849,9 +829,9 @@ e_container_border_list_next(E_Border_List *list)
if (!list->clients) return NULL;
- bd = list->clients->data;
+ bd = eina_list_data_get(list->clients);
- list->clients = list->clients->next;
+ list->clients = eina_list_next(list->clients);
while ((list->layer < 6) && (!list->clients))
list->clients = list->container->layers[++list->layer].clients;
return bd;
@@ -864,9 +844,9 @@ e_container_border_list_prev(E_Border_List *list)
if (!list->clients) return NULL;
- bd = list->clients->data;
+ bd = eina_list_data_get(list->clients);
- list->clients = list->clients->prev;
+ list->clients = eina_list_prev(list->clients);
while ((list->layer > 0) && (!list->clients))
{
list->layer--;
@@ -886,20 +866,14 @@ e_container_border_list_free(E_Border_List *list)
EAPI void
e_container_all_freeze(void)
{
- Eina_List *managers, *l;
+ Eina_List *l, *ll;
+ E_Manager *man;
+ E_Container *con;
- managers = e_manager_list();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- Eina_List *ll;
- E_Manager *man;
-
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- E_Container *con;
-
- con = ll->data;
evas_event_freeze(con->bg_evas);
}
}
@@ -908,20 +882,14 @@ e_container_all_freeze(void)
EAPI void
e_container_all_thaw(void)
{
- Eina_List *managers, *l;
+ Eina_List *l, *ll;
+ E_Manager *man;
+ E_Container *con;
- managers = e_manager_list();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- Eina_List *ll;
- E_Manager *man;
-
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- E_Container *con;
-
- con = ll->data;
evas_event_thaw(con->bg_evas);
}
}
@@ -944,21 +912,15 @@ _e_container_free(E_Container *con)
for (i = 0; i < 7; i++)
{
- for (l = con->layers[i].clients; l;)
+ EINA_LiST_FOREACH(con->layers[i].clients, l, tmp)
{
- tmp = l;
- l = l->next;
- e_object_free(E_OBJECT(tmp->data));
+ e_object_free(E_OBJECT(tmp));
}
}
*/
l = con->zones;
con->zones = NULL;
- while (l)
- {
- e_object_del(E_OBJECT(l->data));
- l = eina_list_remove_list(l, l);
- }
+ E_FREE_LIST(l, e_object_del);
con->manager->containers = eina_list_remove(con->manager->containers, con);
e_canvas_del(con->bg_ecore_evas);
ecore_evas_free(con->bg_ecore_evas);
@@ -973,20 +935,14 @@ _e_container_free(E_Container *con)
static E_Container *
_e_container_find_by_event_window(Ecore_X_Window win)
{
- Eina_List *managers, *l;
+ Eina_List *l, *ll;
+ E_Manager *man;
+ E_Container *con;
- managers = e_manager_list();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- Eina_List *ll;
- E_Manager *man;
-
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- E_Container *con;
-
- con = ll->data;
if (con->event_win == win) return con;
}
}
@@ -1115,12 +1071,8 @@ _e_container_shape_del(E_Container_Shape *es)
static void
_e_container_shape_free(E_Container_Shape *es)
{
- Eina_List *l = NULL;
-
es->con->shapes = eina_list_remove(es->con->shapes, es);
- for (l = es->shape; l; l = l->next)
- free(l->data);
- eina_list_free(es->shape);
+ E_FREE_LIST(es->shape, free);
free(es);
}
@@ -1128,13 +1080,12 @@ static void
_e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change ch)
{
Eina_List *l = NULL;
+ E_Container_Shape_Callback *cb = NULL;
if ((!es) || (!es->con) || (!es->con->shape_change_cb)) return;
- for (l = es->con->shape_change_cb; l; l = l->next)
+ EINA_LIST_FOREACH(es->con->shape_change_cb, l, cb)
{
- E_Container_Shape_Callback *cb;
-
- if (!(cb = l->data)) continue;
+ if (!cb) continue;
cb->func(cb->data, es, ch);
}
}
@@ -1144,6 +1095,8 @@ _e_container_resize_handle(E_Container *con)
{
E_Event_Container_Resize *ev;
Eina_List *l, *screens, *zones = NULL;
+ E_Zone *zone;
+ E_Screen *scr;
int i;
ev = calloc(1, sizeof(E_Event_Container_Resize));
@@ -1155,14 +1108,10 @@ _e_container_resize_handle(E_Container *con)
if (screens)
{
- for (l = con->zones; l; l = l->next)
- zones = eina_list_append(zones, l->data);
- for (l = screens; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
+ zones = eina_list_append(zones, zone);
+ EINA_LIST_FOREACH(screens, l, scr)
{
- E_Screen *scr;
- E_Zone *zone;
-
- scr = l->data;
zone = e_container_zone_id_get(con, scr->escreen);
if (zone)
{
@@ -1173,14 +1122,12 @@ _e_container_resize_handle(E_Container *con)
else
{
Eina_List *ll;
+ E_Config_Shelf *cf_es;
zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h);
/* find any shelves configured for this zone and add them in */
- for (ll = e_config->shelves; ll; ll = ll->next)
+ EINA_LIST_FOREACH(e_config->shelves, ll, cf_es)
{
- E_Config_Shelf *cf_es;
-
- cf_es = ll->data;
if (e_util_container_zone_id_get(cf_es->container, cf_es->zone) == zone)
e_shelf_config_new(zone, cf_es);
}
@@ -1191,37 +1138,28 @@ _e_container_resize_handle(E_Container *con)
E_Zone *spare_zone = NULL;
Eina_List *ll;
- for (ll = con->zones; ll; ll = ll->next)
+ EINA_LIST_FOREACH(con->zones, ll, spare_zone)
{
- spare_zone = ll->data;
if (eina_list_data_find(zones, spare_zone))
spare_zone = NULL;
else break;
}
- while (zones)
+ EINA_LIST_FREE(zones, zone)
{
- E_Zone *zone;
Eina_List *shelves, *ll, *del_shelves;
+ E_Shelf *es;
E_Border_List *bl;
E_Border *bd;
- zone = zones->data;
/* delete any shelves on this zone */
shelves = e_shelf_list();
del_shelves = NULL;
- for (ll = shelves; ll; ll = ll->next)
+ EINA_LIST_FOREACH(shelves, ll, es)
{
- E_Shelf *es;
-
- es = ll->data;
if (es->zone == zone)
del_shelves = eina_list_append(del_shelves, es);
}
- while (del_shelves)
- {
- e_object_del(E_OBJECT(del_shelves->data));
- del_shelves = eina_list_remove_list(del_shelves, del_shelves);
- }
+ E_FREE_LIST(del_shelves, e_object_del);
bl = e_container_border_list_first(zone->container);
while ((bd = e_container_border_list_next(bl)))
{
@@ -1236,7 +1174,6 @@ _e_container_resize_handle(E_Container *con)
}
e_container_border_list_free(bl);
e_object_del(E_OBJECT(zone));
- zones = eina_list_remove_list(zones, zones);
}
}
}
@@ -1254,17 +1191,15 @@ _e_container_resize_handle(E_Container *con)
for (i = 0; i < 7; i++)
{
Eina_List *tmp = NULL;
+ E_Border *bd;
/* Make temporary list as e_border_res_change_geometry_restore
* rearranges the order. */
- for (l = con->layers[i].clients; l; l = l->next)
- tmp = eina_list_append(tmp, l->data);
+ EINA_LIST_FOREACH(con->layers[i].clients, l, bd)
+ tmp = eina_list_append(tmp, bd);
- for (l = tmp; l; l = l->next)
+ EINA_LIST_FOREACH(tmp, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
e_border_res_change_geometry_save(bd);
e_border_res_change_geometry_restore(bd);
}
diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c
index 286a5b166..2bd8299ed 100644
--- a/src/bin/e_desk.c
+++ b/src/bin/e_desk.c
@@ -49,6 +49,7 @@ e_desk_new(E_Zone *zone, int x, int y)
{
E_Desk *desk;
Eina_List *l;
+ E_Config_Desktop_Name *cfname;
char name[40];
int ok;
@@ -64,11 +65,8 @@ e_desk_new(E_Zone *zone, int x, int y)
/* Get current desktop's name */
ok = 0;
- for (l = e_config->desktop_names; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
- E_Config_Desktop_Name *cfname;
-
- cfname = l->data;
if ((cfname->container >= 0) &&
(zone->container->num != cfname->container)) continue;
if ((cfname->zone >= 0) &&
@@ -125,12 +123,10 @@ EAPI void
e_desk_name_del(int container, int zone, int desk_x, int desk_y)
{
Eina_List *l = NULL;
+ E_Config_Desktop_Name *cfname = NULL;
- for (l = e_config->desktop_names; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
- E_Config_Desktop_Name *cfname;
-
- cfname = l->data;
if ((cfname->container == container) && (cfname->zone == zone) &&
(cfname->desk_x == desk_x) && (cfname->desk_y == desk_y))
{
@@ -151,18 +147,16 @@ e_desk_name_update(void)
E_Container *con;
E_Zone *zone;
E_Desk *desk;
+ E_Config_Desktop_Name *cfname;
int d_x, d_y, ok;
char name[40];
- for (m = e_manager_list(); m; m = m->next)
+ EINA_LIST_FOREACH(e_manager_list(), m, man)
{
- man = m->data;
- for (c = man->containers; c; c = c->next)
+ EINA_LIST_FOREACH(man->containers, c, con)
{
- con = c->data;
- for (z = con->zones; z; z = z->next)
+ EINA_LIST_FOREACH(con->zones, z, zone)
{
- zone = z->data;
for (d_x = 0; d_x < zone->desk_x_count; d_x++)
{
for (d_y = 0; d_y < zone->desk_y_count; d_y++)
@@ -170,11 +164,8 @@ e_desk_name_update(void)
desk = zone->desks[d_x + zone->desk_x_count * d_y];
ok = 0;
- for (l = e_config->desktop_names; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->desktop_names, l, cfname)
{
- E_Config_Desktop_Name *cfname;
-
- cfname = l->data;
if ((cfname->container >= 0) &&
(con->num != cfname->container)) continue;
if ((cfname->zone >= 0) &&
@@ -209,6 +200,7 @@ e_desk_show(E_Desk *desk)
E_Event_Desk_Before_Show *eev;
E_Event_Desk_After_Show *eeev;
Eina_List *l;
+ E_Shelf *es;
int was_zone = 0, x, y, dx = 0, dy = 0, prev_x = 0, prev_y = 0;
E_OBJECT_CHECK(desk);
@@ -288,15 +280,14 @@ e_desk_show(E_Desk *desk)
e_object_ref(E_OBJECT(desk));
ecore_event_add(E_EVENT_DESK_SHOW, ev, _e_border_event_desk_show_free, NULL);
- for (l = e_shelf_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
Eina_List *ll;
- E_Shelf *es;
E_Config_Shelf *cf_es;
E_Zone *zone;
+ E_Config_Shelf_Desk *sd;
int show_shelf=0;
- es = l->data;
if (!es) continue;
if (!es->cfg->desk_show_mode) continue;
cf_es = es->cfg;
@@ -305,11 +296,8 @@ e_desk_show(E_Desk *desk)
zone = e_util_zone_current_get(e_manager_current_get());
if (cf_es->zone != zone->num) continue;
- for (ll = es->cfg->desk_list; ll; ll = ll->next)
+ EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
{
- E_Config_Shelf_Desk *sd;
-
- sd = ll->data;
if (!sd) continue;
if ((desk->x == sd->x) && (desk->y == sd->y))
{
@@ -382,9 +370,8 @@ e_desk_last_focused_focus(E_Desk *desk)
Eina_List *l = NULL;
E_Border *bd;
- for (l = e_border_focus_stack_get(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_focus_stack_get(), l, bd)
{
- bd = l->data;
if ((!bd->iconic) && (bd->visible) && (bd->desk == desk) &&
(bd->client.icccm.accepts_focus || bd->client.icccm.take_focus) &&
(bd->client.netwm.type != ECORE_X_WINDOW_TYPE_DOCK) &&
diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c
index a3fcc8509..8550bc624 100644
--- a/src/bin/e_desklock.c
+++ b/src/bin/e_desklock.c
@@ -150,6 +150,7 @@ EAPI int
e_desklock_show(void)
{
Eina_List *managers, *l, *l2, *l3;
+ E_Manager *man;
E_Desklock_Popup_Data *edp;
Evas_Coord mw, mh;
E_Zone *current_zone;
@@ -204,13 +205,11 @@ e_desklock_show(void)
managers = e_manager_list();
if (!e_grabinput_get(edd->elock_wnd, 0, edd->elock_wnd))
{
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- E_Manager *man;
Ecore_X_Window *windows;
int wnum;
- man = l->data;
windows = ecore_x_window_children_get(man->root, &wnum);
if (windows)
{
@@ -254,21 +253,14 @@ e_desklock_show(void)
zone_counter = 0;
total_zone_num = _e_desklock_zone_num_get();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- E_Manager *man;
-
- man = l->data;
- for (l2 = man->containers; l2; l2 = l2->next)
+ E_Container *con;
+ EINA_LIST_FOREACH(man->containers, l2, con)
{
- E_Container *con;
-
- con = l2->data;
- for (l3 = con->zones; l3; l3 = l3->next)
+ E_Zone *zone;
+ EINA_LIST_FOREACH(con->zones, l3, zone)
{
- E_Zone *zone;
-
- zone = l3->data;
edp = E_NEW(E_Desklock_Popup_Data, 1);
if (edp)
{
@@ -413,10 +405,9 @@ e_desklock_hide(void)
if (edd->elock_grab_break_wnd)
ecore_x_window_show(edd->elock_grab_break_wnd);
-
- while (edd->elock_wnd_list)
+
+ EINA_LIST_FREE(edd->elock_wnd_list, edp)
{
- edp = edd->elock_wnd_list->data;
if (edp)
{
e_popup_hide(edp->popup_wnd);
@@ -429,14 +420,9 @@ e_desklock_hide(void)
e_util_defer_object_del(E_OBJECT(edp->popup_wnd));
E_FREE(edp);
}
- edd->elock_wnd_list = eina_list_remove_list(edd->elock_wnd_list, edd->elock_wnd_list);
}
- while (edd->handlers)
- {
- ecore_event_handler_del(edd->handlers->data);
- edd->handlers = eina_list_remove_list(edd->handlers, edd->handlers);
- }
+ E_FREE_LIST(edd->handlers, ecore_event_handler_del);
e_grabinput_release(edd->elock_wnd, edd->elock_wnd);
ecore_x_window_free(edd->elock_wnd);
@@ -533,10 +519,8 @@ _e_desklock_cb_mouse_move(void *data, int type, void *event)
if (current_zone == last_active_zone)
return 1;
- for (l = edd->elock_wnd_list; l; l = l->next)
+ EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
{
- edp = l->data;
-
if (!edp) continue;
if (edp->popup_wnd->zone == last_active_zone)
@@ -561,9 +545,8 @@ _e_desklock_passwd_update(void)
*pp = '*';
*pp = 0;
- for (l = edd->elock_wnd_list; l; l = l->next)
+ EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
{
- edp = l->data;
edje_object_part_text_set(edp->login_box, "e.text.password",
passwd_hidden);
}
@@ -606,16 +589,14 @@ _e_desklock_zone_num_get(void)
{
int num;
Eina_List *l, *l2;
+ E_Manager *man;
num = 0;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man = l->data;
-
- for (l2 = man->containers; l2; l2 = l2->next)
+ E_Container *con;
+ EINA_LIST_FOREACH(man->containers, l2, con)
{
- E_Container *con = l2->data;
-
num += eina_list_count(con->zones);
}
}
@@ -657,6 +638,7 @@ static void
_e_desklock_state_set(int state)
{
Eina_List *l;
+ E_Desklock_Popup_Data *edp;
const char *signal, *text;
if (!edd) return;
@@ -672,10 +654,8 @@ _e_desklock_state_set(int state)
text = "The password you entered is invalid. Try again.";
}
- for (l = edd->elock_wnd_list; l; l = l->next)
+ EINA_LIST_FOREACH(edd->elock_wnd_list, l, edp)
{
- E_Desklock_Popup_Data *edp;
- edp = l->data;
edje_object_signal_emit(edp->login_box, signal, "e.desklock");
edje_object_signal_emit(edp->bg_object, signal, "e.desklock");
edje_object_part_text_set(edp->login_box, "e.text.title", text);
diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c
index 520f979da..6e4962919 100644
--- a/src/bin/e_dnd.c
+++ b/src/bin/e_dnd.c
@@ -129,22 +129,11 @@ e_dnd_init(void)
EAPI int
e_dnd_shutdown(void)
{
- Ecore_Event_Handler *h;
+ E_FREE_LIST(_drag_list, e_object_del);
- while (_drag_list)
- {
- E_Drag *drag = _drag_list->data;
- e_object_del(E_OBJECT(drag));
- }
-
- while (_drop_handlers)
- {
- E_Drop_Handler *h = _drop_handlers->data;
- e_drop_handler_del(h);
- }
+ E_FREE_LIST(_drop_handlers, e_drop_handler_del);
- EINA_LIST_FREE(_event_handlers, h)
- ecore_event_handler_del(h);
+ E_FREE_LIST(_event_handlers, ecore_event_handler_del);
eina_hash_free(_drop_win_hash);
diff --git a/src/bin/e_exehist.c b/src/bin/e_exehist.c
index de2d17e7d..fd8f0bc85 100644
--- a/src/bin/e_exehist.c
+++ b/src/bin/e_exehist.c
@@ -116,9 +116,8 @@ e_exehist_del(const char *exe)
_e_exehist_load();
if (!_e_exehist) return;
- for (l = _e_exehist->history; l; l = l->next)
+ EINA_LIST_FOREACH(_e_exehist->history, l, ei)
{
- ei = l->data;
if ((ei->exe) && (!strcmp(exe, ei->exe)))
{
eina_stringshare_del(ei->exe);
@@ -151,6 +150,7 @@ EAPI int
e_exehist_popularity_get(const char *exe)
{
Eina_List *l;
+ E_Exehist_Item *ei;
const char *normal;
int count = 0;
@@ -158,11 +158,8 @@ e_exehist_popularity_get(const char *exe)
if (!_e_exehist) return 0;
normal = _e_exehist_normalize_exe(exe);
if (!normal) return 0;
- for (l = _e_exehist->history; l; l = l->next)
+ EINA_LIST_FOREACH(_e_exehist->history, l, ei)
{
- E_Exehist_Item *ei;
-
- ei = l->data;
if ((ei->normalized_exe) && (!strcmp(normal, ei->normalized_exe)))
count++;
}
@@ -175,17 +172,15 @@ EAPI double
e_exehist_newest_run_get(const char *exe)
{
Eina_List *l;
+ E_Exehist_Item *ei;
const char *normal;
_e_exehist_load();
if (!_e_exehist) return 0.0;
normal = _e_exehist_normalize_exe(exe);
if (!normal) return 0.0;
- for (l = eina_list_last(_e_exehist->history); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(_e_exehist->history, l, ei)
{
- E_Exehist_Item *ei;
-
- ei = l->data;
if ((ei->normalized_exe) && (!strcmp(normal, ei->normalized_exe)))
{
eina_stringshare_del(normal);
@@ -244,11 +239,10 @@ e_exehist_sorted_list_get(E_Exehist_Sort sort_type, int max)
}
else
{
- for (m = list; m; m = m->next)
+ const char *exe;
+ EINA_LIST_FOREACH(list, m, exe)
{
- const char *exe;
-
- if (!(exe = m->data)) continue;
+ if (!exe) continue;
if (!strcmp(exe, ei->exe))
{
bad = 1;
@@ -295,9 +289,8 @@ e_exehist_mime_desktop_add(const char *mime, Efreet_Desktop *desktop)
f = efreet_util_path_to_file_id(desktop->orig_path);
if (!f) return;
- for (l = _e_exehist->mimes; l; l = l->next)
+ EINA_LIST_FOREACH(_e_exehist->mimes, l, ei)
{
- ei = l->data;
if ((ei->launch_method) && (!strcmp(mime, ei->launch_method)))
{
if ((ei->exe) && (!strcmp(f, ei->exe)))
@@ -338,9 +331,8 @@ e_exehist_mime_desktop_get(const char *mime)
if (!mime) return NULL;
_e_exehist_load();
if (!_e_exehist) return NULL;
- for (l = _e_exehist->mimes; l; l = l->next)
+ EINA_LIST_FOREACH(_e_exehist->mimes, l, ei)
{
- ei = l->data;
if ((ei->launch_method) && (!strcmp(mime, ei->launch_method)))
{
desktop = NULL;
@@ -380,26 +372,19 @@ _e_exehist_clear(void)
{
if (_e_exehist)
{
- while (_e_exehist->history)
+ E_Exehist_Item *ei;
+ EINA_LIST_FREE(_e_exehist->history, ei)
{
- E_Exehist_Item *ei;
-
- ei = _e_exehist->history->data;
eina_stringshare_del(ei->exe);
eina_stringshare_del(ei->normalized_exe);
eina_stringshare_del(ei->launch_method);
free(ei);
- _e_exehist->history = eina_list_remove_list(_e_exehist->history, _e_exehist->history);
}
- while (_e_exehist->mimes)
+ EINA_LIST_FREE(_e_exehist->mimes, ei)
{
- E_Exehist_Item *ei;
-
- ei = _e_exehist->mimes->data;
eina_stringshare_del(ei->exe);
eina_stringshare_del(ei->launch_method);
free(ei);
- _e_exehist->mimes = eina_list_remove_list(_e_exehist->mimes, _e_exehist->mimes);
}
}
}
@@ -425,7 +410,7 @@ _e_exehist_limit(void)
{
E_Exehist_Item *ei;
- ei = _e_exehist->history->data;
+ ei = eina_list_data_get(_e_exehist->history);
eina_stringshare_del(ei->exe);
eina_stringshare_del(ei->normalized_exe);
eina_stringshare_del(ei->launch_method);
@@ -436,7 +421,7 @@ _e_exehist_limit(void)
{
E_Exehist_Item *ei;
- ei = _e_exehist->mimes->data;
+ ei = eina_list_data_get(_e_exehist->mimes);
eina_stringshare_del(ei->exe);
eina_stringshare_del(ei->launch_method);
free(ei);
diff --git a/src/bin/e_flowlayout.c b/src/bin/e_flowlayout.c
index 929f9a876..a8f600ba3 100644
--- a/src/bin/e_flowlayout.c
+++ b/src/bin/e_flowlayout.c
@@ -230,14 +230,16 @@ e_flowlayout_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *befo
E_Smart_Data *sd;
int i = 0;
Eina_List *l;
+ Evas_Object *item;
sd = evas_object_smart_data_get(obj);
if (!sd) return 0;
_e_flowlayout_smart_adopt(sd, child);
sd->items = eina_list_prepend_relative(sd->items, child, before);
- for (i = 0, l = sd->items; l; l = l->next, i++)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- if (l->data == child) break;
+ if (item == child) break;
+ i++;
}
sd->changed = 1;
if (sd->frozen <= 0) _e_flowlayout_smart_reconfigure(sd);
@@ -250,14 +252,16 @@ e_flowlayout_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after
E_Smart_Data *sd;
int i = 0;
Eina_List *l;
+ Evas_Object *item;
sd = evas_object_smart_data_get(obj);
if (!sd) return 0;
_e_flowlayout_smart_adopt(sd, child);
sd->items = eina_list_append_relative(sd->items, child, after);
- for (i = 0, l = sd->items; l; l = l->next, i++)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- if (l->data == child) break;
+ if (item == child) break;
+ i++;
}
sd->changed = 1;
if (sd->frozen <= 0) _e_flowlayout_smart_reconfigure(sd);
@@ -464,6 +468,7 @@ _e_flowlayout_smart_reconfigure(E_Smart_Data *sd)
{
Evas_Coord x, y, w, h, xx, yy, cr, cc;
Eina_List *l;
+ Evas_Object *obj;
int minw, minh, wdif, hdif;
int count, expand;
@@ -496,12 +501,10 @@ _e_flowlayout_smart_reconfigure(E_Smart_Data *sd)
}
/* Some odd expanding counter */
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Flowlayout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_flowlayout_data");
if (bi)
{
@@ -546,12 +549,10 @@ _e_flowlayout_smart_reconfigure(E_Smart_Data *sd)
cc = 0;
/* Now for the real deal */
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Flowlayout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_flowlayout_data");
if (bi)
{
@@ -720,6 +721,7 @@ static void
_e_flowlayout_smart_extents_calcuate(E_Smart_Data *sd)
{
Eina_List *l;
+ Evas_Object *obj;
int minw, minh, count;
/* FIXME: need to calc max */
@@ -730,12 +732,10 @@ _e_flowlayout_smart_extents_calcuate(E_Smart_Data *sd)
minh = 1;
if (sd->homogenous)
{
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Flowlayout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_flowlayout_data");
if (bi)
{
@@ -794,12 +794,10 @@ _e_flowlayout_smart_extents_calcuate(E_Smart_Data *sd)
/* TODO nonhomogenous */
else
{
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Flowlayout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_flowlayout_data");
if (bi)
{
@@ -901,7 +899,7 @@ _e_flowlayout_smart_del(Evas_Object *obj)
{
Evas_Object *child;
- child = sd->items->data;
+ child = eina_list_data_get(sd->items);
e_flowlayout_unpack(child);
}
evas_object_del(sd->clip);
@@ -918,16 +916,17 @@ _e_flowlayout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
if ((x == sd->x) && (y == sd->y)) return;
{
Eina_List *l;
+ Evas_Object *item;
Evas_Coord dx, dy;
dx = x - sd->x;
dy = y - sd->y;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
Evas_Coord ox, oy;
- evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
- evas_object_move(l->data, ox + dx, oy + dy);
+ evas_object_geometry_get(item, &ox, &oy, NULL, NULL);
+ evas_object_move(item, ox + dx, oy + dy);
}
}
sd->x = x;
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index 438dce9a0..46beb807a 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -1964,7 +1964,7 @@ _e_fm2_icon_thumb_edje_get(Evas *evas, const E_Fm2_Icon *ic, void (*cb) (void *d
Eina_List *l = edje_file_collection_list(buf);
if (!l)
return NULL;
- group = l->data;
+ group = eina_list_data_get(l);
edje_file_collection_list_free(l);
}
@@ -2402,7 +2402,7 @@ _e_fm2_client_messages_flush(void)
cl = _e_fm2_client_get();
if (!cl) break;
- _e_fm2_client_message_flush(cl, _e_fm2_messages->data);
+ _e_fm2_client_message_flush(cl, eina_list_data_get(_e_fm2_messages));
}
}
@@ -2684,7 +2684,7 @@ _e_fm2_file_force_update(const char *path)
{
E_Fm2_Icon *ic;
- ic = _e_fm2_icon_find(l->data, ecore_file_file_get(path));
+ ic = _e_fm2_icon_find(o, ecore_file_file_get(path));
if (ic)
{
E_Fm2_Finfo finf;
@@ -2696,7 +2696,7 @@ _e_fm2_file_force_update(const char *path)
finf.lnk = ic->info.link;
finf.rlnk = ic->info.real_link;
ic->removable_state_change = 1;
- _e_fm2_live_file_changed(l->data, ecore_file_file_get(path),
+ _e_fm2_live_file_changed(o, ecore_file_file_get(path),
&finf);
}
}
@@ -2898,14 +2898,11 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
break;
}
}
- while (dels)
+ EINA_LIST_FREE(dels, obj)
{
- Evas_Object *obj;
E_Fm2_Smart_Data *sd;
- obj = dels->data;
sd = evas_object_smart_data_get(obj);
- dels = eina_list_remove_list(dels, dels);
if ((_e_fm2_list_walking > 0) &&
(eina_list_data_find(_e_fm2_list_remove, obj))) continue;
if (sd->config->view.open_dirs_in_place)
@@ -2916,10 +2913,9 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
_e_fm2_list_walking--;
if (_e_fm2_list_walking == 0)
{
- while (_e_fm2_list_remove)
+ EINA_LIST_FREE(_e_fm2_list_remove, obj)
{
- _e_fm2_list = eina_list_remove(_e_fm2_list, _e_fm2_list_remove->data);
- _e_fm2_list_remove = eina_list_remove_list(_e_fm2_list_remove, _e_fm2_list_remove);
+ _e_fm2_list = eina_list_remove(_e_fm2_list, obj);
}
}
switch (e->minor)
@@ -3000,8 +2996,8 @@ e_fm2_client_data(Ecore_Ipc_Event_Client_Data *e)
a = e_action_find("fileman");
m = e_manager_list();
- if (a && a->func.go && m && m->data)
- a->func.go(E_OBJECT(m->data), mountpoint);
+ if (a && a->func.go && m && eina_list_data_get(m))
+ a->func.go(E_OBJECT(eina_list_data_get(m)), mountpoint);
}
}
}
@@ -3633,19 +3629,19 @@ _e_fm2_queue_process(Evas_Object *obj)
if (sd->tmp.list_index)
{
ll = sd->tmp.list_index;
- for (l = sd->icons; l; l = l->next)
+ for (l = sd->icons; l; l = eina_list_next(l))
{
*ll = l;
ll++;
}
/* binary search first queue */
- ic = sd->queue->data;
+ ic = eina_list_data_get(sd->queue);
p0 = 0; p1 = n;
i = (p0 + p1) / 2;
ll = sd->tmp.list_index;
do
{
- ic2 = ll[i]->data;
+ ic2 = eina_list_data_get(ll[i]);
v = _e_fm2_cb_icon_sort(ic, ic2);
if (v < 0) /* ic should go before ic2 */
p1 = i;
@@ -3676,9 +3672,8 @@ _e_fm2_queue_process(Evas_Object *obj)
}
else
{
- for (; l; l = l->next)
+ EINA_LIST_FOREACH(l, l, ic2)
{
- ic2 = l->data;
if (_e_fm2_cb_icon_sort(ic, ic2) < 0)
{
if (l == sd->icons)
@@ -3936,7 +3931,6 @@ _e_fm2_icons_place_icon(E_Fm2_Icon *ic)
_e_fm2_icon_place_relative(ic, ic2, 0, 1, 1, 0);
if (_e_fm2_icons_icon_row_ok(ic) && !_e_fm2_icons_icon_overlaps(ic)) return;
*/
-// for (l = ic->sd->icons_place; l; l = l->next)
EINA_LIST_FOREACH(ic->sd->icons, l, ic2)
{
if ((ic2 != ic) && (ic2->saved_pos))
@@ -4111,11 +4105,7 @@ _e_fm2_icons_free(Evas_Object *obj)
if (!sd) return;
_e_fm2_queue_free(obj);
/* free all icons */
- while (sd->icons)
- {
- _e_fm2_icon_free(sd->icons->data);
- sd->icons = eina_list_remove_list(sd->icons, sd->icons);
- }
+ E_FREE_LIST(sd->icons, _e_fm2_icon_free);
eina_list_free(sd->icons_place);
sd->icons_place = NULL;
sd->tmp.last_insert = NULL;
@@ -5127,7 +5117,7 @@ _e_fm2_icon_sel_first(Evas_Object *obj)
if (!sd) return;
if (!sd->icons) return;
_e_fm2_icon_desel_any(obj);
- ic = sd->icons->data;
+ ic = eina_list_data_get(sd->icons);
_e_fm2_icon_select(ic);
evas_object_smart_callback_call(sd->obj, "selection_change", NULL);
_e_fm2_icon_make_visible(ic);
@@ -5143,7 +5133,7 @@ _e_fm2_icon_sel_last(Evas_Object *obj)
if (!sd) return;
if (!sd->icons) return;
_e_fm2_icon_desel_any(obj);
- ic = eina_list_last(sd->icons)->data;
+ ic = eina_list_data_get(eina_list_last(sd->icons));
_e_fm2_icon_select(ic);
evas_object_smart_callback_call(sd->obj, "selection_change", NULL);
_e_fm2_icon_make_visible(ic);
@@ -5278,13 +5268,13 @@ _e_fm2_icon_next_find(Evas_Object *obj, int next, int match_func(E_Fm2_Icon *ic,
{
if (next == 1)
{
- if (!l->next) return NULL;
- ic_next = l->next->data;
+ if (!eina_list_next(l)) return NULL;
+ ic_next = eina_list_data_get(eina_list_next(l));
}
if (next == -1)
{
- if (!l->prev) return NULL;
- ic_next = l->prev->data;
+ if (!eina_list_prev(l)) return NULL;
+ ic_next = eina_list_data_get(eina_list_prev(l));
}
}
@@ -6187,10 +6177,10 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
if (sd->drop_all) /* drop arbitarily into the dir */
{
/* move file into this fm dir */
- for (ll = fsel, il = isel; ll && il; ll = ll->next, il = il->next)
+ for (ll = fsel, il = isel; ll && il; ll = eina_list_next(ll), il = eina_list_next(il))
{
- ic = il->data;
- fp = ll->data;
+ ic = eina_list_data_get(il);
+ fp = eina_list_data_get(ll);
if (!fp) continue;
if ((ic) && (_e_fm2_view_mode_get(sd) == E_FM2_VIEW_MODE_CUSTOM_ICONS))
@@ -6232,9 +6222,8 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
{
sd->max.w = 0;
sd->max.h = 0;
- for (l = sd->icons; l; l = l->next)
+ EINA_LIST_FOREACH(sd->icons, l, ic)
{
- ic = l->data;
if ((ic->x + ic->w) > sd->max.w) sd->max.w = ic->x + ic->w;
if ((ic->y + ic->h) > sd->max.h) sd->max.h = ic->y + ic->h;
}
@@ -6249,10 +6238,10 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
if (sd->drop_after == -1) /* put into subdir/file in icon */
{
/* move file into dir that this icon is for */
- for (ll = fsel, il = isel; ll && il; ll = ll->next, il = il->next)
+ for (ll = fsel, il = isel; ll && il; ll = eina_list_next(ll), il = eina_list_next(il))
{
- ic = il->data;
- fp = ll->data;
+ ic = eina_list_data_get(il);
+ fp = eina_list_data_get(ll);
if (!fp) continue;
args = _e_fm_string_append_quoted(args, &size, &length, fp);
@@ -6272,10 +6261,10 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
{
if (_e_fm2_view_mode_get(sd) == E_FM2_VIEW_MODE_LIST && sd->order_file) /* list */
{
- for (ll = fsel, il = isel; ll && il; ll = ll->next, il = il->next)
+ for (ll = fsel, il = isel; ll && il; ll = eina_list_next(ll), il = eina_list_next(il))
{
- ic = il->data;
- fp = ll->data;
+ ic = eina_list_data_get(il);
+ fp = eina_list_data_get(ll);
if (!fp) continue;
snprintf(buf, sizeof(buf), "%s/%s",
sd->realpath, ecore_file_file_get(fp));
@@ -6298,10 +6287,10 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
}
else
{
- for (ll = fsel, il = isel; ll && il; ll = ll->next, il = il->next)
+ for (ll = fsel, il = isel; ll && il; ll = eina_list_next(ll), il = eina_list_next(il))
{
- ic = il->data;
- fp = ll->data;
+ ic = eina_list_data_get(il);
+ fp = eina_list_data_get(ll);
if (!fp) continue;
args = _e_fm_string_append_quoted(args, &size, &length, fp);
@@ -6347,7 +6336,7 @@ _e_fm2_cb_dnd_drop(void *data, const char *type, void *event)
{
EINA_LIST_FREE(_e_fm2_list_remove, obj)
{
- _e_fm2_list = eina_list_remove(_e_fm2_list, _e_fm2_list_remove->data);
+ _e_fm2_list = eina_list_remove(_e_fm2_list, obj);
}
}
eina_list_free(fsel);
@@ -6407,9 +6396,9 @@ _e_fm2_mouse_1_handler(E_Fm2_Icon *ic, int up, void *evas_event)
ic2->last_selected = 0;
if (seen)
{
- for (; (l) && (l->data != ic); l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(l, l, ic2)
{
- ic2 = l->data;
+ if (ic == ic2) break;
if (!ic2->selected) sel_change = 1;
_e_fm2_icon_select(ic2);
ic2->last_selected = 0;
@@ -6417,9 +6406,9 @@ _e_fm2_mouse_1_handler(E_Fm2_Icon *ic, int up, void *evas_event)
}
else
{
- for (; (l) && (l->data != ic); l = l->next)
+ EINA_LIST_FOREACH(l, l, ic2)
{
- ic2 = l->data;
+ if (ic == ic2) break;
if (!ic2->selected) sel_change = 1;
_e_fm2_icon_select(ic2);
ic2->last_selected = 0;
@@ -9394,7 +9383,8 @@ _e_fm2_file_delete_yes_cb(void *data, E_Dialog *dialog)
if (e_filereg_file_protected(buf)) continue;
files = _e_fm_string_append_quoted(files, &size, &len, buf);
- if (l->next) files = _e_fm_string_append_char(files, &size, &len, ' ');
+ if (eina_list_next(l))
+ files = _e_fm_string_append_char(files, &size, &len, ' ');
}
eina_list_free(sel);
@@ -9545,7 +9535,7 @@ _e_fm2_live_process(Evas_Object *obj)
sd = evas_object_smart_data_get(obj);
if (!sd->live.actions) return;
- a = sd->live.actions->data;
+ a = eina_list_data_get(sd->live.actions);
sd->live.actions = eina_list_remove_list(sd->live.actions, sd->live.actions);
switch (a->type)
{
@@ -9816,7 +9806,7 @@ _e_fm2_volume_icon_update(E_Volume *v)
rp = e_fm2_real_path_get(o);
if (strcmp(rp, fav) && strcmp(rp, desk)) continue;
- ic = _e_fm2_icon_find(l->data, file);
+ ic = _e_fm2_icon_find(o, file);
if (ic)
_update_volume_icon(v, ic);
}
diff --git a/src/bin/e_fm_custom.c b/src/bin/e_fm_custom.c
index 508378e6b..783f788c1 100644
--- a/src/bin/e_fm_custom.c
+++ b/src/bin/e_fm_custom.c
@@ -199,6 +199,7 @@ e_fm2_custom_file_del(const char *path)
{
Eina_List *list, *l;
E_Fm2_Custom_File *cf2;
+ const void *key;
_e_fm2_custom_file_info_load();
if (!_e_fm2_custom_file) return;
@@ -207,12 +208,12 @@ e_fm2_custom_file_del(const char *path)
list = _e_fm2_custom_hash_key_base_list(_e_fm2_custom_hash, path);
if (list)
{
- for (l = list; l; l = l->next)
+ EINA_LIST_FOREACH(list, l, key)
{
- cf2 = eina_hash_find(_e_fm2_custom_hash, l->data);
+ cf2 = eina_hash_find(_e_fm2_custom_hash, key);
if (cf2)
{
- eina_hash_del(_e_fm2_custom_hash, l->data, cf2);
+ eina_hash_del(_e_fm2_custom_hash, key, cf2);
_e_fm2_custom_file_del(cf2);
}
}
@@ -226,6 +227,7 @@ e_fm2_custom_file_rename(const char *path, const char *new_path)
{
E_Fm2_Custom_File *cf, *cf2;
Eina_List *list, *l;
+ const void *key;
_e_fm2_custom_file_info_load();
if (!_e_fm2_custom_file) return;
@@ -242,16 +244,16 @@ e_fm2_custom_file_rename(const char *path, const char *new_path)
list = _e_fm2_custom_hash_key_base_list(_e_fm2_custom_hash, path);
if (list)
{
- for (l = list; l; l = l->next)
+ EINA_LIST_FOREACH(list, l, key)
{
- cf2 = eina_hash_find(_e_fm2_custom_hash, l->data);
+ cf2 = eina_hash_find(_e_fm2_custom_hash, key);
if (cf2)
{
char buf[PATH_MAX];
strcpy(buf, new_path);
- strcat(buf, (char *)l->data + strlen(path));
- eina_hash_del(_e_fm2_custom_hash, l->data, cf2);
+ strcat(buf, (char *)key + strlen(path));
+ eina_hash_del(_e_fm2_custom_hash, key, cf2);
cf = eina_hash_find(_e_fm2_custom_hash, buf);
if (cf)
_e_fm2_custom_file_del(cf);
diff --git a/src/bin/e_fm_hal.c b/src/bin/e_fm_hal.c
index 94f0db15a..12a47d171 100644
--- a/src/bin/e_fm_hal.c
+++ b/src/bin/e_fm_hal.c
@@ -84,14 +84,12 @@ EAPI E_Storage *
e_fm2_hal_storage_find(const char *udi)
{
Eina_List *l;
+ E_Storage *s;
if (!udi) return NULL;
-
- for (l = _e_stores; l; l = l->next)
+
+ EINA_LIST_FOREACH(_e_stores, l, s)
{
- E_Storage *s;
-
- s = l->data;
if (!strcmp(udi, s->udi)) return s;
}
return NULL;
@@ -369,14 +367,12 @@ EAPI E_Volume *
e_fm2_hal_volume_find(const char *udi)
{
Eina_List *l;
+ E_Volume *v;
if (!udi) return NULL;
- for (l = _e_vols; l; l = l->next)
+ EINA_LIST_FOREACH(_e_vols, l, v)
{
- E_Volume *v;
-
- v = l->data;
if (!strcmp(udi, v->udi)) return v;
}
return NULL;
@@ -413,6 +409,7 @@ EAPI void
e_fm2_hal_mount_add(E_Volume *v, const char *mountpoint)
{
Eina_List *l;
+ E_Fm2_Mount *m;
v->mounted = 1;
if (mountpoint && (*mountpoint != 0))
@@ -422,8 +419,8 @@ e_fm2_hal_mount_add(E_Volume *v, const char *mountpoint)
v->mount_point = strdup(mountpoint);
}
- for (l = v->mounts; l; l = l->next)
- _e_fm2_hal_mount_ok(l->data);
+ EINA_LIST_FOREACH(v->mounts, l, m)
+ _e_fm2_hal_mount_ok(m);
// printf("MOUNT %s %s\n", v->udi, v->mount_point);
}
@@ -464,16 +461,14 @@ EAPI E_Fm2_Mount *
e_fm2_hal_mount_find(const char *path)
{
Eina_List *l;
+ E_Volume *v;
- for (l = _e_vols; l; l = l->next)
+ EINA_LIST_FOREACH(_e_vols, l, v)
{
- E_Volume *v;
-
- v = l->data;
if (v->mounted
&& !strncmp(path, v->mount_point, strlen(v->mount_point))
&& v->mounts)
- return v->mounts->data;
+ return eina_list_data_get(v->mounts);
}
return NULL;
}
@@ -555,11 +550,12 @@ EAPI void
e_fm2_hal_unmount_fail(E_Volume *v)
{
Eina_List *l;
+ E_Fm2_Mount *m;
v->mounted = 1;
- for (l = v->mounts; l; l = l->next)
- _e_fm2_hal_unmount_fail(l->data);
+ EINA_LIST_FOREACH(v->mounts, l, m)
+ _e_fm2_hal_unmount_fail(m);
}
static void
@@ -616,10 +612,8 @@ e_fm2_hal_show_desktop_icons(void)
char buf2[PATH_MAX] = {0};
const char *id;
- for (l = _e_vols; l; l = eina_list_next(l))
+ EINA_LIST_FOREACH(_e_vols, l, v)
{
- v = eina_list_data_get(l);
-
if (!v) continue;
if (!v->storage) continue;
@@ -649,10 +643,8 @@ e_fm2_hal_hide_desktop_icons(void)
char buf[PATH_MAX] = {0};
const char *id;
- for (l = _e_vols; l; l = eina_list_next(l))
+ EINA_LIST_FOREACH(_e_vols, l, v)
{
- v = eina_list_data_get(l);
-
if (!v) continue;
if (!v->storage) continue;
diff --git a/src/bin/e_fm_main.c b/src/bin/e_fm_main.c
index 845d734fa..ff53664c1 100644
--- a/src/bin/e_fm_main.c
+++ b/src/bin/e_fm_main.c
@@ -633,12 +633,10 @@ E_Storage *
e_storage_find(const char *udi)
{
Eina_List *l;
+ E_Storage *s;
- for (l = _e_stores; l; l = l->next)
+ EINA_LIST_FOREACH(_e_stores, l, s)
{
- E_Storage *s;
-
- s = l->data;
if (!strcmp(udi, s->udi)) return s;
}
return NULL;
@@ -865,12 +863,10 @@ EAPI E_Volume *
e_volume_find(const char *udi)
{
Eina_List *l;
+ E_Volume *v;
- for (l = _e_vols; l; l = l->next)
+ EINA_LIST_FOREACH(_e_vols, l, v)
{
- E_Volume *v;
-
- v = l->data;
if (!strcmp(udi, v->udi)) return v;
}
return NULL;
@@ -1208,11 +1204,8 @@ _e_fm_monitor_start_try(E_Fm_Task *task)
Eina_List *l;
/* look for any previous dir entries monitoring this dir */
- for (l = _e_dirs; l; l = l->next)
+ EINA_LIST_FOREACH(_e_dirs, l, ed)
{
- E_Dir *ed;
-
- ed = l->data;
if ((ed->mon) && (!strcmp(ed->dir, task->src)))
{
/* found a previous dir - save it in ped */
@@ -1611,13 +1604,11 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
case E_FM_OP_MONITOR_SYNC: /* mon list sync */
{
Eina_List *l;
+ E_Dir *ed;
double stime;
- for (l = _e_dirs; l; l = l->next)
+ EINA_LIST_FOREACH(_e_dirs, l, ed)
{
- E_Dir *ed;
-
- ed = l->data;
if (ed->fq)
{
if (ed->sync == e->response)
@@ -1728,17 +1719,13 @@ static int _e_fm_slave_run(E_Fm_Op_Type type, const char *args, int id)
static E_Fm_Slave *_e_fm_slave_get(int id)
{
- Eina_List *l = _e_fm_slaves;
+ Eina_List *l;
E_Fm_Slave *slave;
- while (l)
+ EINA_LIST_FOREACH(_e_fm_slaves, l, slave)
{
- slave = eina_list_data_get(l);
-
if (slave->id == id)
return slave;
-
- l = eina_list_next(l);
}
return NULL;
@@ -1867,9 +1854,8 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
(event == ECORE_FILE_EVENT_CREATED_DIRECTORY))
{
rp = ecore_file_realpath(dir);
- for (l = _e_dirs; l; l = l->next)
+ EINA_LIST_FOREACH(_e_dirs, l, ed)
{
- ed = l->data;
drp = ecore_file_realpath(ed->dir);
if (drp)
{
@@ -1884,9 +1870,8 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
(event == ECORE_FILE_EVENT_DELETED_DIRECTORY))
{
rp = ecore_file_realpath(dir);
- for (l = _e_dirs; l; l = l->next)
+ EINA_LIST_FOREACH(_e_dirs, l, ed)
{
- ed = l->data;
drp = ecore_file_realpath(ed->dir);
if (drp)
{
@@ -1900,9 +1885,8 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
else if (event == ECORE_FILE_EVENT_MODIFIED)
{
rp = ecore_file_realpath(dir);
- for (l = _e_dirs; l; l = l->next)
+ EINA_LIST_FOREACH(_e_dirs, l, ed)
{
- ed = l->data;
drp = ecore_file_realpath(ed->dir);
if (drp)
{
@@ -1916,9 +1900,8 @@ _e_cb_file_monitor(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, c
else if (event == ECORE_FILE_EVENT_DELETED_SELF)
{
rp = ecore_file_realpath(path);
- for (l = _e_dirs; l; l = l->next)
+ EINA_LIST_FOREACH(_e_dirs, l, ed)
{
- ed = l->data;
drp = ecore_file_realpath(ed->dir);
if (drp)
{
@@ -1980,9 +1963,8 @@ _e_file_add_mod(E_Dir *ed, const char *path, E_Fm_Op_Type op, int listing)
int skip = 0;
t_now = ecore_time_get();
- for (l = ed->recent_mods; l; l = l->next)
+ EINA_LIST_FOREACH(ed->recent_mods, l, m)
{
- m = l->data;
if ((m->mod) && (!strcmp(m->path, path)))
{
if ((t_now - m->timestamp) < DEF_MOD_BACKOFF)
@@ -2113,22 +2095,14 @@ _e_cb_file_mon_list_idler(void *data)
/* FIXME: spool off files in idlers and handle sync req's */
while (ed->fq)
{
- file = ed->fq->data;
+ file = eina_list_data_get(ed->fq);
if (!((ed->dot_order) && (!strcmp(file, ".order"))))
{
if (!strcmp(ed->dir, "/"))
snprintf(buf, sizeof(buf), "/%s", file);
else
snprintf(buf, sizeof(buf), "%s/%s", ed->dir, file);
-/*
- if (//(!ed->fq->next) ||
- ((!strcmp(ed->fq->next->data, ".order"))
- //&& (!ed->fq->next->next)
- ))
- _e_file_add(ed, buf, 1);
- else
- */
- _e_file_add(ed, buf, 1);
+ _e_file_add(ed, buf, 1);
}
free(file);
ed->fq = eina_list_remove_list(ed->fq, ed->fq);
diff --git a/src/bin/e_fm_mime.c b/src/bin/e_fm_mime.c
index 35a4c1e03..b8cfba615 100644
--- a/src/bin/e_fm_mime.c
+++ b/src/bin/e_fm_mime.c
@@ -53,9 +53,8 @@ e_fm_mime_icon_get(const char *mime)
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)
+ EINA_LIST_FOREACH(e_config->mime_icons, l, mi)
{
- mi = l->data;
if (e_util_glob_match(mi->mime, mime))
{
ecore_strlcpy(buf, mi->icon, sizeof(buf));
@@ -135,11 +134,7 @@ e_fm_mime_icon_cache_flush(void)
Eina_List *freelist = NULL;
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);
- }
+ E_FREE_LIST(freelist, eina_stringshare_del);
eina_hash_free(icon_map);
icon_map = NULL;
}
@@ -337,17 +332,15 @@ e_fm2_mime_handler_mime_handlers_call_all(Evas_Object *obj, const char *path, co
{
Eina_List *handlers = NULL;
Eina_List *l = NULL;
+ E_Fm2_Mime_Handler *handler = NULL;
if ((!obj) || (!path) || (!mime)) return;
handlers = e_fm2_mime_handler_mime_handlers_get(mime);
if (!handlers) return;
- for (l = handlers; l; l = l->next)
+ EINA_LIST_FOREACH(handlers, l, handler)
{
- E_Fm2_Mime_Handler *handler = NULL;
-
- handler = l->data;
if (!handler) continue;
e_fm2_mime_handler_call(handler, obj, path);
@@ -360,17 +353,15 @@ e_fm2_mime_handler_glob_handlers_call_all(Evas_Object *obj, const char *path, co
{
Eina_List *handlers = NULL;
Eina_List *l = NULL;
+ E_Fm2_Mime_Handler *handler = NULL;
if ((!obj) || (!path) || (!glob)) return;
handlers = e_fm2_mime_handler_glob_handlers_get(glob);
if (!handlers) return;
- for (l = handlers; l; l = l->next)
+ EINA_LIST_FOREACH(handlers, l, handler)
{
- E_Fm2_Mime_Handler *handler = NULL;
-
- handler = l->data;
if (!handler) continue;
e_fm2_mime_handler_call(handler, obj, path);
@@ -395,15 +386,16 @@ _e_fm2_mime_handler_glob_match_foreach(const Eina_Hash *hash __UNUSED__, const v
E_Fm2_Mime_Handler_Tuple *tuple;
Eina_List *handlers = NULL;
Eina_List *l = NULL;
+ void *handler = NULL;
tuple = fdata;
if (e_util_glob_match(tuple->str, key))
{
handlers = data;
- for (l = handlers; l; l = l->next)
+ EINA_LIST_FOREACH(handlers, l, handler)
{
- if (l->data)
- tuple->list = eina_list_append(tuple->list, l->data);
+ if (handler)
+ tuple->list = eina_list_append(tuple->list, handler);
}
}
diff --git a/src/bin/e_fm_op.c b/src/bin/e_fm_op.c
index 1f3ddbe8c..1a63cff0e 100644
--- a/src/bin/e_fm_op.c
+++ b/src/bin/e_fm_op.c
@@ -1416,7 +1416,7 @@ _e_fm_op_scan_atom(E_Fm_Op_Task * task)
_e_fm_op_work_queue = eina_list_append_relative_list(_e_fm_op_work_queue, rtask, _e_fm_op_separator);
- ctask->link = _e_fm_op_separator->next;
+ ctask->link = eina_list_next(_e_fm_op_separator);
}
else if (task->type == E_FM_OP_SYMLINK)
{
diff --git a/src/bin/e_fm_prop.c b/src/bin/e_fm_prop.c
index a24bb0427..156e46325 100644
--- a/src/bin/e_fm_prop.c
+++ b/src/bin/e_fm_prop.c
@@ -226,9 +226,8 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
if (!cfdata->picon_mime) /* remove previous custom icon info */
e_fm2_custom_file_del(buf);
- for (l = e_config->mime_icons; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->mime_icons, l, mi)
{
- mi = l->data;
if (!mi) continue;
if (strcmp(mi->mime, cfdata->mime)) continue;
if (mi->icon)
diff --git a/src/bin/e_fm_shared.h b/src/bin/e_fm_shared.h
index 66bdeef54..3324af384 100644
--- a/src/bin/e_fm_shared.h
+++ b/src/bin/e_fm_shared.h
@@ -101,13 +101,10 @@ _e_volume_free(E_Volume *v)
static void
_e_storage_free(E_Storage *s)
{
- while (s->volumes)
+ E_Volume *v;
+ EINA_LIST_FREE(s->volumes, v)
{
- E_Volume *v;
-
- v = s->volumes->data;
_e_volume_free(v);
- s->volumes = eina_list_remove_list(s->volumes, s->volumes);
}
if (s->udi) free(s->udi);
if (s->bus) free(s->bus);
diff --git a/src/bin/e_font.c b/src/bin/e_font.c
index 68cc996dd..ef8e10760 100644
--- a/src/bin/e_font.c
+++ b/src/bin/e_font.c
@@ -29,6 +29,8 @@ e_font_apply(void)
{
char buf[1024];
Eina_List *l;
+ E_Border *bd;
+ E_Font_Default *efd;
E_Font_Fallback *eff;
int blen, len;
@@ -46,9 +48,8 @@ e_font_apply(void)
strcpy(buf, eff->name);
blen -= len;
}
- for (l = eina_list_next(l); l; l = l->next)
+ EINA_LIST_FOREACH(eina_list_next(l), l, eff)
{
- eff = eina_list_data_get(l);
len = 1;
if (len < blen)
{
@@ -68,20 +69,14 @@ e_font_apply(void)
edje_fontset_append_set(NULL);
/* setup edje text classes */
- for (l = e_config->font_defaults; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->font_defaults, l, efd)
{
- E_Font_Default *efd;
-
- efd = eina_list_data_get(l);
edje_text_class_set(efd->text_class, efd->font, efd->size);
}
/* Update borders */
- for (l = e_border_client_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
- E_Border *bd;
-
- bd = l->data;
e_border_frame_recalc(bd);
}
}
@@ -92,6 +87,7 @@ e_font_available_list(void)
Eina_List *evas_fonts;
Eina_List *e_fonts;
Eina_List *l;
+ const char *evas_font;
E_Manager *man;
E_Container *con;
@@ -104,16 +100,14 @@ e_font_available_list(void)
evas_fonts = evas_font_available_list(con->bg_evas);
e_fonts = NULL;
- for (l = evas_fonts; l; l = l->next)
+ EINA_LIST_FOREACH(evas_fonts, l, evas_font)
{
E_Font_Available *efa;
- const char *evas_font;
efa = E_NEW(E_Font_Available, 1);
- evas_font = l->data;
efa->name = eina_stringshare_add(evas_font);
e_fonts = eina_list_append(e_fonts, efa);
- }
+ }
evas_font_available_list_free(con->bg_evas, evas_fonts);
@@ -125,10 +119,8 @@ e_font_available_list_free(Eina_List *available)
{
E_Font_Available *efa;
- while (available)
+ EINA_LIST_FREE(available, efa)
{
- efa = available->data;
- available = eina_list_remove_list(available, available);
if (efa->name) eina_stringshare_del(efa->name);
E_FREE(efa);
}
@@ -137,14 +129,11 @@ e_font_available_list_free(Eina_List *available)
EAPI void
e_font_properties_free(E_Font_Properties *efp)
{
- while (efp->styles)
- {
- const char *str;
+ const char *str;
- str = efp->styles->data;
+ EINA_LIST_FREE(efp->styles, str)
+ {
if (str) eina_stringshare_del(str);
- efp->styles = eina_list_remove_list(efp->styles, efp->styles);
-
}
if (efp->name) eina_stringshare_del(efp->name);
free(efp);
@@ -261,6 +250,7 @@ e_font_available_list_parse(Eina_List *list)
{
Eina_Hash *font_hash;
Eina_List *next;
+ void *key;
font_hash = NULL;
@@ -280,8 +270,8 @@ e_font_available_list_parse(Eina_List *list)
font_hash = _e_font_available_hash_add(font_hash, "Monospace:style=Oblique");
font_hash = _e_font_available_hash_add(font_hash, "Monospace:style=Bold Oblique");
- for (next = list; next; next = next->next)
- font_hash = _e_font_available_hash_add(font_hash, next->data);
+ EINA_LIST_FOREACH(list, next, key)
+ font_hash = _e_font_available_hash_add(font_hash, key);
return font_hash;
}
@@ -303,11 +293,8 @@ e_font_fallback_clear(void)
{
E_Font_Fallback *eff;
- while (e_config->font_fallbacks)
+ EINA_LIST_FREE(e_config->font_fallbacks, eff)
{
- eff = e_config->font_fallbacks->data;
- e_config->font_fallbacks =
- eina_list_remove_list(e_config->font_fallbacks, e_config->font_fallbacks);
if (eff->name) eina_stringshare_del(eff->name);
E_FREE(eff);
}
@@ -341,12 +328,10 @@ EAPI void
e_font_fallback_remove(const char *font)
{
Eina_List *next;
+ E_Font_Fallback *eff;
- for (next = e_config->font_fallbacks; next; next = next->next)
+ EINA_LIST_FOREACH(e_config->font_fallbacks, next, eff)
{
- E_Font_Fallback *eff;
-
- eff = eina_list_data_get(next);
if (!strcmp(eff->name, font))
{
e_config->font_fallbacks =
@@ -371,9 +356,8 @@ e_font_default_set(const char *text_class, const char *font, Evas_Font_Size size
Eina_List *next;
/* search for the text class */
- for (next = e_config->font_defaults; next; next = next->next)
+ EINA_LIST_FOREACH(e_config->font_defaults, next, efd)
{
- efd = eina_list_data_get(next);
if (!strcmp(efd->text_class, text_class))
{
if (efd->font) eina_stringshare_del(efd->font);
@@ -407,9 +391,8 @@ e_font_default_get(const char *text_class)
Eina_List *next;
/* search for the text class */
- for (next = e_config->font_defaults; next; next = next->next)
+ EINA_LIST_FOREACH(e_config->font_defaults, next, efd)
{
- efd = eina_list_data_get(next);
if (!strcmp(efd->text_class, text_class))
{
/* move to the front of the list */
@@ -432,9 +415,8 @@ e_font_default_remove(const char *text_class)
Eina_List *next;
/* search for the text class */
- for (next = e_config->font_defaults; next; next = next->next)
+ EINA_LIST_FOREACH(e_config->font_defaults, next, efd)
{
- efd = eina_list_data_get(next);
if (!strcmp(efd->text_class, text_class))
{
e_config->font_defaults =
@@ -482,10 +464,8 @@ e_font_default_string_get(const char *text_class, Evas_Font_Size *size_ret)
blen -= len;
}
- next = e_config->font_fallbacks;
- while (next)
+ EINA_LIST_FOREACH(e_config->font_fallbacks, next, eff)
{
- eff = eina_list_data_get(next);
len = 1;
if (len < blen)
{
@@ -498,7 +478,6 @@ e_font_default_string_get(const char *text_class, Evas_Font_Size *size_ret)
strcat(_fn_buf, eff->name);
blen -= len;
}
- next = eina_list_next(next);
}
if (size_ret) *size_ret = efd->size;
diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c
index 6b0e20936..d9e157bd8 100644
--- a/src/bin/e_gadcon.c
+++ b/src/bin/e_gadcon.c
@@ -234,20 +234,16 @@ e_gadcon_provider_unregister(const E_Gadcon_Client_Class *cc)
_e_gadcon_provider_populate_unrequest(cc);
- for (l = gadcons; l; l = l->next)
+ EINA_LIST_FOREACH(gadcons, l, gc)
{
- gc = l->data;
- for (ll = gc->clients; ll; ll = ll->next)
+ EINA_LIST_FOREACH(gc->clients, ll, gcc)
{
- gcc = ll->data;
if (gcc->client_class == cc)
dlist = eina_list_append(dlist, gcc);
}
}
- while (dlist)
+ EINA_LIST_FREE(dlist, gcc)
{
- gcc = dlist->data;
- dlist = eina_list_remove_list(dlist, dlist);
e_object_del(E_OBJECT(gcc));
}
eina_hash_del(providers, cc->name, cc);
@@ -278,6 +274,7 @@ EAPI E_Gadcon *
e_gadcon_swallowed_new(const char *name, int id, Evas_Object *obj, char *swallow_name)
{
E_Gadcon *gc;
+ E_Config_Gadcon *cf_gc;
Eina_List *l;
Evas_Coord x, y, w, h;
const char *drop_types[] = { "enlightenment/gadcon_client" };
@@ -314,11 +311,8 @@ e_gadcon_swallowed_new(const char *name, int id, Evas_Object *obj, char *swallow
gc->o_container);
gadcons = eina_list_append(gadcons, gc);
- for (l = e_config->gadcons; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->gadcons, l, cf_gc)
{
- E_Config_Gadcon *cf_gc;
-
- cf_gc = l->data;
if ((!strcmp(cf_gc->name, gc->name)) && (cf_gc->id == gc->id))
{
gc->cf = cf_gc;
@@ -397,16 +391,15 @@ EAPI void
e_gadcon_populate(E_Gadcon *gc)
{
Eina_List *l;
+ E_Config_Gadcon_Client *cf_gcc;
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
e_gadcon_layout_freeze(gc->o_container);
- for (l = gc->cf->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->cf->clients, l, cf_gcc)
{
- E_Config_Gadcon_Client *cf_gcc;
E_Gadcon_Client_Class *cc;
- cf_gcc = l->data;
if (!cf_gcc->name) continue;
cc = eina_hash_find(providers, cf_gcc->name);
if (cc)
@@ -465,16 +458,14 @@ e_gadcon_unpopulate(E_Gadcon *gc)
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
- while (gc->clients)
+ EINA_LIST_FREE(gc->clients, gcc)
{
- gcc = gc->clients->data;
if (gcc->menu)
{
e_menu_post_deactivate_callback_set(gcc->menu, NULL, NULL);
e_object_del(E_OBJECT(gcc->menu));
gcc->menu = NULL;
}
- gc->clients = eina_list_remove_list(gc->clients, gc->clients);
e_object_del(E_OBJECT(gcc));
}
}
@@ -483,15 +474,13 @@ EAPI void
e_gadcon_populate_class(E_Gadcon *gc, const E_Gadcon_Client_Class *cc)
{
Eina_List *l;
+ E_Config_Gadcon_Client *cf_gcc;
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
e_gadcon_layout_freeze(gc->o_container);
- for (l = gc->cf->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->cf->clients, l, cf_gcc)
{
- E_Config_Gadcon_Client *cf_gcc;
-
- cf_gcc = l->data;
if ((cf_gcc->name) && (cc->name) &&
(!strcmp(cf_gcc->name, cc->name)) &&
(cf_gcc->id) && (cf_gcc->style))
@@ -537,6 +526,7 @@ EAPI void
e_gadcon_orient(E_Gadcon *gc, E_Gadcon_Orient orient)
{
Eina_List *l;
+ E_Gadcon_Client *gcc;
int horiz = 0;
E_OBJECT_CHECK(gc);
@@ -569,11 +559,8 @@ e_gadcon_orient(E_Gadcon *gc, E_Gadcon_Orient orient)
break;
}
e_gadcon_layout_orientation_set(gc->o_container, horiz);
- for (l = gc->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->clients, l, gcc)
{
- E_Gadcon_Client *gcc;
-
- gcc = l->data;
e_box_orientation_set(gcc->o_box, horiz);
if (gcc->client_class->func.orient)
gcc->client_class->func.orient(gcc, gc->orient);
@@ -585,17 +572,15 @@ EAPI void
e_gadcon_edit_begin(E_Gadcon *gc)
{
Eina_List *l;
+ E_Gadcon_Client *gcc;
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
e_gadcon_layout_freeze(gc->o_container);
e_gadcon_locked_set(gc, 1);
gc->editing = 1;
- for (l = gc->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->clients, l, gcc)
{
- E_Gadcon_Client *gcc;
-
- gcc = l->data;
e_gadcon_client_edit_begin(gcc);
}
e_gadcon_layout_thaw(gc->o_container);
@@ -605,16 +590,14 @@ EAPI void
e_gadcon_edit_end(E_Gadcon *gc)
{
Eina_List *l;
+ E_Gadcon_Client *gcc;
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
e_gadcon_layout_freeze(gc->o_container);
gc->editing = 0;
- for (l = gc->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->clients, l, gcc)
{
- E_Gadcon_Client *gcc;
-
- gcc = l->data;
e_gadcon_client_edit_end(gcc);
}
e_gadcon_layout_thaw(gc->o_container);
@@ -625,12 +608,10 @@ EAPI void
e_gadcon_all_edit_begin(void)
{
Eina_List *l;
+ E_Gadcon *gc;
- for (l = gadcons; l; l = l->next)
+ EINA_LIST_FOREACH(gadcons, l, gc)
{
- E_Gadcon *gc;
-
- gc = l->data;
e_gadcon_edit_begin(gc);
}
}
@@ -639,12 +620,10 @@ EAPI void
e_gadcon_all_edit_end(void)
{
Eina_List *l;
+ E_Gadcon *gc;
- for (l = gadcons; l; l = l->next)
+ EINA_LIST_FOREACH(gadcons, l, gc)
{
- E_Gadcon *gc;
-
- gc = l->data;
e_gadcon_edit_end(gc);
}
}
@@ -1012,6 +991,7 @@ EAPI void
e_gadcon_client_edit_end(E_Gadcon_Client *gcc)
{
Eina_List *l = NULL;
+ E_Gadcon_Client *client = NULL;
E_OBJECT_CHECK(gcc);
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
@@ -1041,11 +1021,9 @@ e_gadcon_client_edit_end(E_Gadcon_Client *gcc)
if (gcc->o_control) evas_object_del(gcc->o_control);
gcc->o_control = NULL;
- for (l = gcc->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gcc->gadcon->clients, l, client)
{
- E_Gadcon_Client *client = NULL;
-
- if (!(client = l->data)) continue;
+ if (!client) continue;
if (client->o_control) return;
}
gcc->gadcon->editing = 0;
@@ -1682,6 +1660,7 @@ static void
_e_gadcon_client_inject(E_Gadcon *gc, E_Gadcon_Client *gcc, int x, int y)
{
Eina_List *l;
+ E_Gadcon_Client *gcc2;
Evas_Coord cx, cy, cw, ch;
int seq = 1;
@@ -1700,11 +1679,8 @@ _e_gadcon_client_inject(E_Gadcon *gc, E_Gadcon_Client *gcc, int x, int y)
/* If x, y is not inside any gadcon client, seq will be 0 and it's position
* will later be used for placement. */
gcc->state_info.seq = 0;
- for (l = gc->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->clients, l, gcc2)
{
- E_Gadcon_Client *gcc2;
-
- gcc2 = l->data;
if (gcc == gcc2) continue;
if (gcc2->hidden) continue;
if (gcc2->o_frame)
@@ -2701,6 +2677,7 @@ e_gadcon_layout_min_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
E_Smart_Data *sd;
/*
Eina_List *l;
+ Evas_Object *obj;
Evas_Coord tw = 0, th = 0;
*/
if (!obj) return;
@@ -2710,12 +2687,10 @@ e_gadcon_layout_min_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
if (h) *h = sd->minh;
/*
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Gadcon_Layout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_gadcon_layout_data");
if (sd->horizontal)
{
@@ -2747,12 +2722,11 @@ e_gadcon_layout_asked_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
else
th = sd->req;
/*
- for (l = sd->items; l; l = l->next)
+ Evas_Object *obj;
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Gadcon_Layout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_gadcon_layout_data");
if (sd->horizontal)
{
@@ -2866,6 +2840,7 @@ e_gadcon_layout_pack_options_set(Evas_Object *obj, E_Gadcon_Client *gcc)
{
int ok, seq;
Eina_List *l;
+ Evas_Object *item;
E_Gadcon_Layout_Item *bi, *bi2;
if (!obj) return;
@@ -2880,9 +2855,9 @@ e_gadcon_layout_pack_options_set(Evas_Object *obj, E_Gadcon_Client *gcc)
if (!gcc->state_info.seq) ok = 1;
seq = 1;
- for (l = bi->sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(bi->sd->items, l, item)
{
- bi2 = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi2 = evas_object_data_get(item, "e_gadcon_layout_data");
if (bi == bi2) continue;
if (bi->gcc->state_info.seq == bi2->gcc->state_info.seq)
ok = 1;
@@ -3010,6 +2985,7 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
{
Evas_Coord xx, yy;
Eina_List *l;
+ Evas_Object *obj;
int min, mino, cur;
Eina_List *list = NULL;
E_Gadcon_Layout_Item *bi;
@@ -3078,9 +3054,8 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
_e_gadcon_layout_smart_gadcons_position(sd, &list);
- for (l = list; l; l = l->next)
+ EINA_LIST_FOREACH(list, l, lc)
{
- lc = l->data;
LC_FREE(lc);
}
list = eina_list_free(list);
@@ -3089,9 +3064,10 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
sd->items = eina_list_sort(sd->items, eina_list_count(sd->items),
_e_gadcon_layout_smart_sort_by_position_cb);
- for (l = sd->items, i = 1; l; l = l->next, i++)
+ i = 1;
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(obj, "e_gadcon_layout_data");
if (bi->gcc->gadcon->editing) bi->gcc->state_info.seq = i;
if (set_prev_pos)
@@ -3127,14 +3103,13 @@ _e_gadcon_layout_smart_reconfigure(E_Smart_Data *sd)
((!sd->horizontal) && (bi->y != bi->ask.pos)))
bi->gcc->state_info.flags &= ~E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE;
}
+ i++;
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Gadcon_Layout_Item *bi;
- Evas_Object *obj;
- obj = l->data;
bi = evas_object_data_get(obj, "e_gadcon_layout_data");
if (!bi) continue;
if (sd->horizontal)
@@ -3245,7 +3220,7 @@ _e_gadcon_layout_smart_del(Evas_Object *obj)
{
Evas_Object *child;
- child = sd->items->data;
+ child = eina_list_data_get(sd->items);
e_gadcon_layout_unpack(child);
}
evas_object_del(sd->clip);
@@ -3263,16 +3238,17 @@ _e_gadcon_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
if ((x == sd->x) && (y == sd->y)) return;
{
Eina_List *l;
+ Evas_Object *item;
Evas_Coord dx, dy;
dx = x - sd->x;
dy = y - sd->y;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
Evas_Coord ox, oy;
- evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
- evas_object_move(l->data, ox + dx, oy + dy);
+ evas_object_geometry_get(item, &ox, &oy, NULL, NULL);
+ evas_object_move(item, ox + dx, oy + dy);
}
}
sd->x = x;
@@ -3358,10 +3334,11 @@ _e_gadcon_layout_smart_min_cur_size_calc(E_Smart_Data *sd, int *min, int *mino,
{
E_Gadcon_Layout_Item *bi;
Eina_List *l;
+ Evas_Object *item;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
bi->ask.size2 = bi->ask.size;
if ((bi->aspect.w > 0) && (bi->aspect.h > 0))
@@ -3531,6 +3508,7 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
E_Gadcon_Layout_Item *bi2 = NULL;
E_Gadcon_Layout_Item *bi = NULL;
Eina_List *l, *l2;
+ Evas_Object *item, *item2;
int need, limit, reduce_total, reduce;
int max_size, c;
@@ -3565,13 +3543,15 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
sd->items = eina_list_sort(sd->items, eina_list_count(sd->items),
_e_gadcon_layout_smart_width_smart_sort_reverse_cb);
- __adjust_size_again:
- for (l = sd->items, c = 0; l; l = l->next)
+ __adjust_size_again:
+ c = 0;
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- if (l->next)
- {
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
- bi2 = evas_object_data_get(l->next->data, "e_gadcon_layout_data");
+ if (eina_list_next(l))
+ {
+ item2 = eina_list_data_get(eina_list_next(l));
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
+ bi2 = evas_object_data_get(item2, "e_gadcon_layout_data");
if (bi->ask.size2 > bi2->ask.size2)
{
@@ -3591,10 +3571,10 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
reduce_total = reduce * c;
if (reduce_total <= need)
- {
- for (l2 = l; l2; l2 = l2->prev)
+ {
+ EINA_LIST_REVERSE_FOREACH(l, l2, item)
{
- bi2 = evas_object_data_get(l2->data, "e_gadcon_layout_data");
+ bi2 = evas_object_data_get(item, "e_gadcon_layout_data");
bi2->ask.size2 -= reduce;
}
need -= reduce * c;
@@ -3616,11 +3596,13 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
break;
}
c2 = c;
- for (l2 = sd->items; l2 && c2 && need; l2 = l2->next, c2--)
+ EINA_LIST_REVERSE_FOREACH(sd->items, l2, item)
{
- bi2 = evas_object_data_get(l2->data, "e_gadcon_layout_data");
+ if(!c2 || !need) break;
+ bi2 = evas_object_data_get(item, "e_gadcon_layout_data");
bi2->ask.size2 -= reduce_by;
need -= reduce_by;
+ c2--;
}
}
}
@@ -3640,11 +3622,13 @@ _e_gadcon_layout_smart_gadcons_width_adjust(E_Smart_Data *sd, int min, int cur)
break;
}
c2 = c;
- for (l2 = sd->items; l2 && c2 && need; l2 = l2->next, c2--)
- {
- bi2 = evas_object_data_get(l2->data, "e_gadcon_layout_data");
+ EINA_LIST_FOREACH(sd->items, l2, item)
+ {
+ if(!c2 || !need) break;
+ bi2 = evas_object_data_get(item, "e_gadcon_layout_data");
bi2->ask.size2 -= reduce_by;
- need -= reduce_by;
+ need -= reduce_by;
+ c2--;
}
}
}
@@ -3703,9 +3687,8 @@ _e_gadcon_layout_smart_sync_clients(E_Gadcon *gc)
E_Gadcon_Client *gcc;
Eina_List *l;
- for (l = gc->clients; l; l = l->next)
+ EINA_LIST_FOREACH(gc->clients, l, gcc)
{
- gcc = l->data;
_e_gadcon_client_save(gcc);
}
}
@@ -3736,15 +3719,16 @@ static void
_e_gadcon_layout_smart_gadcon_position_shrinked_mode(E_Smart_Data *sd)
{
Eina_List *l;
+ Evas_Object *item;
E_Gadcon_Layout_Item *bi, *bi2;
void *tp;
int pos = 0;
sd->items = eina_list_sort(sd->items, eina_list_count(sd->items),
_e_gadcon_layout_smart_sort_by_sequence_number_cb);
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
if (bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_POS_INC)
{
if (bi->gcc->state_info.resist <= E_LAYOUT_ITEM_DRAG_RESIST_LEVEL)
@@ -3755,10 +3739,10 @@ _e_gadcon_layout_smart_gadcon_position_shrinked_mode(E_Smart_Data *sd)
else
{
bi->gcc->state_info.resist = 0;
- if (l->next)
+ if (eina_list_next(l))
{
- tp = l->next->data;
- l->next->data = l->data;
+ tp = eina_list_data_get(eina_list_next(l));
+ l->next->data = eina_list_data_get(l);
l->data = tp;
bi2 = evas_object_data_get(tp, "e_gadcon_layout_data");
@@ -3782,13 +3766,13 @@ _e_gadcon_layout_smart_gadcon_position_shrinked_mode(E_Smart_Data *sd)
else
{
bi->gcc->state_info.resist = 0;
- if (l->prev)
+ if (eina_list_prev(l))
{
E_Gadcon_Layout_Item *bi2;
void *tp;
- tp = l->prev->data;
- l->prev->data = l->data;
+ tp = eina_list_data_get(eina_list_prev(l));
+ l->prev->data = eina_list_data_get(l);
l->data = tp;
bi2 = evas_object_data_get(tp, "e_gadcon_layout_data");
bi->gcc->config.pos = bi->ask.pos = bi2->ask.pos;
@@ -3824,9 +3808,9 @@ _e_gadcon_layout_smart_gadcon_position_shrinked_mode(E_Smart_Data *sd)
}
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
if (sd->horizontal)
{
bi->x = pos;
@@ -3850,10 +3834,11 @@ _e_gadcon_layout_smart_gadcons_asked_position_set(E_Smart_Data *sd)
{
E_Gadcon_Layout_Item *bi;
Eina_List *l;
+ Evas_Object *item;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
if (!bi) continue;
if (sd->horizontal)
@@ -3869,9 +3854,9 @@ _e_gadcon_layout_smart_gadcons_asked_position_set(E_Smart_Data *sd)
}
#if 0
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
if (!bi) continue;
if (sd->horizontal)
{
@@ -3967,12 +3952,13 @@ static Eina_List *
_e_gadcon_layout_smart_gadcons_wrap(E_Smart_Data *sd)
{
Eina_List *l, *list = NULL;
+ Evas_Object *item;
E_Layout_Item_Container *lc;
E_Gadcon_Layout_Item *bi;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- bi = evas_object_data_get(l->data, "e_gadcon_layout_data");
+ bi = evas_object_data_get(item, "e_gadcon_layout_data");
lc = E_NEW(E_Layout_Item_Container, 1);
lc->state_info.min_seq = lc->state_info.max_seq = bi->gcc->state_info.seq;
lc->sd = sd;
@@ -4011,10 +3997,8 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if ((!list) || (!*list)) return;
- for (l = *list; l; l = l->next)
+ EINA_LIST_FOREACH(*list, l, lc_moving)
{
- lc_moving = l->data;
-
if ((lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_POS_INC) ||
(lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_POS_DEC) ||
(lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_SIZE_MIN_END_INC) ||
@@ -4030,10 +4014,10 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
lc_back->state_info.min_seq = lc_moving->state_info.min_seq;
lc_back->state_info.max_seq = lc_moving->state_info.max_seq;
lc_back->sd = lc_moving->sd;
- for (l2 = lc_moving->items; l2; l2 = l2->next)
- lc_back->items = eina_list_append(lc_back->items, l2->data);
+ EINA_LIST_FOREACH(lc_moving->items, l2, lc)
+ lc_back->items = eina_list_append(lc_back->items, lc);
lc_back->state = lc_moving->state;
- bi_moving = lc_back->items->data;
+ bi_moving = eina_list_data_get(lc_back->items);
break;
}
lc_moving = NULL;
@@ -4049,16 +4033,17 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if (lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_POS_DEC)
{
_e_gadcon_layout_smart_restore_gadcons_position_before_move(sd, &lc_moving, lc_back, list);
- for (l = *list; (l) && (l->data != lc_moving); l = l->next);
+ EINA_LIST_FOREACH(*list, l, lc)
+ if (lc == lc_moving) break;
ok = 0;
- if ((l) && (l->prev))
+ if ((l) && eina_list_prev(l))
{
- lc = l->prev->data;
+ lc = eina_list_data_get(eina_list_prev(l));
if (lc_moving->pos < (lc->pos + lc->size))
{
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
if (bi->gcc->state_info.resist <= E_LAYOUT_ITEM_DRAG_RESIST_LEVEL)
{
if (lc_moving->prev_pos == (lc->pos + lc->size))
@@ -4082,7 +4067,7 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
ok = 1;
l->data = lc3;
- *list = eina_list_remove_list(*list, l->prev);
+ *list = eina_list_remove_list(*list, eina_list_prev(l));
LC_FREE(lc_moving);
LC_FREE(lc);
lc_moving = lc3;
@@ -4094,22 +4079,22 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
{
int pos, prev_pos, stop;
- for (l = *list; (l) && (l->data != lc_moving); l = l->next);
+ EINA_LIST_FOREACH(*list, l, lc)
+ if (lc == lc_moving) break;
+
pos = lc_moving->pos + lc_moving->size;
prev_pos = lc_moving_prev_pos;
- if ((l) && (l->next))
+ if ((l) && (eina_list_next(l)))
{
stop = 0;
- for (l2 = l->next; l2 && !stop; l2 = l2->next)
+ EINA_LIST_FOREACH(eina_list_next(l), l2, lc)
{
- lc = l2->data;
-
+ if (stop) break;
if (lc->pos != prev_pos) break;
prev_pos = lc->pos + lc->size;
- for (l3 = lc->items; l3; l3 = l3->next)
+ EINA_LIST_FOREACH(lc->items, l3, bi)
{
- bi = l3->data;
if (bi->ask.pos <= pos)
{
if (sd->horizontal)
@@ -4151,16 +4136,17 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
else if (lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_POS_INC)
{
_e_gadcon_layout_smart_restore_gadcons_position_before_move(sd, &lc_moving, lc_back, list);
- for (l = *list; (l) && (l->data != lc_moving); l = l->next);
+ EINA_LIST_FOREACH(*list, l, lc)
+ if (lc == lc_moving) break;
ok = 0;
- if ((l) && (l->next))
+ if ((l) && eina_list_next(l))
{
- lc = l->next->data;
+ lc = eina_list_data_get(eina_list_next(l));
if ((lc_moving->pos + lc_moving->size) > lc->pos)
{
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
if (bi->gcc->state_info.resist <= E_LAYOUT_ITEM_DRAG_RESIST_LEVEL)
{
if ((lc_moving->prev_pos + lc_moving->size) == lc->pos)
@@ -4184,7 +4170,7 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
ok = 1;
l->data = lc3;
- *list = eina_list_remove_list(*list, l->next);
+ *list = eina_list_remove_list(*list, eina_list_next(l));
LC_FREE(lc_moving);
LC_FREE(lc);
lc_moving = lc3;
@@ -4196,25 +4182,24 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if (!ok)
{
int pos, prev_pos, stop;
-
- for (l = *list; (l) && (l->data != lc_moving); l = l->next);
+
+ EINA_LIST_FOREACH(*list, l, lc)
+ if (lc == lc_moving) break;
pos = lc_moving->pos;
prev_pos = lc_moving_prev_pos;
- if ((l) && (l->prev))
+ if ((l) && eina_list_prev(l))
{
stop = 0;
- for (l2 = l->prev; l2 && !stop; l2 = l2->prev)
+ EINA_LIST_REVERSE_FOREACH(eina_list_prev(l), l2, lc)
{
- lc = l2->data;
+ if (stop) break;
if ((lc->pos + lc->size) == prev_pos) break;
prev_pos = lc->pos;
- for (l3 = eina_list_last(lc->items); l3; l3 = l3->prev)
+ EINA_LIST_REVERSE_FOREACH(eina_list_last(lc->items), l3, bi)
{
- bi = l3->data;
-
if (((sd->horizontal) && ((bi->ask.pos + bi->w) >= pos)) ||
((!sd->horizontal) && ((bi->ask.pos + bi->h) >= pos)))
{
@@ -4257,17 +4242,17 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
else if (lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_SIZE_MIN_END_DEC)
{
_e_gadcon_layout_smart_restore_gadcons_position_before_move(sd, &lc_moving, lc_back, list);
- for (l = *list; (l) && (l->data != lc_moving); l = l->next);
+ EINA_LIST_FOREACH(*list, l, lc)
+ if (lc == lc_moving) break;
- if ((l) && (l->prev))
+ if ((l) && eina_list_prev(l))
{
int new_pos = 0;
ok = 0;
new_pos = lc_moving->pos;
- for (l2 = l->prev; l2; l2 = l2->prev)
+ EINA_LIST_REVERSE_FOREACH(eina_list_prev(l), l2, lc)
{
- lc = l2->data;
if (new_pos >= (lc->pos + lc->size)) break;
ok = 1;
@@ -4279,7 +4264,7 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
lc_moving->size += new_pos;
lc_moving->pos -= new_pos;
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
if (sd->horizontal)
bi->w = lc_moving->size;
else
@@ -4292,30 +4277,29 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if (ok)
{
if (!l2) l2 = *list;
- else l2 = l2->next;
+ else l2 = eina_list_next(l2);
- for (; l2 != l; l2 = l2->next)
+ EINA_LIST_FOREACH(l2, l2, lc)
{
- lc = l2->data;
+ if (l2 == l) break;
lc->pos = new_pos;
_e_gadcon_layout_smart_position_items_inside_container(sd, lc);
- for (l3 = lc->items; l3; l3 = l3->next)
+ EINA_LIST_FOREACH(lc->items, l3, bi)
{
- bi = l3->data;
bi->gcc->state_info.flags &= ~E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE;
}
new_pos += lc->size;
}
}
}
- else if ((l) && (!l->prev))
+ else if ((l) && (!eina_list_prev(l)))
{
if (lc_moving->pos <= 0)
{
lc_moving->size = lc_moving->prev_size;
lc_moving->pos = 0;
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
if (sd->horizontal)
bi->w = lc_moving->size;
else
@@ -4333,19 +4317,18 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
else if (lc_moving->state == E_LAYOUT_ITEM_CONTAINER_STATE_SIZE_MAX_END_INC)
{
_e_gadcon_layout_smart_restore_gadcons_position_before_move(sd, &lc_moving, lc_back, list);
- for (l = *list; (l) && (l->data != lc_moving); l = l->next);
+ EINA_LIST_FOREACH(*list, l, lc)
+ if (lc == lc_moving) break;
- if ((l) && (l->next))
+ if ((l) && eina_list_next(l))
{
Eina_List *stop = NULL;
int new_pos = 0;
ok = 0;
new_pos = lc_moving->pos + lc_moving->size;
- for (l2 = l->next; l2; l2 = l2->next)
+ EINA_LIST_FOREACH(eina_list_next(l), l2, lc)
{
- lc = l2->data;
-
if (new_pos <= lc->pos)
{
stop = l2;
@@ -4361,7 +4344,7 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if (new_pos > sd->w)
{
lc_moving->size -= (new_pos - sd->w);
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
bi->w = lc_moving->size;
new_pos = lc_moving->pos + lc_moving->size;
@@ -4372,7 +4355,7 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if (new_pos > sd->h)
{
lc_moving->size -= (new_pos - sd->h);
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
bi->h = lc_moving->size;
new_pos = lc_moving->pos + lc_moving->size;
@@ -4381,28 +4364,27 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if (ok)
{
- for (l2 = l->next; l2 && l2 != stop; l2 = l2->next)
+ EINA_LIST_FOREACH(eina_list_next(l), l2, lc)
{
- lc = l2->data;
+ if (l2 == stop) break;
lc->pos = new_pos;
_e_gadcon_layout_smart_position_items_inside_container(sd, lc);
- for (l3 = lc->items; l3; l3 = l3->next)
+ EINA_LIST_FOREACH(lc->items, l3, bi)
{
- bi = l3->data;
bi->gcc->state_info.flags &= ~E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE;
}
new_pos += lc->size;
}
}
}
- else if ((l) && (!l->next))
+ else if ((l) && (!eina_list_next(l)))
{
if (sd->horizontal)
{
if ((lc_moving->pos + lc_moving->size) >= sd->w)
{
lc_moving->size = lc_moving->prev_size;
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
bi->w = lc_moving->size;
}
}
@@ -4411,7 +4393,7 @@ _e_gadcon_layout_smart_gadcons_position(E_Smart_Data *sd, Eina_List **list)
if ((lc_moving->pos + lc_moving->size) > sd->h)
{
lc_moving->size = lc_moving->prev_size;
- bi = lc_moving->items->data;
+ bi = eina_list_data_get(lc_moving->items);
bi->h = lc_moving->size;
}
}
@@ -4446,12 +4428,11 @@ _e_gadcon_layout_smart_gadcons_position_static(E_Smart_Data *sd, Eina_List **lis
*list = eina_list_sort(*list, eina_list_count(*list), _e_gadcon_layout_smart_containers_sort_cb);
__reposition_again:
- for (l = *list; l; l = l->next)
+ EINA_LIST_FOREACH(*list, l, lc)
{
- if (!l->next) continue;
+ if (!eina_list_next(l)) continue;
- lc = l->data;
- lc2 = l->next->data;
+ lc2 = eina_list_data_get(eina_list_next(l));
if (LC_OVERLAP(lc, lc2))
{
@@ -4459,7 +4440,7 @@ _e_gadcon_layout_smart_gadcons_position_static(E_Smart_Data *sd, Eina_List **lis
if (lc3)
{
l->data = lc3;
- *list = eina_list_remove_list(*list, l->next);
+ *list = eina_list_remove_list(*list, eina_list_next(l));
LC_FREE(lc);
LC_FREE(lc2);
goto __reposition_again;
@@ -4468,9 +4449,8 @@ _e_gadcon_layout_smart_gadcons_position_static(E_Smart_Data *sd, Eina_List **lis
}
ok = 1;
- for (l = *list; l; l = l->next)
+ EINA_LIST_FOREACH(*list, l, lc)
{
- lc = l->data;
if (lc->pos < 0)
{
ok = 0;
@@ -4541,8 +4521,8 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
{
int t;
- bi = lc->items->data;
- bi2 = lc2->items->data;
+ bi = eina_list_data_get(lc->items);
+ bi2 = eina_list_data_get(lc2->items);
if (sd->horizontal)
{
@@ -4585,9 +4565,8 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
_e_gadcon_layout_smart_containers_merge(sd, lc, lc2);
- for (l = lc->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc->items, l, bi)
{
- bi = l->data;
if (bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_POSITION)
{
if (sd->horizontal) shift = bi->ask.pos - bi->x;
@@ -4598,21 +4577,22 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
break;
}
- for (l = lc->items; l && shift; l = l->next)
+ if (shift)
{
- bi = l->data;
-
- if (sd->horizontal) bi->x += shift;
- else bi->y += shift;
-
- if (l == lc->items)
- {
- if (sd->horizontal) lc->pos = bi->x;
- else lc->pos = bi->y;
- }
- }
- }
- }
+ EINA_LIST_FOREACH(lc->items, l, bi)
+ {
+ if (sd->horizontal) bi->x += shift;
+ else bi->y += shift;
+
+ if (l == lc->items)
+ {
+ if (sd->horizontal) lc->pos = bi->x;
+ else lc->pos = bi->y;
+ }
+ }
+ }
+ }
+ }
create_new = 1;
new_state = E_LAYOUT_ITEM_CONTAINER_STATE_POS_LOCKED;
}
@@ -4638,9 +4618,8 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
{
int shift = 0;
- for (l = lc->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc->items, l, bi)
{
- bi = l->data;
if (bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_POSITION)
{
if (sd->horizontal) shift = bi->ask.pos - bi->x;
@@ -4651,27 +4630,28 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
break;
}
- for (l = lc->items; l && shift; l = l->next)
+ if (shift)
{
- bi = l->data;
-
- if (sd->horizontal) bi->x += shift;
- else bi->y += shift;
-
- if (l == lc->items)
- {
- if (sd->horizontal) lc->pos = bi->x;
- else lc->pos = bi->y;
- }
- }
+ EINA_LIST_FOREACH(lc->items, l, bi)
+ {
+ if (sd->horizontal) bi->x += shift;
+ else bi->y += shift;
+
+ if (l == lc->items)
+ {
+ if (sd->horizontal) lc->pos = bi->x;
+ else lc->pos = bi->y;
+ }
+ }
+ }
}
}
else if (lc2->state == E_LAYOUT_ITEM_CONTAINER_STATE_POS_DEC)
{
int t;
- bi = (eina_list_last(lc->items))->data;
- bi2 = lc2->items->data;
+ bi = eina_list_data_get(eina_list_last(lc->items));
+ bi2 = eina_list_data_get(lc2->items);
if (sd->horizontal)
{
@@ -4712,18 +4692,16 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
int move_lc1 = 1;
int move_lc2 = 1;
- for (l = lc->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc->items, l, bi)
{
- bi = l->data;
if (bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE)
{
move_lc1 = 0;
break;
}
}
- for (l = lc2->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc2->items, l, bi)
{
- bi = l->data;
if (bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE)
{
move_lc2 = 0;
@@ -4747,18 +4725,16 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
int move_lc1 = 1;
int move_lc2 = 1;
- for (l = lc->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc->items, l, bi)
{
- bi = l->data;
if (bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE)
{
move_lc1 = 0;
break;
}
}
- for (l = lc2->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc2->items, l, bi)
{
- bi = l->data;
if (bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE)
{
move_lc2 = 0;
@@ -4786,9 +4762,8 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
_e_gadcon_layout_smart_containers_merge(sd, lc, lc2);
- for (l = lc->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc->items, l, bi)
{
- bi = l->data;
if ((bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_POSITION) &&
(bi->gcc->state_info.flags & E_GADCON_LAYOUT_ITEM_LOCK_ABSOLUTE))
{
@@ -4800,22 +4775,23 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
}
}
- for (l = lc->items; l && shift; l = l->next)
+ if (shift)
{
- bi = l->data;
-
- if (sd->horizontal)
- bi->x += shift;
- else
- bi->y += shift;
-
- if (l == lc->items)
- {
- if (sd->horizontal)
- lc->pos = bi->x;
- else
- lc->pos = bi->y;
- }
+ EINA_LIST_FOREACH(lc->items, l, bi)
+ {
+ if (sd->horizontal)
+ bi->x += shift;
+ else
+ bi->y += shift;
+
+ if (l == lc->items)
+ {
+ if (sd->horizontal)
+ lc->pos = bi->x;
+ else
+ lc->pos = bi->y;
+ }
+ }
}
}
create_new = 1;
@@ -4830,10 +4806,10 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
if (lc->pos < lc2->pos)
{
lc3->pos = lc->pos;
- for (l = lc->items; l; l = l->next)
- lc3->items = eina_list_append(lc3->items, l->data);
- for (l = lc2->items; l; l = l->next)
- lc3->items = eina_list_append(lc3->items, l->data);
+ EINA_LIST_FOREACH(lc->items, l, bi)
+ lc3->items = eina_list_append(lc3->items, bi);
+ EINA_LIST_FOREACH(lc2->items, l, bi)
+ lc3->items = eina_list_append(lc3->items, bi);
lc3->state_info.min_seq = lc->state_info.min_seq;
if (lc2->items)
@@ -4844,10 +4820,10 @@ _e_gadcon_layout_smart_containers_position_adjust(E_Smart_Data *sd, E_Layout_Ite
else
{
lc3->pos = lc2->pos;
- for (l = lc2->items; l; l = l->next)
- lc3->items = eina_list_append(lc3->items, l->data);
- for (l = lc->items; l; l = l->next)
- lc3->items = eina_list_append(lc3->items, l->data);
+ EINA_LIST_FOREACH(lc2->items, l, bi)
+ lc3->items = eina_list_append(lc3->items, bi);
+ EINA_LIST_FOREACH(lc->items, l, bi)
+ lc3->items = eina_list_append(lc3->items, bi);
lc3->state_info.min_seq = lc2->state_info.min_seq;
if (lc->items)
@@ -4871,16 +4847,15 @@ _e_gadcon_layout_smart_position_items_inside_container(E_Smart_Data *sd, E_Layou
if (!lc->items) return;
- bi = lc->items->data;
+ bi = eina_list_data_get(lc->items);
if (sd->horizontal)
shift = lc->pos - bi->x;
else
shift = lc->pos - bi->y;
if (!shift) return;
- for (l = lc->items; l; l = l->next)
+ EINA_LIST_FOREACH(lc->items, l, bi)
{
- bi = l->data;
if (sd->horizontal)
bi->x += shift;
else
@@ -4904,16 +4879,15 @@ _e_gadcon_layout_smart_containers_merge(E_Smart_Data *sd, E_Layout_Item_Containe
Eina_List *l, *nl = NULL;
E_Gadcon_Layout_Item *bi;
- for (l = lc->items; l; l = l->next)
- nl = eina_list_append(nl, l->data);
- for (l = lc2->items; l; l = l->next)
- nl = eina_list_append(nl, l->data);
+ EINA_LIST_FOREACH(lc->items, l, bi)
+ nl = eina_list_append(nl, bi);
+ EINA_LIST_FOREACH(lc2->items, l, bi)
+ nl = eina_list_append(nl, bi);
nl = eina_list_sort(nl, eina_list_count(nl), _e_gadcon_layout_smart_seq_sort_cb);
- for (l = nl; l; l = l->next)
+ EINA_LIST_FOREACH(nl, l, bi)
{
- bi = l->data;
if (l == nl)
{
min_seq = max_seq = bi->gcc->state_info.seq;
@@ -4973,7 +4947,7 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
((*lc_moving)->state == E_LAYOUT_ITEM_CONTAINER_STATE_SIZE_MAX_END_DEC))
{
(*lc_moving)->size = (*lc_moving)->prev_size;
- bi = (*lc_moving)->items->data;
+ bi = eina_list_data_get((*lc_moving)->items);
if (sd->horizontal)
bi->w = (*lc_moving)->prev_size;
else
@@ -4986,14 +4960,13 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
lc2 = NULL;
lc3 = NULL;
ok = 0;
- for (l = *con_list; l; l = l->next)
+ EINA_LIST_FOREACH(*con_list, l, lc)
{
- lc = l->data;
if (lc->state == E_LAYOUT_ITEM_CONTAINER_STATE_NONE) continue;
if (eina_list_count(lc->items) == 1)
{
- bi = lc->items->data;
+ bi = eina_list_data_get(lc->items);
if ((bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_POS_INC) ||
(bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_POS_DEC) ||
(bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_SIZE_MIN_END_INC) ||
@@ -5008,7 +4981,7 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
if (((*lc_moving)->state != E_LAYOUT_ITEM_CONTAINER_STATE_POS_INC) &&
((*lc_moving)->state != E_LAYOUT_ITEM_CONTAINER_STATE_POS_DEC))
{
- bi = (*lc_moving)->items->data;
+ bi = eina_list_data_get((*lc_moving)->items);
if (sd->horizontal)
bi->w = (*lc_moving)->size;
else
@@ -5018,9 +4991,8 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
}
else
{
- for (l2 = lc->items; l2; l2 = l2->next)
+ EINA_LIST_FOREACH(lc->items, l2, bi)
{
- bi = l2->data;
if ((bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_POS_INC) ||
(bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_POS_DEC) ||
(bi->gcc->state_info.state == E_LAYOUT_ITEM_STATE_SIZE_MIN_END_INC) ||
@@ -5034,9 +5006,9 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
lc2 = E_NEW(E_Layout_Item_Container, 1);
lc2->sd = sd;
lc2->state = E_LAYOUT_ITEM_CONTAINER_STATE_NONE;
- for (l3 = lc->items; l3 != l2; l3 = l3->next)
+ EINA_LIST_FOREACH(lc->items, l3, bi2)
{
- bi2 = l3->data;
+ if(l2 == l3) break;
lc2->items = eina_list_append(lc2->items, bi2);
if (l3 == lc->items)
{
@@ -5051,16 +5023,15 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
}
}
- if (l2->next)
+ if (eina_list_next(l2))
{
lc3 = E_NEW(E_Layout_Item_Container, 1);
lc3->sd = sd;
lc3->state = E_LAYOUT_ITEM_CONTAINER_STATE_NONE;
- for (l3 = l2->next; l3; l3 = l3->next)
+ EINA_LIST_FOREACH(eina_list_next(l2), l3, bi2)
{
- bi2 = l3->data;
lc3->items = eina_list_append(lc3->items, bi2);
- if (l3 == l2->next)
+ if (l3 == eina_list_next(l2))
{
lc3->state_info.min_seq = bi2->gcc->state_info.seq;
if (sd->horizontal)
@@ -5078,7 +5049,7 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
if (((*lc_moving)->state != E_LAYOUT_ITEM_CONTAINER_STATE_POS_INC) &&
((*lc_moving)->state != E_LAYOUT_ITEM_CONTAINER_STATE_POS_DEC))
{
- bi = (*lc_moving)->items->data;
+ bi = eina_list_data_get((*lc_moving)->items);
if (sd->horizontal)
bi->w = (*lc_moving)->size;
else
@@ -5114,9 +5085,8 @@ _e_gadcon_layout_smart_restore_gadcons_position_before_move(E_Smart_Data *sd, E_
}
}
- for (l = *con_list; l; l = l->next)
+ EINA_LIST_FOREACH(*con_list, l, lc)
{
- lc = l->data;
if (lc == *lc_moving) continue;
lc->state = E_LAYOUT_ITEM_CONTAINER_STATE_NONE;
}
diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c
index 825d691bf..7c46745f3 100644
--- a/src/bin/e_hints.c
+++ b/src/bin/e_hints.c
@@ -216,6 +216,7 @@ e_hints_manager_init(E_Manager *man)
int i = 0, num = 0;
unsigned int *areas = NULL;
Eina_List *cl;
+ E_Container *c;
Ecore_X_Window *vroots = NULL;
/* FIXME: Desktop names not yet implemented */
/* char **names; */
@@ -236,11 +237,8 @@ e_hints_manager_init(E_Manager *man)
return;
}
- for (cl = man->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(man->containers, cl, c)
{
- E_Container *c;
-
- c = cl->data;
areas[4 * i] = c->x;
areas[4 * i + 1] = c->y;
areas[4 * i + 2] = c->w;
@@ -277,12 +275,10 @@ e_hints_client_list_set(void)
Ecore_X_Window *clients = NULL;
/* Get client count by adding client lists on all containers */
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
- for (cl = m->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(m->containers, cl, c)
{
- c = cl->data;
num += e_container_borders_count(c);
}
}
@@ -294,13 +290,11 @@ e_hints_client_list_set(void)
/* Fetch window IDs and add to array */
if (num > 0)
{
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
i = 0;
- for (cl = m->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(m->containers, cl, c)
{
- c = cl->data;
bl = e_container_border_list_first(c);
while ((b = e_container_border_list_next(bl)))
clients[i++] = b->client.win;
@@ -320,9 +314,8 @@ e_hints_client_list_set(void)
}
else
{
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
ecore_x_netwm_client_list_set(m->root, NULL, 0);
ecore_x_netwm_client_list_stacking_set(m->root, NULL, 0);
}
@@ -344,12 +337,10 @@ e_hints_client_stacking_set(void)
Ecore_X_Window *clients = NULL;
/* Get client count */
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
- for (cl = m->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(m->containers, cl, c)
{
- c = cl->data;
num += e_container_borders_count(c);
}
}
@@ -359,12 +350,10 @@ e_hints_client_stacking_set(void)
clients = calloc(num, sizeof(Ecore_X_Window));
if (!clients) return;
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
- for (cl = m->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(m->containers, cl, c)
{
- c = cl->data;
bl = e_container_border_list_first(c);
while ((b = e_container_border_list_next(bl)))
{
@@ -390,18 +379,16 @@ e_hints_client_stacking_set(void)
"This is strange, but not harmful.\n"
"Please report this.\n");
}
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
ecore_x_netwm_client_list_stacking_set(m->root, clients, num);
}
E_FREE(clients);
}
else
{
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, m)
{
- m = ml->data;
ecore_x_netwm_client_list_stacking_set(m->root, NULL, 0);
}
}
diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c
index f4345c9ae..11212cb88 100644
--- a/src/bin/e_ilist.c
+++ b/src/bin/e_ilist.c
@@ -325,15 +325,14 @@ e_ilist_prepend_relative(Evas_Object *obj, Evas_Object *icon, const char *label,
EAPI void
e_ilist_clear(Evas_Object *obj)
{
+ E_Ilist_Item *si = NULL;
+
API_ENTRY return;
e_ilist_freeze(obj);
- while (sd->items)
+ EINA_LIST_FREE(sd->items, si)
{
- E_Ilist_Item *si = NULL;
-
- if (!(si = sd->items->data)) continue;
- sd->items = eina_list_remove_list(sd->items, sd->items);
+ if (!si) continue;
if (si->o_icon) evas_object_del(si->o_icon);
evas_object_del(si->o_base);
E_FREE(si);
@@ -402,17 +401,16 @@ EAPI void
e_ilist_unselect(Evas_Object *obj)
{
Eina_List *l = NULL;
+ E_Ilist_Item *si = NULL;
const char *stacking, *selectraise;
API_ENTRY return;
if (!sd->items) return;
if (sd->selected < 0) return;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, si)
{
- E_Ilist_Item *si = NULL;
-
- if (!(si = l->data)) continue;
+ if (!si) continue;
if (!si->selected) continue;
edje_object_signal_emit(si->o_base, "e,state,unselected", "e");
si->selected = 0;
@@ -442,9 +440,9 @@ e_ilist_selected_set(Evas_Object *obj, int n)
if (n >= i) n = i - 1;
else if (n < 0) n = 0;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, si)
{
- if (!(si = l->data)) continue;
+ if (!si) continue;
if ((!si->selected) || (si->header)) continue;
edje_object_signal_emit(si->o_base, "e,state,unselected", "e");
si->selected = 0;
@@ -484,6 +482,7 @@ EAPI int
e_ilist_selected_get(Evas_Object *obj)
{
Eina_List *l = NULL;
+ E_Ilist_Item *li = NULL;
int i, j;
API_ENTRY return -1;
@@ -493,12 +492,11 @@ e_ilist_selected_get(Evas_Object *obj)
else
{
j = -1;
- for (i = 0, l = sd->items; l; l = l->next, i++)
+ i = 0;
+ EINA_LIST_FOREACH(sd->items, l, li)
{
- E_Ilist_Item *li = NULL;
-
- if (!(li = l->data)) continue;
- if (li->selected) j = i;
+ if (li && li->selected) j = i;
+ i++;
}
return j;
}
@@ -578,15 +576,14 @@ EAPI int
e_ilist_selected_count_get(Evas_Object *obj)
{
Eina_List *l = NULL;
+ E_Ilist_Item *si = NULL;
int count = 0;
API_ENTRY return 0;
if (!sd->items) return 0;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, si)
{
- E_Ilist_Item *si = NULL;
-
- if (!(si = l->data)) continue;
+ if (!si) continue;
if (si->selected) count++;
}
return count;
@@ -701,17 +698,17 @@ EAPI void
e_ilist_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
Eina_List *l = NULL;
+ E_Ilist_Item *si = NULL;
API_ENTRY return;
if ((sd->iw == w) && (sd->ih == h)) return;
sd->iw = w;
sd->ih = h;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, si)
{
- E_Ilist_Item *si = NULL;
Evas_Coord mw = 0, mh = 0;
- if (!(si = l->data)) continue;
+ if (!si) continue;
if (!si->o_icon) continue;
edje_extern_object_min_size_set(si->o_icon, w, h);
edje_object_part_swallow(si->o_base, "e.swallow.icon", si->o_icon);
@@ -960,7 +957,7 @@ _e_smart_event_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_in
{
E_Smart_Data *sd;
Evas_Event_Mouse_Up *ev;
- E_Ilist_Item *si;
+ E_Ilist_Item *si, *item;
Eina_List *l = NULL;
int i;
@@ -982,9 +979,10 @@ _e_smart_event_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_in
if (!sd->items) return;
- for (i = 0, l = sd->items; l; l = l->next, i++)
+ i = 0;
+ EINA_LIST_FOREACH(sd->items, l, item)
{
- if (l->data == si)
+ if (item == si)
{
if (!sd->multi_select)
e_ilist_selected_set(sd->o_smart, i);
@@ -999,6 +997,7 @@ _e_smart_event_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_in
}
break;
}
+ i++;
}
if(!sd->selector) return;
@@ -1204,13 +1203,10 @@ _e_typebuf_match(Evas_Object *obj)
strcat(match, sd->typebuf.buf);
strcat(match, "*");
- l = sd->items;
n = 0;
-
- while (l)
+ EINA_LIST_FOREACH(sd->items, l, si)
{
const char *label = NULL;
- si = l->data;
if (si)
{
label = edje_object_part_text_get(si->o_base, "e.text.label");
@@ -1221,7 +1217,6 @@ _e_typebuf_match(Evas_Object *obj)
break;
}
}
- l = l->next;
n++;
}
diff --git a/src/bin/e_init.c b/src/bin/e_init.c
index 44963da8e..2ec81ebed 100644
--- a/src/bin/e_init.c
+++ b/src/bin/e_init.c
@@ -151,12 +151,10 @@ e_init_client_data(Ecore_Ipc_Event_Client_Data *e)
for (i = 0; i < num; i+= 2)
{
Eina_List *l;
+ E_Manager *man;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
-
- man = l->data;
if (man->root == initwins[i + 0])
{
man->initwin = initwins[i + 1];
@@ -191,13 +189,11 @@ e_init_client_del(Ecore_Ipc_Event_Client_Del *e)
if (e->client == client)
{
Eina_List *l;
+ E_Manager *man;
client = NULL;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
-
- man = l->data;
man->initwin = 0;
}
}
diff --git a/src/bin/e_init_main.c b/src/bin/e_init_main.c
index a7fe4cff0..0395159b4 100644
--- a/src/bin/e_init_main.c
+++ b/src/bin/e_init_main.c
@@ -276,11 +276,9 @@ e_init_init(void)
screens = (Eina_List *)e_xinerama_screens_get();
if (screens)
{
- for (l = screens; l; l = l->next)
+ E_Screen *scr;
+ EINA_LIST_FOREACH(screens, l, scr)
{
- E_Screen *scr;
-
- scr = l->data;
o = edje_object_add(_e_init_evas);
if (l == screens)
{
@@ -485,7 +483,7 @@ _e_init_evas_new(Ecore_X_Window root, int w, int h, Ecore_X_Window *winret)
evas_image_cache_set(e, 4096 * 1024);
evas_font_cache_set(e, 512 * 1024);
- EINA_LIST_FOREACH(fpath, l, path) evas_font_path_append(e, l->data);
+ EINA_LIST_FOREACH(fpath, l, path) evas_font_path_append(e, path);
if (font_hinting == 0)
{
diff --git a/src/bin/e_int_border_remember.c b/src/bin/e_int_border_remember.c
index e0be34027..f361445ea 100644
--- a/src/bin/e_int_border_remember.c
+++ b/src/bin/e_int_border_remember.c
@@ -157,18 +157,17 @@ static int
_check_matches(E_Border *bd, int matchflags)
{
Eina_List *l;
+ E_Border *bd2;
int n = 0;
const char *title;
title = e_border_name_get(bd);
- for (l = e_border_client_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd2)
{
- E_Border *bd2;
int required_matches;
int matches;
const char *title2;
- bd2 = l->data;
matches = 0;
required_matches = 0;
if (matchflags & E_REMEMBER_MATCH_NAME) required_matches++;
diff --git a/src/bin/e_int_config_modules.c b/src/bin/e_int_config_modules.c
index 2de32efdb..655a39718 100644
--- a/src/bin/e_int_config_modules.c
+++ b/src/bin/e_int_config_modules.c
@@ -143,16 +143,15 @@ static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
Eina_List *mdirs = NULL, *l = NULL;
+ E_Path_Dir *epd = NULL;
if (!cfdata) return;
/* loop each path_modules dir and load modules for that path */
mdirs = e_path_dir_list_get(path_modules);
- for (l = mdirs; l; l = l->next)
+ EINA_LIST_FOREACH(mdirs, l, epd)
{
- E_Path_Dir *epd = NULL;
-
- if (!(epd = l->data)) continue;
+ if (!epd) continue;
if (!ecore_file_is_dir(epd->dir)) continue;
_load_modules(epd->dir);
}
@@ -612,16 +611,16 @@ static void
_select_all_modules(Evas_Object *obj, void *data)
{
Eina_List *l = NULL;
+ E_Ilist_Item *item = NULL;
E_Config_Dialog_Data *cfdata = NULL;
- int i = 0;
+ int i = -1;
if (!(cfdata = data)) return;
- for (i = 0, l = e_widget_ilist_items_get(obj); l; l = l->next, i++)
+ EINA_LIST_FOREACH(e_widget_ilist_items_get(obj), l, item)
{
- E_Ilist_Item *item = NULL;
CFModule *mod = NULL;
+ i++;
- item = l->data;
if ((!item) || (!item->selected)) continue;
if (!(mod = e_widget_ilist_nth_data_get(obj, i))) continue;
mod->selected = 1;
diff --git a/src/bin/e_int_gadcon_config.c b/src/bin/e_int_gadcon_config.c
index f51ca113c..957ee4e6a 100644
--- a/src/bin/e_int_gadcon_config.c
+++ b/src/bin/e_int_gadcon_config.c
@@ -216,6 +216,7 @@ _load_avail_gadgets(void *data)
{
E_Config_Dialog_Data *cfdata = NULL;
Eina_List *l = NULL;
+ E_Gadcon_Client_Class *cc;
Evas *evas;
int w;
@@ -227,13 +228,12 @@ _load_avail_gadgets(void *data)
e_widget_ilist_clear(cfdata->o_avail);
// l = e_gadcon_provider_list();
// if (l) l = eina_list_sort(l, -1, _gad_list_sort);
- for (l = e_gadcon_provider_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_gadcon_provider_list(), l, cc)
{
- E_Gadcon_Client_Class *cc;
Evas_Object *icon = NULL;
const char *lbl = NULL;
- if (!(cc = l->data)) continue;
+ if (!cc) continue;
// check the current site is allowed for this gadcon client
if (cc->func.is_site && !cc->func.is_site(cfdata->site))
continue;
@@ -257,6 +257,8 @@ _load_sel_gadgets(void *data)
{
E_Config_Dialog_Data *cfdata = NULL;
Eina_List *l = NULL, *l2 = NULL;
+ E_Config_Gadcon_Client *cgc;
+ E_Gadcon_Client_Class *gcc;
Evas *evas;
int w;
@@ -266,18 +268,15 @@ _load_sel_gadgets(void *data)
edje_freeze();
e_widget_ilist_freeze(cfdata->o_sel);
e_widget_ilist_clear(cfdata->o_sel);
- for (l = cfdata->gc->cf->clients; l; l = l->next)
+ EINA_LIST_FOREACH(cfdata->gc->cf->clients, l, cgc)
{
- E_Config_Gadcon_Client *cgc;
-
- if (!(cgc = l->data)) continue;
- for (l2 = e_gadcon_provider_list(); l2; l2 = l2->next)
+ if (!cgc) continue;
+ EINA_LIST_FOREACH(e_gadcon_provider_list(), l2, gcc)
{
- E_Gadcon_Client_Class *gcc;
Evas_Object *icon = NULL;
const char *lbl = NULL;
- if (!(gcc = l2->data)) continue;
+ if (!gcc) continue;
if ((cgc->name) && (gcc->name) &&
(!strcmp(cgc->name, gcc->name)))
{
@@ -303,15 +302,17 @@ _cb_add(void *data, void *data2)
{
E_Config_Dialog_Data *cfdata = NULL;
Eina_List *l = NULL;
+ E_Ilist_Item *item = NULL;
int i = 0, update = 0;
if (!(cfdata = data)) return;
- for (i = 0, l = e_widget_ilist_items_get(cfdata->o_avail); l; l = l->next, i++)
+ i = -1;
+ EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->o_avail), l, item)
{
- E_Ilist_Item *item = NULL;
const char *name = NULL;
- if (!(item = l->data)) continue;
+ i++;
+ if (!item) continue;
if (!item->selected) continue;
name = (char *)e_widget_ilist_nth_data_get(cfdata->o_avail, i);
if (!name) continue;
@@ -334,23 +335,24 @@ _cb_del(void *data, void *data2)
{
E_Config_Dialog_Data *cfdata = NULL;
Eina_List *l = NULL, *g = NULL;
+ E_Ilist_Item *item = NULL;
+ E_Config_Gadcon_Client *cgc;
int i = 0, update = 0;
if (!(cfdata = data)) return;
- for (i = 0, l = e_widget_ilist_items_get(cfdata->o_sel); l; l = l->next, i++)
+ i = -1;
+ EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->o_avail), l, item)
{
- E_Ilist_Item *item = NULL;
const char *name = NULL;
- if (!(item = l->data)) continue;
+ i++;
+ if (!item) continue;
if (!item->selected) continue;
name = (char *)e_widget_ilist_nth_data_get(cfdata->o_sel, i);
if (!name) continue;
- for (g = cfdata->gc->cf->clients; g; g = g->next)
+ EINA_LIST_FOREACH(cfdata->gc->cf->clients, g, cgc)
{
- E_Config_Gadcon_Client *cgc;
-
- if (!(cgc = g->data)) continue;
+ if (!cgc) continue;
if (strcmp(name, cgc->name)) continue;
e_gadcon_client_config_del(cfdata->gc->cf, cgc);
update = 1;
diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c
index 469951a6b..f9e64b4a3 100644
--- a/src/bin/e_int_menus.c
+++ b/src/bin/e_int_menus.c
@@ -889,6 +889,7 @@ static void
_e_int_menus_clients_menu_add_iconified(Eina_List *borders, E_Menu *m)
{
Eina_List *l = NULL;
+ E_Border *bd;
E_Menu_Item *mi;
if (eina_list_count(borders) > 0)
@@ -896,11 +897,8 @@ _e_int_menus_clients_menu_add_iconified(Eina_List *borders, E_Menu *m)
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
_e_int_menus_clients_item_create(bd, m);
}
}
@@ -910,16 +908,14 @@ static void
_e_int_menus_clients_add_by_class(Eina_List *borders, E_Menu *m)
{
Eina_List *l = NULL, *ico = NULL;
+ E_Border *bd;
E_Menu *subm = NULL;
E_Menu_Item *mi;
char *class = NULL;
class = strdup("");
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if ((bd->iconic) &&
(e_config->clientlist_separate_iconified_apps == E_CLIENTLIST_GROUPICONS_SEP))
{
@@ -963,15 +959,13 @@ _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *
{
E_Desk *desk = NULL;
Eina_List *l = NULL, *alt = NULL, *ico = NULL;
+ E_Border *bd;
E_Menu *subm;
E_Menu_Item *mi;
/* Deal with present desk first */
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (bd->iconic && e_config->clientlist_separate_iconified_apps && E_CLIENTLIST_GROUPICONS_SEP)
{
ico = eina_list_append(ico, bd);
@@ -1002,11 +996,8 @@ _e_int_menus_clients_add_by_desk(E_Desk *curr_desk, Eina_List *borders, E_Menu *
e_menu_item_separator_set(mi, 1);
}
- for (l = alt; l; l = l->next)
+ EINA_LIST_FOREACH(alt, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if ((bd->desk != desk) &&
(e_config->clientlist_separate_with != E_CLIENTLIST_GROUP_SEP_NONE))
{
@@ -1042,12 +1033,10 @@ static void
_e_int_menus_clients_add_by_none(Eina_List *borders, E_Menu *m)
{
Eina_List *l = NULL, *ico = NULL;
+ E_Border *bd;
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if ((bd->iconic) && (e_config->clientlist_separate_iconified_apps) &&
(E_CLIENTLIST_GROUPICONS_SEP))
{
@@ -1065,6 +1054,7 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m)
E_Menu *subm;
E_Menu_Item *mi;
Eina_List *l = NULL, *borders = NULL;
+ E_Border *border;
E_Zone *zone = NULL;
E_Desk *desk = NULL;
Main_Data *dat;
@@ -1078,11 +1068,8 @@ _e_int_menus_clients_pre_cb(void *data, E_Menu *m)
l = e_border_focus_stack_get();
else
l = e_border_client_list();
- for (; l; l = l->next)
+ EINA_LIST_FOREACH(l, l, border)
{
- E_Border *border;
-
- border = l->data;
if (border->client.netwm.state.skip_taskbar) continue;
if (border->user_skip_winlist) continue;
if ((border->zone == zone) || (border->iconic) ||
@@ -1267,6 +1254,7 @@ _e_int_menus_lost_clients_pre_cb(void *data, E_Menu *m)
{
E_Menu_Item *mi;
Eina_List *l, *borders = NULL;
+ E_Border *bd;
E_Menu *root;
E_Zone *zone = NULL;
@@ -1283,12 +1271,10 @@ _e_int_menus_lost_clients_pre_cb(void *data, E_Menu *m)
e_menu_item_label_set(mi, _("(No Windows)"));
return;
}
- for (l = borders; l; l = l->next)
+ EINA_LIST_FOREACH(borders, l, bd)
{
- E_Border *bd;
const char *title = "";
- bd = l->data;
title = e_border_name_get(bd);
mi = e_menu_item_new(m);
if ((title) && (title[0]))
@@ -1358,6 +1344,7 @@ _e_int_menus_shelves_pre_cb(void *data, E_Menu *m)
{
E_Menu_Item *mi;
Eina_List *l, *shelves = NULL;
+ E_Shelf *s;
E_Container *con;
E_Zone *zone;
@@ -1374,13 +1361,12 @@ _e_int_menus_shelves_pre_cb(void *data, E_Menu *m)
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, _("(No Shelves)"));
}
- for (l = shelves; l; l = l->next)
+ EINA_LIST_FOREACH(shelves, l, s)
{
- E_Shelf *s;
const char *name;
char buf[4096];
- if (!(s = l->data)) continue;
+ if (!s) continue;
if (s->zone->num != zone->num) continue;
if (s->cfg->container != con->num) continue;
diff --git a/src/bin/e_int_shelf_config.c b/src/bin/e_int_shelf_config.c
index dddc153f8..fd79c9b9a 100644
--- a/src/bin/e_int_shelf_config.c
+++ b/src/bin/e_int_shelf_config.c
@@ -180,16 +180,15 @@ _desk_sel_list_load(E_Config_Dialog_Data *cfdata)
{
E_Desk *desk;
Eina_List *l = NULL;
+ E_Config_Shelf_Desk *sd;
desk = e_desk_at_xy_get(cfdata->es->zone, x, y);
e_widget_ilist_append(cfdata->desk_sel_list, NULL, desk->name,
NULL, NULL, NULL);
- for (l = cfdata->desk_list; l; l = l->next)
+ EINA_LIST_FOREACH(cfdata->desk_list, l, sd)
{
- E_Config_Shelf_Desk *sd;
-
- if (!(sd = l->data)) continue;
+ if (!sd) continue;
if ((sd->x != x) || (sd->y != y)) continue;
e_widget_ilist_multi_select(cfdata->desk_sel_list,
@@ -413,14 +412,15 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
Eina_List *l = NULL;
Eina_List *desk_list = NULL;
+ E_Ilist_Item *item;
- for (idx = 0, l = e_widget_ilist_items_get(cfdata->desk_sel_list); l; l = l->next, idx++)
+ idx = -1;
+ EINA_LIST_FOREACH(e_widget_ilist_items_get(cfdata->desk_sel_list), l, item)
{
- E_Ilist_Item *item;
E_Desk *desk;
E_Config_Shelf_Desk *sd;
- item = l->data;
+ idx++;
if ((!item) || (!item->selected)) continue;
desk = e_desk_at_pos_get(cfdata->es->zone, idx);
@@ -456,14 +456,12 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
E_Desk *desk;
Eina_List *l;
+ E_Config_Shelf_Desk *sd;
int show_shelf=0;
desk = e_desk_current_get(cfdata->es->zone);
- for (l = cfdata->escfg->desk_list; l; l = l->next)
+ EINA_LIST_FOREACH(cfdata->escfg->desk_list, l, sd)
{
- E_Config_Shelf_Desk *sd;
-
- sd = l->data;
if ((desk->x == sd->x) && (desk->y == sd->y))
{
show_shelf=1;
@@ -565,6 +563,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
E_Radio_Group *rg;
Evas_Coord wmw, wmh;
Eina_List *styles, *l;
+ char *style;
int sel, n;
/* FIXME: this is just raw config now - it needs UI improvments */
@@ -650,18 +649,20 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
sel = 0;
styles = e_theme_shelf_list();
- for (n = 0, l = styles; l; l = l->next, n++)
+ n = 0;
+ EINA_LIST_FOREACH(styles, l, style)
{
char buf[4096];
ob = e_livethumb_add(evas);
e_livethumb_vsize_set(ob, 120, 40);
oj = edje_object_add(e_livethumb_evas_get(ob));
- snprintf(buf, sizeof(buf), "e/shelf/%s/base", (char *)l->data);
+ snprintf(buf, sizeof(buf), "e/shelf/%s/base", style);
e_theme_edje_object_set(oj, "base/theme/shelf", buf);
e_livethumb_thumb_set(ob, oj);
- e_widget_ilist_append(oi, ob, (char *)l->data, NULL, NULL, l->data);
- if (!strcmp(cfdata->es->style, (char *)l->data)) sel = n;
+ e_widget_ilist_append(oi, ob, style, NULL, NULL, style);
+ if (!strcmp(cfdata->es->style, style)) sel = n;
+ n++;
}
e_widget_min_size_get(oi, &wmw, &wmh);
e_widget_min_size_set(oi, wmw, 160);
diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c
index e84b6e44b..a27055a95 100644
--- a/src/bin/e_intl.c
+++ b/src/bin/e_intl.c
@@ -466,6 +466,8 @@ _e_intl_language_path_find(char *language)
Eina_List *search_list;
Eina_List *next_dir;
Eina_List *next_search;
+ E_Path_Dir *epd;
+ char *search_locale;
int found;
search_list = _e_intl_locale_search_order_get(language);
@@ -477,18 +479,15 @@ _e_intl_language_path_find(char *language)
dir_list = e_path_dir_list_get(path_messages);
/* For each directory in the path */
- for (next_dir = dir_list; next_dir && !found; next_dir = next_dir->next)
+ EINA_LIST_FOREACH(dir_list, next_dir, epd)
{
- E_Path_Dir *epd;
- epd = next_dir->data;
+ if (found) break;
/* Match canonicalized locale against each possible search */
- for (next_search = search_list; next_search && !found; next_search = next_search->next)
+ EINA_LIST_FOREACH(search_list, next_search, search_locale)
{
- char *search_locale;
char message_path[PATH_MAX];
- search_locale = next_search->data;
snprintf(message_path, sizeof(message_path), "%s/%s/LC_MESSAGES/%s.mo", epd->dir, search_locale, PACKAGE);
if ((ecore_file_exists(message_path)) && (!ecore_file_is_dir(message_path)))
@@ -580,19 +579,17 @@ _e_intl_locale_alias_hash_get(void)
{
Eina_List *next;
Eina_List *dir_list;
+ E_Path_Dir *epd;
Eina_Hash *alias_hash;
dir_list = e_path_dir_list_get(path_messages);
alias_hash = NULL;
- for (next = dir_list; next; next = next->next)
+ EINA_LIST_FOREACH(dir_list, next, epd)
{
char buf[4096];
- E_Path_Dir *epd;
FILE *f;
- epd = next->data;
-
snprintf(buf, sizeof(buf), "%s/locale.alias", epd->dir);
f = fopen(buf, "r");
if (f)
@@ -1027,16 +1024,15 @@ _e_intl_imc_dir_scan(const char *dir)
files = ecore_file_ls(dir);
EINA_LIST_FREE(files, file)
+ {
+ if (strstr(file, ".imc") != NULL)
{
- if (strstr(file, ".imc") != NULL)
- {
- char buf[PATH_MAX];
-
- snprintf(buf, sizeof(buf), "%s/%s", dir, file);
- imcs = eina_list_append(imcs, strdup(buf));
- }
- free(file);
+ char buf[PATH_MAX];
+
+ snprintf(buf, sizeof(buf), "%s/%s", dir, file);
+ imcs = eina_list_append(imcs, strdup(buf));
}
-
+ free(file);
+ }
return imcs;
}
diff --git a/src/bin/e_ipc_codec.c b/src/bin/e_ipc_codec.c
index b25eccf69..8a4b31b7d 100644
--- a/src/bin/e_ipc_codec.c
+++ b/src/bin/e_ipc_codec.c
@@ -315,23 +315,17 @@ e_ipc_codec_str_list_dec(char *data, int bytes, Eina_List **dest)
{
E_Ipc_List *dat;
Eina_List *list = NULL, *l;
+ E_Ipc_Str *str_node;
if (!data) return 0;
dat = eet_data_descriptor_decode(_e_ipc_str_list_edd, data, bytes);
if (!dat) return 0;
- for (l = dat->list; l; l = l->next)
+ EINA_LIST_FOREACH(dat->list, l, str_node)
{
- E_Ipc_Str *str_node;
-
- str_node = l->data;
list = eina_list_append(list, str_node->str);
}
if (dest) *dest = list;
- while (dat->list)
- {
- free(dat->list->data);
- dat->list = eina_list_remove_list(dat->list, dat->list);
- }
+ E_FREE_LIST(dat->list, free);
free(dat);
return 1;
}
@@ -341,23 +335,19 @@ e_ipc_codec_str_list_enc(Eina_List *list, int *size_ret)
{
E_Ipc_List dat;
Eina_List *l;
+ E_Ipc_Str *str_node;
+ char *str;
void *data;
dat.list = NULL;
- for (l = list; l; l = l->next)
+ EINA_LIST_FOREACH(list, l, str)
{
- E_Ipc_Str *str_node;
-
str_node = malloc(sizeof(E_Ipc_Str));
- str_node->str = l->data;
+ str_node->str = str;
dat.list = eina_list_append(dat.list, str_node);
}
data = eet_data_descriptor_encode(_e_ipc_str_list_edd, &dat, size_ret);
- while (dat.list)
- {
- free(dat.list->data);
- dat.list = eina_list_remove_list(dat.list, dat.list);
- }
+ E_FREE_LIST(dat.list, free);
return data;
}
diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h
index 0e4ad1276..6a47d05d0 100644
--- a/src/bin/e_ipc_handlers.h
+++ b/src/bin/e_ipc_handlers.h
@@ -358,10 +358,7 @@ case HDL: \
break;
# define FREE_LIST(__list) \
-while (__list) { \
- free(__list->data); \
- __list = eina_list_remove_list(__list, __list); \
-}
+E_FREE_LIST(__list, free)
# define SEND_DATA(__opcode) \
ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __opcode, 0, 0, 0, data, bytes); \
@@ -371,9 +368,8 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_str_int_list_dec(e->data, e->size, &dat)) { \
- for (l = dat; l; l = l->next) { \
- E_Ipc_Str_Int *__v; \
- __v = l->data;
+ E_Ipc_Str_Int *__v; \
+ EINA_LIST_FOREACH(dat, l, __v) {
#define END_STRING_INT_LIST(__v) \
E_FREE(__v->str); \
free(__v); \
@@ -387,10 +383,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_Str_Int *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_Str_Int));
#define END_SEND_STRING_INT_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -418,9 +413,9 @@ free(data);
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_3int_3str_list_dec(e->data, e->size, &dat)) {
#define INT3_STRING3_LIST_ITERATE(__v) \
- for (l = dat; l; l = l->next) { \
+ for (l = dat; l; l = eina_list_next(l)) { \
E_Ipc_3Int_3Str *__v; \
- __v = l->data;
+ __v = eina_list_data_get(l);
#define END_INT3_STRING3_LIST(__v) \
END_INT3_STRING3_LIST_ITERATE(__v) \
END_INT3_STRING3_LIST_START()
@@ -450,10 +445,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_3Int_3Str *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_3Int_3Str));
#define END_SEND_INT3_STRING3_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -481,9 +475,9 @@ free(data);
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_4int_2str_list_dec(e->data, e->size, &dat)) {
#define INT4_STRING2_LIST_ITERATE(__v) \
- for (l = dat; l; l = l->next) { \
+ for (l = dat; l; l = eina_list_next(l)) { \
E_Ipc_4Int_2Str *__v; \
- __v = l->data;
+ __v = eina_list_data_get(l);
#define END_INT4_STRING2_LIST(__v) \
END_INT4_STRING2_LIST_ITERATE(__v) \
END_INT4_STRING2_LIST_START()
@@ -512,10 +506,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_4Int_2Str *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_4Int_2Str));
#define END_SEND_INT4_STRING2_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -543,9 +536,9 @@ free(data);
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_5int_2str_list_dec(e->data, e->size, &dat)) {
#define INT5_STRING2_LIST_ITERATE(__v) \
- for (l = dat; l; l = l->next) { \
+ for (l = dat; l; l = eina_list_next(l)) { \
E_Ipc_5Int_2Str *__v; \
- __v = l->data;
+ __v = eina_list_data_get(l);
#define END_INT5_STRING2_LIST(__v) \
END_INT5_STRING2_LIST_ITERATE(__v) \
END_INT5_STRING2_LIST_START()
@@ -574,10 +567,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_5Int_2Str *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_5Int_2Str));
#define END_SEND_INT5_STRING2_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -605,9 +597,9 @@ free(data);
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_3int_4str_list_dec(e->data, e->size, &dat)) {
#define INT3_STRING4_LIST_ITERATE(__v) \
- for (l = dat; l; l = l->next) { \
+ for (l = dat; l; l = eina_list_next(l)) { \
E_Ipc_3Int_4Str *__v; \
- __v = l->data;
+ __v = eina_list_data_get(l);
#define END_INT3_STRING4_LIST(__v) \
END_INT3_STRING4_LIST_ITERATE(__v) \
END_INT3_STRING4_LIST_START()
@@ -638,10 +630,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_3Int_4Str *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_3Int_4Str));
#define END_SEND_INT3_STRING4_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -656,9 +647,8 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_str_4int_list_dec(e->data, e->size, &dat)) { \
- for (l = dat; l; l = l->next) { \
- E_Ipc_Str_4Int *__v; \
- __v = l->data;
+ E_Ipc_Str_4Int *__v; \
+ EINA_LIST_FOREACH(dat, l, __v) {
#define END_STRING_INT4_LIST(__v) \
E_FREE(__v->str); \
free(__v); \
@@ -681,10 +671,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_Str_4Int *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_Str_4Int));
#define END_SEND_STRING_INT4_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -708,9 +697,8 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_2str_int_list_dec(e->data, e->size, &dat)) { \
- for (l = dat; l; l = l->next) { \
- E_Ipc_2Str_Int *__v; \
- __v = l->data;
+ E_Ipc_2Str_Int *__v; \
+ EINA_LIST_FOREACH(dat, l, __v) {
#define END_STRING2_INT_LIST(__v) \
E_FREE(__v->str1); \
E_FREE(__v->str2); \
@@ -734,10 +722,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_2Str_Int *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_2Str_Int));
#define END_SEND_STRING2_INT_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -760,9 +747,8 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
if (e_ipc_codec_2str_list_dec(e->data, e->size, &dat)) { \
- for (l = dat; l; l = l->next) { \
- E_Ipc_2Str *__v; \
- __v = l->data;
+ E_Ipc_2Str *__v; \
+ EINA_LIST_FOREACH(dat, l, __v) {
#define END_STRING2_LIST(__v) \
E_FREE(__v->str1); \
E_FREE(__v->str2); \
@@ -786,10 +772,9 @@ free(data);
case HDL: { \
Eina_List *dat = NULL, *l; \
void *data; int bytes; \
- for (l = __list; l; l = l->next) { \
- __typ1 *__v1; \
+ __typ1 *__v1; \
+ EINA_LIST_FOREACH(__list, l, __v1) { \
E_Ipc_2Str *__v2; \
- __v1 = l->data; \
__v2 = calloc(1, sizeof(E_Ipc_2Str));
#define END_SEND_STRING2_LIST(__v1, __op) \
dat = eina_list_append(dat, __v1); \
@@ -863,7 +848,7 @@ break;
is the pointer to the current position in the list.
*/
#define FOR(__start) \
- for (l = __start; l; l = l->next)
+ for (l = __start; l; l = eina_list_next(l))
#define GENERIC(HDL) \
case HDL: {
@@ -1041,7 +1026,7 @@ break;
E_Response_Module_Data *md;
E_Ipc_Str_Int *v;
- v = l->data;
+ v = eina_list_data_get(l);
md = malloc(sizeof(E_Response_Module_Data));
md->name = v->str;
@@ -1117,7 +1102,7 @@ break;
E_Font_Available *fa;
Eina_List *fa_list;
fa_list = e_font_available_list();
- FOR(fa_list) { fa = l->data;
+ FOR(fa_list) { fa = eina_list_data_get(l);
dat = eina_list_append(dat, fa->name);
}
ENCODE(dat, e_ipc_codec_str_list_enc);
@@ -1139,8 +1124,10 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- if (l->data) printf("REPLY: \"%s\"\n", (char *)(l->data));
- else printf("REPLY: \"\"\n");
+ if (eina_list_data_get(l))
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
+ else
+ printf("REPLY: \"\"\n");
}
FREE_LIST(dat);
}
@@ -1212,7 +1199,7 @@ break;
LIST_ENCODE_START();
E_Font_Fallback *ff;
- FOR(e_config->font_fallbacks) { ff = l->data;
+ FOR(e_config->font_fallbacks) { ff = eina_list_data_get(l);
dat = eina_list_append(dat, ff->name);
}
ENCODE(dat, e_ipc_codec_str_list_enc);
@@ -1234,8 +1221,10 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- if (l->data) printf("REPLY: \"%s\"\n", (char *)(l->data));
- else printf("REPLY: \"\"\n");
+ if (eina_list_data_get(l))
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
+ else
+ printf("REPLY: \"\"\n");
}
FREE_LIST(dat);
}
@@ -1427,8 +1416,10 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- if (l->data) printf("REPLY: \"%s\"\n", (char *)(l->data));
- else printf("REPLY: \"\"\n");
+ if (eina_list_data_get(l))
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
+ else
+ printf("REPLY: \"\"\n");
}
FREE_LIST(dat);
}
@@ -1506,21 +1497,14 @@ break;
E_Path_Dir *p;
if (s) {
dat = eina_list_append(dat, eina_stringshare_add(s));
- FOR(dir_list) { p = l->data;
+ FOR(dir_list) { p = eina_list_data_get(l);
dat = eina_list_append(dat, eina_stringshare_add(p->dir));
}
}
ENCODE(dat, e_ipc_codec_str_list_enc);
SEND_DATA(E_IPC_OP_DIRS_LIST_REPLY);
- while (dat)
- {
- const char *dir;
-
- dir = dat->data;
- eina_stringshare_del(dir);
- dat = eina_list_remove_list(dat, dat);
- }
+ E_FREE_LIST(dat, eina_stringshare_del);
e_path_dir_list_free(dir_list);
END_STRING(s)
#elif (TYPE == E_REMOTE_IN)
@@ -1539,9 +1523,9 @@ break;
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
if (dat == l)
- printf("REPLY Listing for \"%s\"\n", (char *)(l->data));
+ printf("REPLY Listing for \"%s\"\n", (char *)eina_list_data_get(l));
else
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -1566,9 +1550,9 @@ break;
count = 0;
FOR(dat) {
if (dat == l)
- type = l->data;
+ type = eina_list_data_get(l);
else {
- r->dirs[count] = l->data;
+ r->dirs[count] = eina_list_data_get(l);
count++;
}
}
@@ -2207,21 +2191,16 @@ break;
E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64)
E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64)
{
- Eina_List *l;
- for (l = e_manager_list(); l; l = l->next)
+ Eina_List *l, *l2, *l3;
+ E_Manager *man;
+ E_Container *con;
+ E_Zone *zone;
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
- Eina_List *l2;
- man = l->data;
- for (l2 = man->containers; l2; l2 = l2->next)
+ EINA_LIST_FOREACH(man->containers, l2, con)
{
- E_Container *con;
- Eina_List *l3;
- con = l2->data;
- for (l3 = con->zones; l3; l3 = l3->next)
+ EINA_LIST_FOREACH(con->zones, l3, zone)
{
- E_Zone *zone;
- zone = l3->data;
e_zone_desk_count_set(zone,
e_config->zone_desks_x_count,
e_config->zone_desks_y_count);
@@ -4654,7 +4633,7 @@ break;
Eina_List *m = e_manager_list();
int ok = 0;
if (m) {
- E_Manager *man = m->data;
+ E_Manager *man = eina_list_data_get(m);
if (man) {
E_Action *act = e_action_find(actionName);
@@ -5106,7 +5085,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -5230,12 +5209,11 @@ break;
#elif (TYPE == E_WM_IN)
START_INT(val, HDL);
Eina_List *ml;
+ E_Manager *man;
e_config->use_e_cursor = val;
E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1);
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, man)
{
- E_Manager *man;
- man = ml->data;
if (man->pointer) e_object_del(E_OBJECT(man->pointer));
man->pointer = e_pointer_window_new(man->root, 1);
}
@@ -5690,7 +5668,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -6567,7 +6545,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -6601,7 +6579,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -6635,7 +6613,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -6770,7 +6748,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
@@ -7266,7 +7244,7 @@ break;
LIST();
DECODE(e_ipc_codec_str_list_dec) {
FOR(dat) {
- printf("REPLY: \"%s\"\n", (char *)(l->data));
+ printf("REPLY: \"%s\"\n", (char *)eina_list_data_get(l));
}
FREE_LIST(dat);
}
diff --git a/src/bin/e_layout.c b/src/bin/e_layout.c
index 052a725d0..3a1e928ef 100644
--- a/src/bin/e_layout.c
+++ b/src/bin/e_layout.c
@@ -173,7 +173,7 @@ e_layout_child_lower(Evas_Object *obj)
li = evas_object_data_get(obj, "e_layout_data");
if (!li) return;
if (!eina_list_data_find(li->sd->items, obj)) return;
- if ((li->sd->items) && (li->sd->items->next))
+ if ((li->sd->items) && eina_list_next(li->sd->items))
{
li->sd->items = eina_list_remove(li->sd->items, obj);
evas_object_lower(obj);
@@ -189,7 +189,7 @@ e_layout_child_raise(Evas_Object *obj)
li = evas_object_data_get(obj, "e_layout_data");
if (!li) return;
if (!eina_list_data_find(li->sd->items, obj)) return;
- if ((li->sd->items) && (li->sd->items->next))
+ if ((li->sd->items) && eina_list_next(li->sd->items))
{
li->sd->items = eina_list_remove(li->sd->items, obj);
evas_object_raise(obj);
@@ -206,7 +206,7 @@ e_layout_child_lower_below(Evas_Object *obj, Evas_Object *below)
if (!li) return;
if (!eina_list_data_find(li->sd->items, below)) return;
if (!eina_list_data_find(li->sd->items, obj)) return;
- if ((li->sd->items) && (li->sd->items->next))
+ if ((li->sd->items) && eina_list_next(li->sd->items))
{
li->sd->items = eina_list_remove(li->sd->items, obj);
evas_object_stack_below(obj, below);
@@ -223,7 +223,7 @@ e_layout_child_raise_above(Evas_Object *obj, Evas_Object *above)
if (!li) return;
if (!eina_list_data_find(li->sd->items, above)) return;
if (!eina_list_data_find(li->sd->items, obj)) return;
- if ((li->sd->items) && (li->sd->items->next))
+ if ((li->sd->items) && eina_list_next(li->sd->items))
{
li->sd->items = eina_list_remove(li->sd->items, obj);
evas_object_stack_above(obj, above);
@@ -315,6 +315,7 @@ _e_layout_smart_reconfigure(E_Smart_Data *sd)
{
Evas_Coord x, y, w, h;
Eina_List *l;
+ Evas_Object *obj;
if (!sd->changed) return;
@@ -323,12 +324,9 @@ _e_layout_smart_reconfigure(E_Smart_Data *sd)
w = sd->w;
h = sd->h;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Layout_Item *li;
- Evas_Object *obj;
-
- obj = l->data;
li = evas_object_data_get(obj, "e_layout_data");
_e_layout_smart_move_resize_item(li);
}
@@ -406,7 +404,7 @@ _e_layout_smart_del(Evas_Object *obj)
{
Evas_Object *child;
- child = sd->items->data;
+ child = eina_list_data_get(sd->items);
e_layout_unpack(child);
}
evas_object_del(sd->clip);
@@ -417,6 +415,7 @@ static void
_e_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
{
E_Smart_Data *sd;
+ Evas_Object *item;
sd = evas_object_smart_data_get(obj);
if (!sd) return;
@@ -428,12 +427,12 @@ _e_layout_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
dx = x - sd->x;
dy = y - sd->y;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
Evas_Coord ox, oy;
- evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
- evas_object_move(l->data, ox + dx, oy + dy);
+ evas_object_geometry_get(item, &ox, &oy, NULL, NULL);
+ evas_object_move(item, ox + dx, oy + dy);
}
}
sd->x = x;
diff --git a/src/bin/e_main.c b/src/bin/e_main.c
index 69b16448d..1550d5b7f 100644
--- a/src/bin/e_main.c
+++ b/src/bin/e_main.c
@@ -1307,9 +1307,10 @@ static void
_e_main_manage_all(void)
{
Eina_List *l;
+ E_Manager *man;
- for (l = e_manager_list(); l; l = l->next)
- e_manager_manage_windows(l->data);
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
+ e_manager_manage_windows(man);
}
static int
@@ -1499,6 +1500,7 @@ static int
_e_main_cb_idler_before(void *data __UNUSED__)
{
Eina_List *l, *pl;
+ E_Before_Idler *eb;
e_menu_idler_before();
e_focus_idler_before();
@@ -1506,23 +1508,15 @@ _e_main_cb_idler_before(void *data __UNUSED__)
e_popup_idler_before();
e_drag_idler_before();
e_pointer_idler_before();
- for (l = _e_main_idler_before_list; l; l = l->next)
+ EINA_LIST_FOREACH(_e_main_idler_before_list, l, eb)
{
- E_Before_Idler *eb;
-
- eb = l->data;
if (!eb->delete_me)
{
if (!eb->func(eb->data)) eb->delete_me = 1;
}
}
- for (l = _e_main_idler_before_list; l;)
+ EINA_LIST_FOREACH_SAFE(_e_main_idler_before_list, pl, l, eb)
{
- E_Before_Idler *eb;
-
- eb = l->data;
- pl = l;
- l = l->next;
if ((eb->once) || (eb->delete_me))
{
_e_main_idler_before_list =
@@ -1574,25 +1568,21 @@ static void
_e_main_desk_save(void)
{
Eina_List *ml;
+ E_Manager *man;
char env[1024], name[1024];
- for (ml = e_manager_list(); ml; ml = ml->next)
+ EINA_LIST_FOREACH(e_manager_list(), ml, man)
{
- E_Manager *man;
Eina_List *cl;
+ E_Container *con;
- man = ml->data;
- for (cl = man->containers; cl; cl = cl->next)
+ EINA_LIST_FOREACH(man->containers, cl, con)
{
- E_Container *con;
Eina_List *zl;
+ E_Zone *zone;
- con = cl->data;
- for (zl = con->zones; zl; zl = zl->next)
+ EINA_LIST_FOREACH(con->zones, zl, zone)
{
- E_Zone *zone;
-
- zone = zl->data;
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
snprintf(env, sizeof(env), "%d,%d", zone->desk_x_current, zone->desk_y_current);
e_util_env_set(name, env);
@@ -1605,16 +1595,15 @@ static void
_e_main_desk_restore(E_Manager *man, E_Container *con)
{
Eina_List *zl;
+ E_Zone *zone;
char *env;
char name[1024];
- for (zl = con->zones; zl; zl = zl->next)
+ EINA_LIST_FOREACH(con->zones, zl, zone)
{
- E_Zone *zone;
E_Desk *desk;
int desk_x, desk_y;
- zone = zl->data;
snprintf(name, sizeof(name), "DESK_%d_%d_%d", man->num, con->num, zone->num);
env = getenv(name);
if (!env) continue;
diff --git a/src/bin/e_manager.c b/src/bin/e_manager.c
index ce8de39bf..1c4e8a3d7 100644
--- a/src/bin/e_manager.c
+++ b/src/bin/e_manager.c
@@ -59,10 +59,7 @@ e_manager_init(void)
EAPI int
e_manager_shutdown(void)
{
- E_Manager *man;
-
- EINA_LIST_FREE(managers, man)
- e_object_del(E_OBJECT(man));
+ E_FREE_LIST(managers, e_object_del);
if (frame_extents)
{
@@ -323,15 +320,13 @@ EAPI void
e_manager_show(E_Manager *man)
{
Eina_List *l;
+ E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (man->visible) return;
- for (l = man->containers; l; l = l->next)
+ EINA_LIST_FOREACH(man->containers, l, con)
{
- E_Container *con;
-
- con = l->data;
e_container_show(con);
}
if (man->root != man->win)
@@ -357,15 +352,13 @@ EAPI void
e_manager_hide(E_Manager *man)
{
Eina_List *l;
+ E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
if (!man->visible) return;
- for (l = man->containers; l; l = l->next)
+ EINA_LIST_FOREACH(man->containers, l, con)
{
- E_Container *con;
-
- con = l->data;
e_container_hide(con);
}
if (man->root != man->win)
@@ -391,6 +384,7 @@ EAPI void
e_manager_resize(E_Manager *man, int w, int h)
{
Eina_List *l;
+ E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
@@ -400,11 +394,8 @@ e_manager_resize(E_Manager *man, int w, int h)
if (man->root != man->win)
ecore_x_window_resize(man->win, man->w, man->h);
- for (l = man->containers; l; l = l->next)
+ EINA_LIST_FOREACH(man->containers, l, con)
{
- E_Container *con;
-
- con = l->data;
e_container_resize(con, man->w, man->h);
}
@@ -415,6 +406,7 @@ EAPI void
e_manager_move_resize(E_Manager *man, int x, int y, int w, int h)
{
Eina_List *l;
+ E_Container *con;
E_OBJECT_CHECK(man);
E_OBJECT_TYPE_CHECK(man, E_MANAGER_TYPE);
@@ -428,11 +420,8 @@ e_manager_move_resize(E_Manager *man, int x, int y, int w, int h)
man->h = h;
ecore_x_window_move_resize(man->win, man->x, man->y, man->w, man->h);
- for (l = man->containers; l; l = l->next)
+ EINA_LIST_FOREACH(man->containers, l, con)
{
- E_Container *con;
-
- con = l->data;
e_container_resize(con, man->w, man->h);
}
}
@@ -476,16 +465,15 @@ e_manager_current_get(void)
int x, y;
if (!managers) return NULL;
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- man = l->data;
ecore_x_pointer_xy_get(man->win, &x, &y);
if (x == -1 && y == -1)
continue;
if (E_INSIDE(x, y, man->x, man->y, man->w, man->h))
return man;
}
- return managers->data;
+ return eina_list_data_get(managers);
}
EAPI E_Manager *
@@ -495,9 +483,8 @@ e_manager_number_get(int num)
E_Manager *man;
if (!managers) return NULL;
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- man = l->data;
if (man->num == num)
return man;
}
@@ -508,12 +495,10 @@ EAPI void
e_managers_keys_grab(void)
{
Eina_List *l;
+ E_Manager *man;
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- E_Manager *man;
-
- man = l->data;
e_bindings_key_grab(E_BINDING_CONTEXT_ANY, man->root);
}
}
@@ -522,12 +507,10 @@ EAPI void
e_managers_keys_ungrab(void)
{
Eina_List *l;
+ E_Manager *man;
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- E_Manager *man;
-
- man = l->data;
e_bindings_key_ungrab(E_BINDING_CONTEXT_ANY, man->root);
}
}
@@ -538,21 +521,10 @@ _e_manager_free(E_Manager *man)
{
Eina_List *l;
- while (man->handlers)
- {
- Ecore_Event_Handler *h;
-
- h = man->handlers->data;
- man->handlers = eina_list_remove_list(man->handlers, man->handlers);
- ecore_event_handler_del(h);
- }
+ E_FREE_LIST(man->handlers, ecore_event_handler_del);
l = man->containers;
man->containers = NULL;
- while (l)
- {
- e_object_del(E_OBJECT(l->data));
- l = eina_list_remove_list(l, l);
- }
+ E_FREE_LIST(l, e_object_del);
if (man->root != man->win)
{
ecore_x_window_free(man->win);
@@ -903,13 +875,12 @@ _e_manager_get_for_root(Ecore_X_Window root)
E_Manager *man;
if (!managers) return NULL;
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- man = l->data;
if (man->root == root)
return man;
}
- return managers->data;
+ return eina_list_data_get(managers);
}
diff --git a/src/bin/e_maximize.c b/src/bin/e_maximize.c
index 24ff1e77f..82111f53d 100644
--- a/src/bin/e_maximize.c
+++ b/src/bin/e_maximize.c
@@ -128,23 +128,20 @@ EAPI void
e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir)
{
Eina_List *l, *rects = NULL;
+ E_Shelf *es;
E_Maximize_Rect *r;
- for (l = e_shelf_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
- E_Shelf *es;
Eina_List *ll;
+ E_Config_Shelf_Desk *sd;
- es = l->data;
if (es->cfg->overlap) continue;
if (es->zone != bd->zone) continue;
if (es->cfg->desk_show_mode)
{
- for (ll = es->cfg->desk_list; ll; ll = ll->next)
+ EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
{
- E_Config_Shelf_Desk *sd;
-
- sd = ll->data;
if (!sd) continue;
if ((sd->x == bd->desk->x) && (sd->y == bd->desk->y))
{
@@ -163,16 +160,14 @@ e_maximize_border_shelf_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E
if (rects)
{
_e_maximize_border_rects_fill(bd, rects, x1, y1, x2, y2, dir);
- for (l = rects; l; l = l->next)
- free(l->data);
- eina_list_free(rects);
+ E_FREE_LIST(rects, free);
}
}
EAPI void
e_maximize_border_border_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2, E_Maximize dir)
{
- Eina_List *l, *rects = NULL;
+ Eina_List *rects = NULL;
E_Border_List *bl;
E_Maximize_Rect *r;
E_Border *bd2;
@@ -188,9 +183,7 @@ e_maximize_border_border_fill(E_Border *bd, int *x1, int *y1, int *x2, int *y2,
if (rects)
{
_e_maximize_border_rects_fill(bd, rects, x1, y1, x2, y2, dir);
- for (l = rects; l; l = l->next)
- free(l->data);
- eina_list_free(rects);
+ E_FREE_LIST(rects, free);
}
}
@@ -273,6 +266,7 @@ static void
_e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int *x2, int *bx, int *by, int *bw, int *bh)
{
Eina_List *l;
+ E_Maximize_Rect *rect;
int cx1, cx2;
cx1 = bd->zone->x;
@@ -282,11 +276,8 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
if (x2) cx2 = *x2;
/* Expand left */
- for (l = rects; l; l = l->next)
+ EINA_LIST_FOREACH(rects, l, rect)
{
- E_Maximize_Rect *rect;
-
- rect = l->data;
if ((rect->x2 > cx1) && (rect->x2 <= *bx) &&
E_INTERSECTS(0, rect->y1, bd->zone->w, (rect->y2 - rect->y1), 0, *by, bd->zone->w, *bh))
{
@@ -297,11 +288,8 @@ _e_maximize_border_rects_fill_horiz(E_Border *bd, Eina_List *rects, int *x1, int
*bx = cx1;
/* Expand right */
- for (l = rects; l; l = l->next)
+ EINA_LIST_FOREACH(rects, l, rect)
{
- E_Maximize_Rect *rect;
-
- rect = l->data;
if ((rect->x1 < cx2) && (rect->x1 >= (*bx + *bw)) &&
E_INTERSECTS(0, rect->y1, bd->zone->w, (rect->y2 - rect->y1), 0, *by, bd->zone->w, *bh))
{
@@ -318,6 +306,7 @@ static void
_e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *y1, int *y2, int *bx, int *by, int *bw, int *bh)
{
Eina_List *l;
+ E_Maximize_Rect *rect;
int cy1, cy2;
cy1 = bd->zone->y;
@@ -327,11 +316,8 @@ _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *y1, int
if (y2) cy2 = *y2;
/* Expand up */
- for (l = rects; l; l = l->next)
+ EINA_LIST_FOREACH(rects, l, rect)
{
- E_Maximize_Rect *rect;
-
- rect = l->data;
if ((rect->y2 > cy1) && (rect->y2 <= *by) &&
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h))
{
@@ -342,11 +328,8 @@ _e_maximize_border_rects_fill_vert(E_Border *bd, Eina_List *rects, int *y1, int
*by = cy1;
/* Expand down */
- for (l = rects; l; l = l->next)
+ EINA_LIST_FOREACH(rects, l, rect)
{
- E_Maximize_Rect *rect;
-
- rect = l->data;
if ((rect->y1 < cy2) && (rect->y1 >= (*by + *bh)) &&
E_INTERSECTS(rect->x1, 0, (rect->x2 - rect->x1), bd->zone->h, *bx, 0, *bw, bd->zone->h))
{
diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c
index 7cbbbfd8f..221bb4045 100644
--- a/src/bin/e_menu.c
+++ b/src/bin/e_menu.c
@@ -155,6 +155,8 @@ e_menu_init(void)
EAPI int
e_menu_shutdown(void)
{
+ E_Menu *m;
+
E_FN_DEL(ecore_event_handler_del, _e_menu_key_down_handler);
E_FN_DEL(ecore_event_handler_del, _e_menu_key_up_handler);
E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_down_handler);
@@ -163,16 +165,10 @@ e_menu_shutdown(void)
E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_wheel_handler);
E_FN_DEL(ecore_event_handler_del, _e_menu_window_shape_handler);
- while (_e_active_menus)
+ EINA_LIST_FREE(_e_active_menus, m)
{
- E_Menu *m;
-
- m = _e_active_menus->data;
m->active = 0;
_e_menu_unrealize(m);
- _e_active_menus =
- eina_list_remove_list(_e_active_menus, _e_active_menus);
-
m->in_active_list = 0;
e_object_unref(E_OBJECT(m));
}
@@ -1957,19 +1953,15 @@ _e_menu_item_activate_next(void)
{
/* Look at the next item and then cycle until we're not on
* a separator. */
- if (!(ll->next))
- ll = mi->menu->items;
- else
- ll = ll->next;
- mi = ll->data;
- while (mi->separator || mi->disable)
+ do
{
- if (!(ll->next))
+ if (!eina_list_next(ll))
ll = mi->menu->items;
else
- ll = ll->next;
- mi = ll->data;
+ ll = eina_list_next(ll);
+ mi = eina_list_data_get(ll);
}
+ while (mi->separator || mi->disable);
e_menu_item_active_set(mi, 1);
_e_menu_item_ensure_onscreen(mi);
@@ -1991,19 +1983,15 @@ _e_menu_item_activate_previous(void)
{
/* Look at the prev item and then cycle until we're not on
* a separator. */
- if (!(ll->prev))
- ll = eina_list_last(ll);
- else
- ll = ll->prev;
- mi = ll->data;
- while (mi->separator || mi->disable)
+ do
{
- if (!(ll->prev))
+ if (!eina_list_prev(ll))
ll = eina_list_last(ll);
else
- ll = ll->prev;
- mi = ll->data;
+ ll = eina_list_prev(ll);
+ mi = eina_list_data_get(ll);
}
+ while (mi->separator || mi->disable);
e_menu_item_active_set(mi, 1);
_e_menu_item_ensure_onscreen(mi);
@@ -2024,11 +2012,11 @@ _e_menu_item_activate_first(void)
if (m)
{
ll = m->items;
- mi = ll->data;
- while ((mi->separator) && (ll->next))
+ mi = eina_list_data_get(ll);
+ while ((mi->separator) && eina_list_next(ll))
{
- ll = ll->next;
- mi = ll->data;
+ ll = eina_list_next(ll);
+ mi = eina_list_data_get(ll);
}
if (mi->separator) return;
e_menu_item_active_set(mi, 1);
@@ -2049,11 +2037,11 @@ _e_menu_item_activate_last(void)
if (m)
{
ll = eina_list_last(m->items);
- mi = ll->data;
- while ((mi->separator) && (ll->prev))
+ mi = eina_list_data_get(ll);
+ while ((mi->separator) && eina_list_prev(ll))
{
- ll = ll->prev;
- mi = ll->data;
+ ll = eina_list_prev(ll);
+ mi = eina_list_data_get(ll);
}
if (mi->separator) return;
e_menu_item_active_set(mi, 1);
@@ -2103,7 +2091,7 @@ _e_menu_item_activate_char(const char * key_compose)
if (!m)
{
if (!_e_active_menus) return;
- m = _e_active_menus->data;
+ m = eina_list_data_get(_e_active_menus);
if (!m) return;
}
@@ -2112,7 +2100,7 @@ _e_menu_item_activate_char(const char * key_compose)
if (!ll)
{
ll = m->items;
- mi = ll->data;
+ mi = eina_list_data_get(ll);
/* Only check the current item if it wasn't active before. */
if (!mi->separator && mi->label && !strncasecmp(key_compose, mi->label, strlen(key_compose)))
{
@@ -2124,32 +2112,27 @@ _e_menu_item_activate_char(const char * key_compose)
ll_orig = ll;
- mi = ll->data;
- if (!(ll->next))
+ mi = eina_list_data_get(ll);
+ if (!eina_list_next(ll))
ll = mi->menu->items;
else
- ll = ll->next;
- mi = ll->data;
+ ll = eina_list_next(ll);
+ mi = eina_list_data_get(ll);
/* While we don't have a label OR we don't match AND we haven't
* wrapped around */
while ((!mi->label || strncasecmp(key_compose, mi->label, strlen(key_compose)))
&& ll != ll_orig)
{
- if (!(ll->next))
- ll = mi->menu->items;
- else
- ll = ll->next;
- mi = ll->data;
-
- while (mi->separator)
- {
- if (!(ll->next))
- ll = mi->menu->items;
- else
- ll = ll->next;
- mi = ll->data;
+ do
+ {
+ if (!eina_list_next(ll))
+ ll = mi->menu->items;
+ else
+ ll = eina_list_next(ll);
+ mi = eina_list_data_get(ll);
}
+ while (mi->separator);
}
e_menu_item_active_set(mi, 1);
@@ -2169,7 +2152,7 @@ _e_menu_activate_next(void)
{
if (mi->submenu->items)
{
- mi = mi->submenu->items->data;
+ mi = eina_list_data_get(mi->submenu->items);
e_menu_item_active_set(mi, 1);
_e_menu_item_ensure_onscreen(mi);
}
@@ -2206,14 +2189,14 @@ _e_menu_activate_first(void)
Eina_List *ll;
if (!_e_active_menus) return;
- m = _e_active_menus->data;
+ m = eina_list_data_get(_e_active_menus);
if (!m->items) return;
ll = m->items;
- mi = ll->data;
- while ((mi->separator) && (ll->next))
+ mi = eina_list_data_get(ll);
+ while ((mi->separator) && eina_list_next(ll))
{
- ll = ll->next;
- mi = ll->data;
+ ll = eina_list_next(ll);
+ mi = eina_list_data_get(ll);
}
if (mi->separator) return;
e_menu_item_active_set(mi, 1);
@@ -2228,14 +2211,14 @@ _e_menu_activate_last(void)
Eina_List *ll;
if (!_e_active_menus) return;
- m = _e_active_menus->data;
+ m = eina_list_data_get(_e_active_menus);
if (!m->items) return;
ll = eina_list_last(m->items);
- mi = ll->data;
- while ((mi->separator) && (ll->prev))
+ mi = eina_list_data_get(ll);
+ while ((mi->separator) && eina_list_prev(ll))
{
- ll = ll->prev;
- mi = ll->data;
+ ll = eina_list_prev(ll);
+ mi = eina_list_data_get(ll);
}
if (mi->separator) return;
e_menu_item_active_set(mi, 1);
@@ -2380,7 +2363,7 @@ _e_menu_mouse_autoscroll_check(void)
{
E_Menu *m;
- m = _e_active_menus->data;
+ m = eina_list_data_get(_e_active_menus);
if (_e_menu_x + e_config->menu_autoscroll_cursor_margin >= (m->zone->w - 1))
{
if (_e_menu_outside_bounds_get(1, 0)) autoscroll_x = 1;
diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index 99dd8b4c0..682c39eb5 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -101,6 +101,7 @@ e_module_new(const char *name)
const char *modpath;
char *s;
Eina_List *l;
+ E_Config_Module *em;
int in_list = 0;
if (!name) return NULL;
@@ -199,11 +200,9 @@ init_done:
}
}
}
- for (l = e_config->modules; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->modules, l, em)
{
- E_Config_Module *em;
-
- if (!(em = l->data)) continue;
+ if (!em) continue;
if (!e_util_strcmp(em->name, m->name))
{
in_list = 1;
@@ -408,12 +407,10 @@ EAPI void
e_module_delayed_set(E_Module *m, int delayed)
{
Eina_List *l;
+ E_Config_Module *em;
- for (l = e_config->modules; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->modules, l, em)
{
- E_Config_Module *em;
-
- em = l->data;
if (!em) continue;
if (!e_util_strcmp(m->name, em->name))
{
@@ -433,12 +430,11 @@ e_module_priority_set(E_Module *m, int priority)
/* Set the loading order for a module.
More priority means load earlier */
Eina_List *l;
+ E_Config_Module *em;
- for (l = e_config->modules; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->modules, l, em)
{
- E_Config_Module *em;
-
- if (!(em = l->data)) continue;
+ if (!em) continue;
if (!e_util_strcmp(m->name, em->name))
{
if (em->priority != priority)
@@ -535,7 +531,7 @@ _e_module_cb_idler(void *data)
const char *name;
E_Module *m;
- name = _e_modules_delayed->data;
+ name = eina_list_data_get(_e_modules_delayed);
_e_modules_delayed = eina_list_remove_list(_e_modules_delayed, _e_modules_delayed);
m = NULL;
if (name) m = e_module_new(name);
diff --git a/src/bin/e_msg.c b/src/bin/e_msg.c
index 3ff08e51a..d2ec504cf 100644
--- a/src/bin/e_msg.c
+++ b/src/bin/e_msg.c
@@ -43,7 +43,7 @@ e_msg_init(void)
EAPI int
e_msg_shutdown(void)
{
- while (handlers) e_msg_handler_del(handlers->data);
+ while (handlers) e_msg_handler_del(eina_list_data_get(handlers));
E_EVENT_MSG = 0;
if (hand) ecore_event_handler_del(hand);
hand = NULL;
@@ -115,25 +115,19 @@ _e_msg_event_cb(void *data, int ev_type, void *ev)
{
E_Msg_Event *e;
Eina_List *l;
+ E_Msg_Handler *emsgh;
processing_handlers++;
e = ev;
- for (l = handlers; l; l = l->next)
+ EINA_LIST_FOREACH(handlers, l, emsgh)
{
- E_Msg_Handler *emsgh;
-
- emsgh = l->data;
if (!emsgh->delete_me)
emsgh->func(emsgh->data, e->name, e->info, e->val, e->obj);
}
processing_handlers--;
if ((processing_handlers == 0) && (del_handlers))
{
- while (del_handlers)
- {
- e_msg_handler_del(del_handlers->data);
- del_handlers = eina_list_remove_list(del_handlers, del_handlers);
- }
+ E_FREE_LIST(del_handlers, e_msg_handler_del);
}
return 1;
}
diff --git a/src/bin/e_msgbus.c b/src/bin/e_msgbus.c
index 84591fd3e..4314cfdc4 100644
--- a/src/bin/e_msgbus.c
+++ b/src/bin/e_msgbus.c
@@ -216,8 +216,8 @@ _e_msgbus_module_disable_cb(E_DBus_Object *obj, DBusMessage *msg)
static DBusMessage*
_e_msgbus_module_list_cb(E_DBus_Object *obj, DBusMessage *msg)
{
- Eina_List *mod_list;
- Eina_List * l;
+ Eina_List *l;
+ E_Module *mod;
DBusMessage *reply;
DBusMessageIter iter;
DBusMessageIter arr;
@@ -226,16 +226,12 @@ _e_msgbus_module_list_cb(E_DBus_Object *obj, DBusMessage *msg)
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "(si)", &arr);
- mod_list = e_module_list();
-
- for (l = mod_list; l; l = l->next)
+ EINA_LIST_FOREACH(e_module_list(), l, mod)
{
DBusMessageIter sub;
- E_Module *mod;
const char *name;
int enabled;
- mod = l->data;
name = mod->name;
enabled = mod->enabled;
dbus_message_iter_open_container(&arr, DBUS_TYPE_STRUCT, NULL, &sub);
@@ -286,8 +282,8 @@ _e_msgbus_profile_get_cb(E_DBus_Object *obj, DBusMessage *msg)
static DBusMessage*
_e_msgbus_profile_list_cb(E_DBus_Object *obj, DBusMessage *msg)
{
- Eina_List *profiles;
- Eina_List * l;
+ Eina_List *l;
+ const char *name;
DBusMessage *reply;
DBusMessageIter iter;
DBusMessageIter arr;
@@ -296,13 +292,8 @@ _e_msgbus_profile_list_cb(E_DBus_Object *obj, DBusMessage *msg)
dbus_message_iter_init_append(reply, &iter);
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, "s", &arr);
- profiles = e_config_profile_list();
-
- for (l = profiles; l; l = l->next)
+ EINA_LIST_FOREACH(e_config_profile_list(), l, name)
{
- const char *name;
-
- name = l->data;
dbus_message_iter_append_basic(&arr, DBUS_TYPE_STRING, &name);
}
dbus_message_iter_close_container(&iter, &arr);
diff --git a/src/bin/e_object.c b/src/bin/e_object.c
index 3d7c12b53..6457ea6fd 100644
--- a/src/bin/e_object.c
+++ b/src/bin/e_object.c
@@ -287,13 +287,14 @@ void
e_object_breadcrumb_del(E_Object *obj, char *crumb)
{
Eina_List *l;
+ char *key;
E_OBJECT_CHECK(obj);
- for (l = obj->crumbs; l; l = l->next)
+ EINA_LIST_FOREACH(obj->crumbs, l, key)
{
- if (!strcmp(crumb, l->data))
+ if (!strcmp(crumb, key))
{
- free(l->data);
+ free(key);
obj->crumbs = eina_list_remove_list(obj->crumbs, l);
return;
}
@@ -304,10 +305,11 @@ void
e_object_breadcrumb_debug(E_Object *obj)
{
Eina_List *l;
+ char *key;
E_OBJECT_CHECK(obj);
- for (l = obj->crumbs; l; l = l->next)
- printf("CRUMB: %s\n", l->data);
+ EINA_LISt_FOREACH(obj->crumbs, l, key)
+ printf("CRUMB: %s\n", key);
}
*/
diff --git a/src/bin/e_order.c b/src/bin/e_order.c
index 0dd74ee50..9ed21ee89 100644
--- a/src/bin/e_order.c
+++ b/src/bin/e_order.c
@@ -30,11 +30,7 @@ e_order_shutdown(void)
{
orders = eina_list_free(orders);
- while (handlers)
- {
- ecore_event_handler_del(handlers->data);
- handlers = eina_list_remove_list(handlers, handlers);
- }
+ E_FREE_LIST(handlers, ecore_event_handler_del);
return 1;
}
@@ -75,7 +71,7 @@ e_order_remove(E_Order *eo, Efreet_Desktop *desktop)
tmp = eina_list_data_find_list(eo->desktops, desktop);
if (!tmp) return;
- efreet_desktop_free(tmp->data);
+ efreet_desktop_free(eina_list_data_get(tmp));
eo->desktops = eina_list_remove_list(eo->desktops, tmp);
_e_order_save(eo);
}
@@ -106,16 +102,15 @@ EAPI void
e_order_files_append(E_Order *eo, Eina_List *files)
{
Eina_List *l;
+ const char *file;
E_OBJECT_CHECK(eo);
E_OBJECT_TYPE_CHECK(eo, E_ORDER_TYPE);
- for (l = files; l ; l = l->next)
+ EINA_LIST_FOREACH(files, l, file)
{
Efreet_Desktop *desktop;
- const char *file;
- file = l->data;
desktop = efreet_desktop_get(file);
if (!desktop) continue;
eo->desktops = eina_list_append(eo->desktops, desktop);
@@ -127,16 +122,15 @@ EAPI void
e_order_files_prepend_relative(E_Order *eo, Eina_List *files, Efreet_Desktop *before)
{
Eina_List *l;
+ const char *file;
E_OBJECT_CHECK(eo);
E_OBJECT_TYPE_CHECK(eo, E_ORDER_TYPE);
- for (l = files; l ; l = l->next)
+ EINA_LIST_FOREACH(files, l, file)
{
Efreet_Desktop *desktop;
- const char *file;
- file = l->data;
desktop = efreet_desktop_get(file);
if (!desktop) continue;
eo->desktops = eina_list_prepend_relative(eo->desktops, desktop, before);
@@ -150,11 +144,7 @@ e_order_clear(E_Order *eo)
E_OBJECT_CHECK(eo);
E_OBJECT_TYPE_CHECK(eo, E_ORDER_TYPE);
- while (eo->desktops)
- {
- efreet_desktop_free(eo->desktops->data);
- eo->desktops = eina_list_remove_list(eo->desktops, eo->desktops);
- }
+ E_FREE_LIST(eo->desktops, efreet_desktop_free);
_e_order_save(eo);
}
@@ -162,11 +152,7 @@ e_order_clear(E_Order *eo)
static void
_e_order_free(E_Order *eo)
{
- while (eo->desktops)
- {
- efreet_desktop_free(eo->desktops->data);
- eo->desktops = eina_list_remove_list(eo->desktops, eo->desktops);
- }
+ E_FREE_LIST(eo->desktops, efreet_desktop_free);
if (eo->path) eina_stringshare_del(eo->path);
if (eo->monitor) ecore_file_monitor_del(eo->monitor);
orders = eina_list_remove(orders, eo);
@@ -191,11 +177,7 @@ _e_order_read(E_Order *eo)
FILE *f;
char *dir;
- while (eo->desktops)
- {
- efreet_desktop_free(eo->desktops->data);
- eo->desktops = eina_list_remove_list(eo->desktops, eo->desktops);
- }
+ E_FREE_LIST(eo->desktops, efreet_desktop_free);
if (!eo->path) return;
dir = ecore_file_dir_get(eo->path);
@@ -245,17 +227,16 @@ _e_order_save(E_Order *eo)
{
FILE *f;
Eina_List *l;
+ Efreet_Desktop *desktop;
if (!eo->path) return;
f = fopen(eo->path, "wb");
if (!f) return;
- for (l = eo->desktops; l; l = l->next)
+ EINA_LIST_FOREACH(eo->desktops, l, desktop)
{
- Efreet_Desktop *desktop;
const char *id;
- desktop = l->data;
id = efreet_util_path_to_file_id(desktop->orig_path);
if (id)
{
@@ -275,35 +256,32 @@ _e_order_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
{
Efreet_Event_Desktop_Change *event;
Eina_List *l;
+ E_Order *eo;
event = ev;
switch (event->change)
{
case EFREET_DESKTOP_CHANGE_ADD:
/* If a desktop is added, reread all .order files */
- for (l = orders; l; l = l->next)
+ EINA_LIST_FOREACH(orders, l, eo)
{
- E_Order *eo;
-
- eo = l->data;
_e_order_read(eo);
if (eo->cb.update) eo->cb.update(eo->cb.data, eo);
}
break;
case EFREET_DESKTOP_CHANGE_REMOVE:
/* If a desktop is removed, drop the .desktop pointer */
- for (l = orders; l; l = l->next)
+ EINA_LIST_FOREACH(orders, l, eo)
{
- E_Order *eo;
Eina_List *l2;
+ Efreet_Desktop *desktop;
int changed = 0;
- eo = l->data;
- for (l2 = eo->desktops; l2; l2 = l2->next)
+ EINA_LIST_FOREACH(eo->desktops, l2, desktop)
{
- if (l2->data == event->current)
+ if (desktop == event->current)
{
- efreet_desktop_free(l2->data);
+ efreet_desktop_free(desktop);
eo->desktops = eina_list_remove_list(eo->desktops, l2);
changed = 1;
}
@@ -313,18 +291,17 @@ _e_order_cb_efreet_desktop_change(void *data, int ev_type, void *ev)
break;
case EFREET_DESKTOP_CHANGE_UPDATE:
/* If a desktop is updated, point to the new desktop and update */
- for (l = orders; l; l = l->next)
+ EINA_LIST_FOREACH(orders, l, eo)
{
- E_Order *eo;
Eina_List *l2;
+ Efreet_Desktop *desktop;
int changed = 0;
- eo = l->data;
- for (l2 = eo->desktops; l2; l2 = l2->next)
+ EINA_LIST_FOREACH(eo->desktops, l2, desktop)
{
- if (l2->data == event->previous)
+ if (desktop == event->previous)
{
- efreet_desktop_free(l2->data);
+ efreet_desktop_free(desktop);
efreet_desktop_ref(event->current);
l2->data = event->current;
changed = 1;
diff --git a/src/bin/e_path.c b/src/bin/e_path.c
index 801199d5b..df8a39ccf 100644
--- a/src/bin/e_path.c
+++ b/src/bin/e_path.c
@@ -161,6 +161,7 @@ EAPI void
e_path_user_path_remove(E_Path *ep, const char *path)
{
Eina_List *l;
+ E_Path_Dir *epd;
E_OBJECT_CHECK(ep);
E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
@@ -178,11 +179,8 @@ e_path_user_path_remove(E_Path *ep, const char *path)
if (!new_path) return;
strcpy(new_path, home_dir);
strcat(new_path, path + 1);
- for (l = *(ep->user_dir_list); l; l = l->next)
+ EINA_LIST_FOREACH(*(ep->user_dir_list), l, epd)
{
- E_Path_Dir *epd;
-
- epd = l->data;
if (epd->dir)
{
if (!strcmp(epd->dir, new_path))
@@ -201,10 +199,8 @@ e_path_user_path_remove(E_Path *ep, const char *path)
}
else
{
- for (l = *(ep->user_dir_list); l; l = l->next)
+ EINA_LIST_FOREACH(*(ep->user_dir_list), l, epd)
{
- E_Path_Dir *epd;
- epd = l->data;
if (epd->dir)
{
if (!strcmp(epd->dir, path))
@@ -223,12 +219,10 @@ e_path_user_path_remove(E_Path *ep, const char *path)
EAPI void
e_path_user_path_clear(E_Path *ep)
-{
- while (*(ep->user_dir_list))
+{
+ E_Path_Dir *epd;
+ EINA_LIST_FREE(*(ep->user_dir_list), epd)
{
- E_Path_Dir *epd;
- epd = (*(ep->user_dir_list))->data;
- *(ep->user_dir_list) = eina_list_remove_list(*(ep->user_dir_list), *(ep->user_dir_list));
eina_stringshare_del(epd->dir);
free(epd);
}
@@ -268,11 +262,8 @@ e_path_find(E_Path *ep, const char *file)
}
}
/* Look in the users dir list */
- for (l = *(ep->user_dir_list); l; l = l->next)
+ EINA_LIST_FOREACH(*(ep->user_dir_list), l, epd)
{
- E_Path_Dir *epd;
-
- epd = l->data;
if (epd->dir)
{
snprintf(buf, sizeof(buf), "%s/%s", epd->dir, file);
@@ -294,8 +285,8 @@ e_path_find(E_Path *ep, const char *file)
EAPI void
e_path_evas_append(E_Path *ep, Evas *evas)
{
- Eina_List *l;
Eina_List *dir_list;
+ E_Path_Dir *epd;
E_OBJECT_CHECK(ep);
E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
@@ -303,16 +294,12 @@ e_path_evas_append(E_Path *ep, Evas *evas)
dir_list = e_path_dir_list_get(ep);
- for (l = dir_list; l; l = l->next)
+ EINA_LIST_FREE(dir_list, epd)
{
- E_Path_Dir *epd;
-
- epd = l->data;
if (epd->dir) evas_font_path_append(evas, epd->dir);
eina_stringshare_del(epd->dir);
free(epd);
}
- if (dir_list) eina_list_free(dir_list);
}
/* combine default_list and and user_list in and easy to use list */
@@ -328,18 +315,16 @@ e_path_dir_list_get(E_Path *ep)
if (ep->user_dir_list)
{
- for (l = *(ep->user_dir_list); l; l = l->next)
+ EINA_LIST_FOREACH(*(ep->user_dir_list), l, epd)
{
- epd = l->data;
new_epd = malloc(sizeof(E_Path_Dir));
new_epd->dir = eina_stringshare_add(epd->dir);
dir_list = eina_list_append(dir_list, new_epd);
}
}
- for (l = ep->default_dir_list; l; l = l->next)
+ EINA_LIST_FOREACH(ep->default_dir_list, l, epd)
{
- epd = l->data;
new_epd = malloc(sizeof(E_Path_Dir));
new_epd->dir = eina_stringshare_add(epd->dir);
dir_list = eina_list_append(dir_list, new_epd);
@@ -353,10 +338,8 @@ e_path_dir_list_free(Eina_List *dir_list)
{
E_Path_Dir *epd;
- while (dir_list)
+ EINA_LIST_FREE(dir_list, epd)
{
- epd = dir_list->data;
- dir_list = eina_list_remove_list(dir_list, dir_list);
eina_stringshare_del(epd->dir);
free(epd);
}
@@ -366,15 +349,13 @@ e_path_dir_list_free(Eina_List *dir_list)
static void
_e_path_free(E_Path *ep)
{
+ E_Path_Dir *epd;
+
_e_path_cache_free(ep);
- while (ep->default_dir_list)
+ EINA_LIST_FREE(ep->default_dir_list, epd)
{
- E_Path_Dir *epd;
- epd = ep->default_dir_list->data;
eina_stringshare_del(epd->dir);
free(epd);
- ep->default_dir_list = eina_list_remove_list(ep->default_dir_list,
- ep->default_dir_list);
}
free(ep);
}
diff --git a/src/bin/e_place.c b/src/bin/e_place.c
index e22fcc89b..1e9f9abac 100644
--- a/src/bin/e_place.c
+++ b/src/bin/e_place.c
@@ -22,15 +22,14 @@ e_place_zone_region_smart_cleanup(E_Zone *zone)
{
int area;
Eina_List *ll;
+ E_Border *bd;
/* Ordering windows largest to smallest gives better results */
area = border->w * border->h;
- for (ll = borders; ll; ll = ll->next)
+ EINA_LIST_FOREACH(borders, ll, bd)
{
int testarea;
- E_Border *bd;
- bd = ll->data;
testarea = bd->w * bd->h;
/* Insert the border if larger than the current border */
if (area >= testarea)
@@ -46,15 +45,13 @@ e_place_zone_region_smart_cleanup(E_Zone *zone)
e_container_border_list_free(bl);
/* Loop over the borders moving each one using the smart placement */
- while (borders)
+ EINA_LIST_FREE(borders, border)
{
int new_x, new_y;
- border = borders->data;
e_place_zone_region_smart(zone, borders, border->x, border->y,
border->w, border->h, &new_x, &new_y);
e_border_move(border, new_x, new_y);
- borders = eina_list_remove(borders, border);
}
}
@@ -69,7 +66,7 @@ _e_place_coverage_border_add(E_Zone *zone, Eina_List *skiplist, int ar, int x, i
{
Eina_List *ll;
E_Border_List *bl;
- E_Border *bd;
+ E_Border *bd, *bd2;
int x2, y2, w2, h2;
int ok;
int iw, ih;
@@ -80,9 +77,9 @@ _e_place_coverage_border_add(E_Zone *zone, Eina_List *skiplist, int ar, int x, i
{
ok = 1;
x2 = (bd->x - zone->x); y2 = (bd->y - zone->y); w2 = bd->w; h2 = bd->h;
- for (ll = skiplist; ll; ll = ll->next)
+ EINA_LIST_FOREACH(skiplist, ll, bd2)
{
- if (ll->data == bd)
+ if (bd2 == bd)
{
ok = 0;
break;
@@ -114,10 +111,8 @@ _e_place_coverage_shelf_add(E_Zone *zone, int ar, int x, int y, int w, int h)
E_Shelf *es;
int x2, y2, w2, h2;
- for (l = e_shelf_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
-
- es = l->data;
if (es->zone != zone) continue;
x2 = es->x; y2 = es->y; w2 = es->w; h2 = es->h;
if (E_INTERSECTS(x, y, w, h, x2, y2, w2, h2))
@@ -151,7 +146,7 @@ e_place_zone_region_smart(E_Zone *zone, Eina_List *skiplist, int x, int y, int w
char *u_x = NULL, *u_y = NULL;
Eina_List *ll;
E_Border_List *bl;
- E_Border *bd;
+ E_Border *bd, *bd2;
*rx = x;
*ry = y;
@@ -195,13 +190,12 @@ e_place_zone_region_smart(E_Zone *zone, Eina_List *skiplist, int x, int y, int w
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
{
Eina_List *l;
+ E_Shelf *es;
- for (l = e_shelf_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
- E_Shelf *es;
int bx, by, bw, bh;
- es = l->data;
if (es->zone != zone) continue;
bx = es->x;
@@ -278,9 +272,9 @@ e_place_zone_region_smart(E_Zone *zone, Eina_List *skiplist, int x, int y, int w
int bx, by, bw, bh;
ok = 1;
- for (ll = skiplist; ll; ll = ll->next)
+ EINA_LIST_FOREACH(skiplist, ll, bd2)
{
- if (ll->data == bd)
+ if (bd2 == bd)
{
ok = 0;
break;
diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c
index c47efb315..3b4ac76e2 100644
--- a/src/bin/e_pointer.c
+++ b/src/bin/e_pointer.c
@@ -62,14 +62,7 @@ e_pointer_init(void)
EAPI int
e_pointer_shutdown(void)
{
- while (handlers)
- {
- Ecore_Event_Handler *h;
-
- h = handlers->data;
- handlers = eina_list_remove_list(handlers, handlers);
- ecore_event_handler_del(h);
- }
+ E_FREE_LIST(handlers, ecore_event_handler_del);
return 1;
}
@@ -97,14 +90,13 @@ EAPI void
e_pointers_size_set(int size)
{
Eina_List *l;
+ E_Pointer *p;
if (!e_config->show_cursor) return;
- for (l = _e_pointers; l; l = l->next)
+ EINA_LIST_FOREACH(_e_pointers, l, p)
{
- E_Pointer *p;
Evas_Engine_Info_Buffer *einfo;
- p = l->data;
if (p->evas)
{
p->w = p->h = size;
@@ -173,9 +165,8 @@ e_pointer_type_pop(E_Pointer *p, void *obj, const char *type)
Eina_List *l;
E_Pointer_Stack *stack;
- for (l = p->stack; l; l = l->next)
+ EINA_LIST_FOREACH(p->stack, l, stack)
{
- stack = l->data;
if ((stack->obj == obj) && ((!type) || (!strcmp(stack->type, type))))
{
_e_pointer_stack_free(stack);
@@ -193,7 +184,7 @@ e_pointer_type_pop(E_Pointer *p, void *obj, const char *type)
return;
}
- stack = p->stack->data;
+ stack = eina_list_data_get(p->stack);
_e_pointer_type_set(p, stack->type);
if (p->type) eina_stringshare_del(p->type);
@@ -208,14 +199,13 @@ EAPI void
e_pointer_idler_before(void)
{
Eina_List *l;
+ E_Pointer *p;
if (!e_config->show_cursor) return;
- for (l = _e_pointers; l; l = l->next)
+ EINA_LIST_FOREACH(_e_pointers, l, p)
{
- E_Pointer *p;
Eina_List *updates;
- p = l->data;
if (!p->e_cursor) continue;
if (!p->evas) continue;
@@ -333,11 +323,7 @@ _e_pointer_free(E_Pointer *p)
_e_pointer_canvas_del(p);
- while (p->stack)
- {
- _e_pointer_stack_free(p->stack->data);
- p->stack = eina_list_remove_list(p->stack, p->stack);
- }
+ E_FREE_LIST(p->stack, _e_pointer_stack_free);
if (p->type) eina_stringshare_del(p->type);
if (p->idle_timer) ecore_timer_del(p->idle_timer);
@@ -478,9 +464,8 @@ _e_pointer_cb_mouse_down(void *data, int type, void *event)
E_Pointer *p;
ev = event;
- for (l = _e_pointers; l; l = l->next)
+ EINA_LIST_FOREACH(_e_pointers, l, p)
{
- p = l->data;
_e_pointer_active_handle(p);
if (e_powersave_mode_get() < E_POWERSAVE_MODE_EXTREME)
{
@@ -500,9 +485,8 @@ _e_pointer_cb_mouse_up(void *data, int type, void *event)
E_Pointer *p;
ev = event;
- for (l = _e_pointers; l; l = l->next)
+ EINA_LIST_FOREACH(_e_pointers, l, p)
{
- p = l->data;
_e_pointer_active_handle(p);
if (e_powersave_mode_get() < E_POWERSAVE_MODE_EXTREME)
{
@@ -522,9 +506,8 @@ _e_pointer_cb_mouse_move(void *data, int type, void *event)
E_Pointer *p;
ev = event;
- for (l = _e_pointers; l; l = l->next)
+ EINA_LIST_FOREACH(_e_pointers, l, p)
{
- p = l->data;
_e_pointer_active_handle(p);
if (e_powersave_mode_get() < E_POWERSAVE_MODE_HIGH)
{
@@ -544,9 +527,8 @@ _e_pointer_cb_mouse_wheel(void *data, int type, void *event)
E_Pointer *p;
ev = event;
- for (l = _e_pointers; l; l = l->next)
+ EINA_LIST_FOREACH(_e_pointers, l, p)
{
- p = l->data;
_e_pointer_active_handle(p);
if (e_powersave_mode_get() < E_POWERSAVE_MODE_EXTREME)
{
diff --git a/src/bin/e_popup.c b/src/bin/e_popup.c
index 2826b4238..58fbcb81b 100644
--- a/src/bin/e_popup.c
+++ b/src/bin/e_popup.c
@@ -216,12 +216,10 @@ EAPI void
e_popup_idler_before(void)
{
Eina_List *l;
+ E_Popup *pop;
- for (l = _e_popup_list; l; l = l->next)
+ EINA_LIST_FOREACH(_e_popup_list, l, pop)
{
- E_Popup *pop;
-
- pop = l->data;
if (pop->need_shape_export)
{
Ecore_X_Rectangle *rects, *orects;
@@ -331,14 +329,12 @@ static int
_e_popup_cb_window_shape(void *data, int ev_type, void *ev)
{
Eina_List *l;
+ E_Popup *pop;
Ecore_X_Event_Window_Shape *e;
e = ev;
- for (l = _e_popup_list; l; l = l->next)
+ EINA_LIST_FOREACH(_e_popup_list, l, pop)
{
- E_Popup *pop;
-
- pop = l->data;
if (pop->evas_win == e->win)
pop->need_shape_export = 1;
}
@@ -351,9 +347,8 @@ _e_popup_find_by_window(Ecore_X_Window win)
E_Popup *pop;
Eina_List *l;
- for (l = _e_popup_list; l; l = l->next)
+ EINA_LIST_FOREACH(_e_popup_list, l, pop)
{
- pop = l->data;
if (pop->evas_win == win) return pop;
}
return NULL;
diff --git a/src/bin/e_powersave.c b/src/bin/e_powersave.c
index ecf4314ec..8da9a08ad 100644
--- a/src/bin/e_powersave.c
+++ b/src/bin/e_powersave.c
@@ -134,13 +134,11 @@ e_powersave_mode_get(void)
static int
_e_powersave_cb_deferred_timer(void *data)
{
+ E_Powersave_Deferred_Action *pa;
+
walking_deferred_actions++;
- while (deferred_actions)
+ EINA_LIST_FREE(deferred_actions, pa)
{
- E_Powersave_Deferred_Action *pa;
-
- pa = deferred_actions->data;
- deferred_actions = eina_list_remove_list(deferred_actions, deferred_actions);
if (!pa->delete_me) pa->func((void *)pa->data);
free(pa);
}
diff --git a/src/bin/e_remember.c b/src/bin/e_remember.c
index 258b3100a..033f0c959 100644
--- a/src/bin/e_remember.c
+++ b/src/bin/e_remember.c
@@ -20,26 +20,21 @@ EAPI int
e_remember_init(E_Startup_Mode mode)
{
Eina_List *l = NULL;
+ E_Remember *rem;
int not_updated = 0;
if (mode == E_STARTUP_START)
{
- for (l = e_config->remembers; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->remembers, l, rem)
{
- E_Remember *rem;
-
- rem = l->data;
if ((rem->apply & E_REMEMBER_APPLY_RUN) && (rem->prop.command))
e_util_head_exec(rem->prop.head, rem->prop.command);
}
}
#if 1
- for (l = e_config->remembers; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->remembers, l, rem)
{
- E_Remember *rem;
-
- rem = l->data;
/* Code to bring up old configs to scratch. Can be removed
* after X amount of time, where X is a figure that will be
* decided by whoever remembers to take this out. */
@@ -110,13 +105,11 @@ e_remember_del(E_Remember *rem)
if (rem->used_count != 0)
{
Eina_List *l = NULL;
+ E_Border *bd;
rem->delete_me = 1;
- for (l = e_border_client_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (bd->remember == rem)
{
bd->remember = NULL;
@@ -170,9 +163,8 @@ e_remember_match_update(E_Remember *rem)
rem->max_score = max_count;
e_config->remembers = eina_list_remove(e_config->remembers, rem);
- for (l = e_config->remembers; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->remembers, l, r)
{
- r = l->data;
if (r->max_score <= rem->max_score) break;
}
@@ -364,16 +356,15 @@ static E_Remember *
_e_remember_find(E_Border *bd, int check_usable)
{
Eina_List *l = NULL;
+ E_Remember *rem;
#if REMEMBER_SIMPLE
- for (l = e_config->remembers; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->remembers, l, rem)
{
- E_Remember *rem;
int required_matches;
int matches;
const char *title = "";
- rem = l->data;
matches = 0;
required_matches = 0;
if (rem->match & E_REMEMBER_MATCH_NAME) required_matches++;
@@ -420,12 +411,10 @@ _e_remember_find(E_Border *bd, int check_usable)
* with the most possible matches at the start of the list. This
* means, as soon as a valid match is found, it is a match
* within the set of best possible matches. */
- for (l = e_config->remembers; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->remembers, l, rem)
{
- E_Remember *rem;
const char *title = "";
- rem = l->data;
if ((check_usable) && (!e_remember_usable_get(rem)))
continue;
diff --git a/src/bin/e_resist.c b/src/bin/e_resist.c
index 441147ccf..773485f82 100644
--- a/src/bin/e_resist.c
+++ b/src/bin/e_resist.c
@@ -23,8 +23,10 @@ e_resist_container_border_position(E_Container *con, Eina_List *skiplist,
Eina_List *l, *ll, *rects = NULL;
E_Resist_Rect *r;
E_Border_List *bl;
- E_Border *bd;
+ E_Border *bd, *bd2;
E_Desk *desk;
+ E_Shelf *es;
+ E_Zone *zone;
if (!e_config->use_resist)
{
@@ -51,11 +53,8 @@ e_resist_container_border_position(E_Container *con, Eina_List *skiplist,
rects = eina_list_append(rects, r); \
}
- for (l = con->zones; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
{
- E_Zone *zone;
-
- zone = l->data;
HOLDER(zone->x, zone->y, zone->w, zone->h, e_config->desk_resist);
}
/* FIXME: need to add resist or complete BLOCKS for things like ibar */
@@ -70,9 +69,9 @@ e_resist_container_border_position(E_Container *con, Eina_List *skiplist,
int ok;
ok = 1;
- for (ll = skiplist; ll; ll = ll->next)
+ EINA_LIST_FOREACH(skiplist, ll, bd2)
{
- if (ll->data == bd)
+ if (bd2 == bd)
{
ok = 0;
break;
@@ -87,21 +86,17 @@ e_resist_container_border_position(E_Container *con, Eina_List *skiplist,
e_container_border_list_free(bl);
desk = e_desk_current_get(e_zone_current_get(con));
- for (l = e_shelf_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
- E_Shelf *es;
Eina_List *ll;
+ E_Config_Shelf_Desk *sd;
- es = l->data;
if (es->zone->container == con)
{
if (es->cfg->desk_show_mode)
{
- for (ll = es->cfg->desk_list; ll; ll = ll->next)
+ EINA_LIST_FOREACH(es->cfg->desk_list, ll, sd)
{
- E_Config_Shelf_Desk *sd;
-
- sd = ll->data;
if (!sd) continue;
if ((sd->x == desk->x) && (sd->y == desk->y))
{
@@ -125,11 +120,7 @@ e_resist_container_border_position(E_Container *con, Eina_List *skiplist,
x, y, w, h,
rx, ry, rw, rh);
- for (l = rects; l; l = l->next)
- {
- E_FREE(l->data);
- }
- eina_list_free(rects);
+ E_FREE_LIST(rects, E_FREE);
}
return 1;
}
@@ -142,6 +133,7 @@ e_resist_container_gadman_position(E_Container *con, Eina_List *skiplist,
{
Eina_List *l, *rects = NULL;
E_Resist_Rect *r;
+ E_Shelf *es;
if (!e_config->use_resist)
{
@@ -150,11 +142,8 @@ e_resist_container_gadman_position(E_Container *con, Eina_List *skiplist,
return 0;
}
- for (l = e_shelf_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_shelf_list(), l, es)
{
- E_Shelf *es;
-
- es = l->data;
if (es->zone->container == con)
{
OBSTACLE(es->x + es->zone->x, es->y + es->zone->y, es->w, es->h,
@@ -169,11 +158,7 @@ e_resist_container_gadman_position(E_Container *con, Eina_List *skiplist,
x, y, w, h,
rx, ry, NULL, NULL);
- for (l = rects; l; l = l->next)
- {
- E_FREE(l->data);
- }
- eina_list_free(rects);
+ E_FREE_LIST(rects, E_FREE);
}
return 1;
}
@@ -195,9 +180,8 @@ _e_resist_rects(Eina_List *rects,
dw = w - pw;
dh = h - ph;
- for (l = rects; l; l = l->next)
+ EINA_LIST_FOREACH(rects, l, r)
{
- r = l->data;
if (E_SPANS_COMMON(r->y, r->h, y, h))
{
if (dx > 0)
diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c
index 486b426e7..46cc397b9 100644
--- a/src/bin/e_shelf.c
+++ b/src/bin/e_shelf.c
@@ -45,7 +45,7 @@ e_shelf_shutdown(void)
{
E_Shelf *es;
- es = shelves->data;
+ es = eina_list_data_get(shelves);
e_object_del(E_OBJECT(es));
}
@@ -56,22 +56,21 @@ EAPI void
e_shelf_config_init(void)
{
Eina_List *l;
+ E_Config_Shelf *cf_es;
int id = 0;
while (shelves)
{
E_Shelf *es;
- es = shelves->data;
+ es = eina_list_data_get(shelves);
e_object_del(E_OBJECT(es));
}
- for (l = e_config->shelves; l; l = l->next)
+ EINA_LIST_FOREACH(e_config->shelves, l, cf_es)
{
- E_Config_Shelf *cf_es;
E_Zone *zone;
- cf_es = l->data;
if (cf_es->id <= 0) cf_es->id = id + 1;
zone = e_util_container_zone_id_get(cf_es->container, cf_es->zone);
if (zone)
@@ -230,9 +229,8 @@ e_shelf_zone_move_resize_handle(E_Zone *zone)
E_Shelf *es;
Evas_Coord w, h;
- for (l = shelves; l; l = l->next)
+ EINA_LIST_FOREACH(shelves, l, es)
{
- es = l->data;
if (es->zone == zone)
{
E_Gadcon * gc;
@@ -731,13 +729,11 @@ e_shelf_config_new(E_Zone *zone, E_Config_Shelf *cf_es)
{
E_Desk *desk;
Eina_List *ll;
+ E_Config_Shelf_Desk *sd;
desk = e_desk_current_get(zone);
- for (ll = cf_es->desk_list; ll; ll = ll->next)
+ EINA_LIST_FOREACH(cf_es->desk_list, ll, sd)
{
- E_Config_Shelf_Desk *sd;
-
- sd = ll->data;
if ((desk->x == sd->x) && (desk->y == sd->y))
{
e_shelf_show(es);
@@ -1068,15 +1064,13 @@ static void
_e_shelf_toggle_border_fix(E_Shelf *es)
{
Eina_List *l;
+ E_Border *bd;
if ((es->cfg->overlap) || (!e_config->border_fix_on_shelf_toggle))
return;
- for (l = e_border_client_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if ((bd->maximized & E_MAXIMIZE_TYPE) == E_MAXIMIZE_NONE)
{
if (bd->lock_client_location) continue;
diff --git a/src/bin/e_slidecore.c b/src/bin/e_slidecore.c
index 108dc02d9..c0de44cac 100644
--- a/src/bin/e_slidecore.c
+++ b/src/bin/e_slidecore.c
@@ -316,14 +316,12 @@ _e_smart_add(Evas_Object *obj)
static void
_e_smart_del(Evas_Object *obj)
{
+ E_Smart_Item *it;
+
INTERNAL_ENTRY;
if (sd->slide_animator) ecore_animator_del(sd->slide_animator);
- while (sd->items)
+ EINA_LIST_FREE(sd->items, it)
{
- E_Smart_Item *it;
-
- it = sd->items->data;
- sd->items = eina_list_remove_list(sd->items, sd->items);
if (it->label) eina_stringshare_del(it->label);
if (it->icon) eina_stringshare_del(it->icon);
free(it);
diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c
index 67b5007cb..fe6d75734 100644
--- a/src/bin/e_sys.c
+++ b/src/bin/e_sys.c
@@ -289,13 +289,11 @@ static int
_e_sys_cb_logout_timer(void *data)
{
Eina_List *l;
+ E_Border *bd;
int pending = 0;
- for (l = e_border_client_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
- E_Border *bd;
-
- bd = l->data;
if (!bd->internal) pending++;
}
if (pending == 0) goto after;
@@ -356,6 +354,7 @@ static void
_e_sys_logout_begin(E_Sys_Action a_after)
{
Eina_List *l;
+ E_Border *bd;
E_Obj_Dialog *od;
/* start logout - at end do the a_after action */
@@ -370,11 +369,8 @@ _e_sys_logout_begin(E_Sys_Action a_after)
if (_e_sys_dialog) e_object_del(E_OBJECT(_e_sys_dialog));
_e_sys_dialog = od;
_e_sys_action_after = a_after;
- for (l = e_border_client_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_border_client_list(), l, bd)
{
- E_Border *bd;
-
- bd = l->data;
e_border_act_close_begin(bd);
}
/* and poll to see if all pending windows are gone yet every 0.5 sec */
diff --git a/src/bin/e_table.c b/src/bin/e_table.c
index 5ef9a2d7b..c069a2346 100644
--- a/src/bin/e_table.c
+++ b/src/bin/e_table.c
@@ -289,6 +289,7 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
{
Evas_Coord x, y, w, h, xx, yy;
Eina_List *l;
+ Evas_Object *obj;
int minw, minh, expandw, expandh;
if (!sd->changed) return;
@@ -314,12 +315,10 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
y = y + ((h - minh) * (1.0 - sd->align.y));
h = minh;
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
if (ti->expand_w) expandw++;
if (ti->expand_h) expandh++;
@@ -338,13 +337,11 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
y = sd->y;
if (sd->homogenous)
{
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
Evas_Coord ww, hh, ow, oh;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
xx = x + ((ti->col) * (w / (Evas_Coord)sd->size.cols));
@@ -366,12 +363,10 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
else
{
int i, ex, tot, need, num, dif, left, nx;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
if (sd->size.cols < (ti->col + ti->colspan))
sd->size.cols = ti->col + ti->colspan;
@@ -387,12 +382,10 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
colsx = calloc(sd->size.cols, sizeof(int));
rowsx = calloc(sd->size.rows, sizeof(int));
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
for (i = ti->col; i < (ti->col + ti->colspan); i++)
colsx[i] |= ti->expand_w;
@@ -400,12 +393,10 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
rowsx[i] |= ti->expand_h;
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
/* handle horizontal */
@@ -581,13 +572,11 @@ _e_table_smart_reconfigure(E_Smart_Data *sd)
}
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
Evas_Coord ww, hh, ow, oh, i;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
xx = x;
@@ -623,6 +612,7 @@ static void
_e_table_smart_extents_calcuate(E_Smart_Data *sd)
{
Eina_List *l;
+ Evas_Object *obj;
int minw, minh;
sd->max.w = -1; /* max < 0 == unlimited */
@@ -634,13 +624,11 @@ _e_table_smart_extents_calcuate(E_Smart_Data *sd)
minh = 0;
if (sd->homogenous)
{
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
int mw, mh;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
if (sd->size.cols < (ti->col + ti->colspan))
sd->size.cols = ti->col + ti->colspan;
@@ -657,12 +645,10 @@ _e_table_smart_extents_calcuate(E_Smart_Data *sd)
else
{
int i, ex, tot, need, num, dif, left, nx;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
if (sd->size.cols < (ti->col + ti->colspan))
sd->size.cols = ti->col + ti->colspan;
@@ -678,12 +664,10 @@ _e_table_smart_extents_calcuate(E_Smart_Data *sd)
colsx = calloc(sd->size.cols, sizeof(int));
rowsx = calloc(sd->size.rows, sizeof(int));
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
for (i = ti->col; i < (ti->col + ti->colspan); i++)
colsx[i] |= ti->expand_w;
@@ -691,12 +675,10 @@ _e_table_smart_extents_calcuate(E_Smart_Data *sd)
rowsx[i] |= ti->expand_h;
}
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, obj)
{
E_Table_Item *ti;
- Evas_Object *obj;
- obj = l->data;
ti = evas_object_data_get(obj, "e_table_data");
/* handle horizontal */
@@ -880,7 +862,7 @@ _e_table_smart_del(Evas_Object *obj)
{
Evas_Object *child;
- child = sd->items->data;
+ child = eina_list_data_get(sd->items);
e_table_unpack(child);
}
e_table_thaw(obj);
@@ -899,16 +881,17 @@ _e_table_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
if ((x == sd->x) && (y == sd->y)) return;
{
Eina_List *l;
+ Evas_Object *item;
Evas_Coord dx, dy;
dx = x - sd->x;
dy = y - sd->y;
- for (l = sd->items; l; l = l->next)
+ EINA_LIST_FOREACH(sd->items, l, item)
{
Evas_Coord ox, oy;
- evas_object_geometry_get(l->data, &ox, &oy, NULL, NULL);
- evas_object_move(l->data, ox + dx, oy + dy);
+ evas_object_geometry_get(item, &ox, &oy, NULL, NULL);
+ evas_object_move(item, ox + dx, oy + dy);
}
}
sd->x = x;
diff --git a/src/bin/e_test.c b/src/bin/e_test.c
index 1fe314cbc..6c8ed6fd4 100644
--- a/src/bin/e_test.c
+++ b/src/bin/e_test.c
@@ -8,19 +8,14 @@ static void _e_test_internal(E_Container *con);
EAPI void
e_test(void)
{
- Eina_List *managers, *l, *ll;
+ Eina_List *l, *ll;
+ E_Manager *man;
+ E_Container *con;
- managers = e_manager_list();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
-
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- E_Container *con;
-
- con = ll->data;
_e_test_internal(con);
}
}
@@ -32,6 +27,7 @@ _e_test_timer(void *data)
{
E_Menu *m;
Eina_List *managers, *l;
+ E_Manager *man;
m = data;
if (m)
@@ -42,11 +38,8 @@ _e_test_timer(void *data)
return 0;
}
managers = e_manager_list();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(managers, l, man)
{
- E_Manager *man;
-
- man = l->data;
m = e_int_menus_main_new();
e_menu_activate_mouse(m,
e_container_zone_number_get(e_container_current_get(man), 0),
@@ -122,14 +115,11 @@ static void
_e_test_internal(E_Container *con)
{
E_Menu *m;
- Eina_List *managers, *l;
+ Eina_List *l;
+ E_Manager *man;
- managers = e_manager_list();
- for (l = managers; l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
-
- man = l->data;
m = e_int_menus_main_new();
e_menu_activate_mouse(m,
e_container_zone_number_get(e_container_current_get(man), 0),
@@ -463,7 +453,7 @@ _e_test_cb_favorites_selected(void *data, Evas_Object *obj, void *event_info)
printf("FAV SELECTED\n");
selected = e_fm2_selected_list_get(obj);
if (!selected) return;
- ici = selected->data;
+ ici = eina_list_data_get(selected);
if ((ici->link) && (ici->mount))
e_fm2_path_set(data, ici->link, "/");
else if (ici->link)
@@ -487,9 +477,8 @@ _e_test_cb_favorites_files_changed(void *data, Evas_Object *obj, void *event_inf
realpath = e_fm2_real_path_get(data);
p1 = ecore_file_realpath(realpath);
if (!p1) goto done;
- for (l = icons; l; l = l->next)
+ EINA_LIST_FOREACH(icons, l, ici)
{
- ici = l->data;
if (ici->link)
{
p2 = ecore_file_realpath(ici->link);
diff --git a/src/bin/e_thumb.c b/src/bin/e_thumb.c
index 32abf9bb6..8a213e8ca 100644
--- a/src/bin/e_thumb.c
+++ b/src/bin/e_thumb.c
@@ -59,11 +59,7 @@ e_thumb_shutdown(void)
ecore_event_handler_del(_exe_del_handler);
_exe_del_handler = NULL;
_thumbnailers = eina_list_free(_thumbnailers);
- while (_thumbnailers_exe)
- {
- ecore_exe_free(_thumbnailers_exe->data);
- _thumbnailers_exe = eina_list_remove_list(_thumbnailers_exe, _thumbnailers_exe);
- }
+ E_FREE_LIST(_thumbnailers_exe, ecore_exe_free);
_thumb_queue = eina_list_free(_thumb_queue);
_objid = 0;
eina_hash_free(_thumbs);
@@ -154,10 +150,8 @@ e_thumb_icon_begin(Evas_Object *obj)
eth->queued = 1;
return;
}
- while (_thumb_queue)
+ EINA_LIST_FREE(_thumb_queue, eth2)
{
- eth2 = _thumb_queue->data;
- _thumb_queue = eina_list_remove_list(_thumb_queue, _thumb_queue);
eth2->queued = 0;
eth2->busy = 1;
_pending++;
@@ -279,10 +273,8 @@ e_thumb_client_data(Ecore_Ipc_Event_Client_Data *e)
if (e->minor == 1)
{
/* hello message */
- while (_thumb_queue)
+ EINA_LIST_FREE(_thumb_queue, eth)
{
- eth = _thumb_queue->data;
- _thumb_queue = eina_list_remove_list(_thumb_queue, _thumb_queue);
eth->queued = 0;
eth->busy = 1;
_pending++;
@@ -316,7 +308,7 @@ _e_thumb_gen_begin(int objid, const char *file, const char *key, int w, int h)
strcpy(buf, file);
if (key) strcpy(buf + l1 + 1, key);
else buf[l1 + 1] = 0;
- cli = _thumbnailers->data;
+ cli = eina_list_data_get(_thumbnailers);
if (!cli) return;
_thumbnailers = eina_list_remove_list(_thumbnailers, _thumbnailers);
_thumbnailers = eina_list_append(_thumbnailers, cli);
@@ -330,9 +322,8 @@ _e_thumb_gen_end(int objid)
Ecore_Ipc_Client *cli;
/* send thumb cancel */
- for (l = _thumbnailers; l; l = l->next)
+ EINA_LIST_FOREACH(_thumbnailers, l, cli)
{
- cli = l->data;
ecore_ipc_client_send(cli, E_IPC_DOMAIN_THUMB, 2, objid, 0, 0, NULL, 0);
}
}
@@ -407,9 +398,10 @@ static int
_e_thumb_cb_kill(void *data)
{
Eina_List *l;
+ Ecore_Exe *exe;
- for (l = _thumbnailers_exe; l; l = l->next)
- ecore_exe_terminate(l->data);
+ EINA_LIST_FOREACH(_thumbnailers_exe, l, exe)
+ ecore_exe_terminate(exe);
_kill_timer = NULL;
return 0;
}
@@ -418,12 +410,13 @@ static int
_e_thumb_cb_exe_event_del(void *data, int type, void *event)
{
Ecore_Exe_Event_Del *ev;
+ Ecore_Exe *exe;
Eina_List *l;
ev = event;
- for (l = _thumbnailers_exe; l; l = l->next)
+ EINA_LIST_FOREACH(_thumbnailers_exe, l, exe)
{
- if (l->data == ev->exe)
+ if (exe == ev->exe)
{
_thumbnailers_exe = eina_list_remove_list(_thumbnailers_exe, l);
break;
diff --git a/src/bin/e_thumb_main.c b/src/bin/e_thumb_main.c
index 5535f8f45..d3217f4ff 100644
--- a/src/bin/e_thumb_main.c
+++ b/src/bin/e_thumb_main.c
@@ -187,9 +187,8 @@ _e_ipc_cb_server_data(void *data, int type, void *event)
break;
case 2:
/* end thumb */
- for (l = _thumblist; l; l = l->next)
+ EINA_LIST_FOREACH(_thumblist, l, eth)
{
- eth = l->data;
if (eth->objid == e->ref)
{
_thumblist = eina_list_remove_list(_thumblist, l);
@@ -221,7 +220,7 @@ _e_cb_timer(void *data)
/* take thumb at head of list */
if (_thumblist)
{
- eth = _thumblist->data;
+ eth = eina_list_data_get(_thumblist);
_thumblist = eina_list_remove_list(_thumblist, _thumblist);
_e_thumb_generate(eth);
if (eth->file) free(eth->file);
diff --git a/src/bin/e_toolbar.c b/src/bin/e_toolbar.c
index 0355ceb42..c1c456d7a 100644
--- a/src/bin/e_toolbar.c
+++ b/src/bin/e_toolbar.c
@@ -35,7 +35,7 @@ e_toolbar_shutdown(void)
{
E_Toolbar *tbar;
- tbar = toolbars->data;
+ tbar = eina_list_data_get(toolbars);
e_object_del(E_OBJECT(tbar));
}
return 1;
@@ -499,14 +499,12 @@ _e_toolbar_fm2_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Toolbar *tbar;
Eina_List *l = NULL;
+ E_Gadcon_Client *gcc = NULL;
tbar = data;
if (!tbar) return;
- for (l = tbar->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(tbar->gadcon->clients, l, gcc)
{
- E_Gadcon_Client *gcc = NULL;
-
- gcc = l->data;
if (!gcc) continue;
evas_object_smart_callback_call(gcc->o_base, "changed", tbar);
}
@@ -517,14 +515,12 @@ _e_toolbar_fm2_dir_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Toolbar *tbar;
Eina_List *l = NULL;
+ E_Gadcon_Client *gcc = NULL;
tbar = data;
if (!tbar) return;
- for (l = tbar->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(tbar->gadcon->clients, l, gcc)
{
- E_Gadcon_Client *gcc = NULL;
-
- gcc = l->data;
if (!gcc) continue;
evas_object_smart_callback_call(gcc->o_base, "dir_changed", tbar);
}
@@ -535,14 +531,12 @@ _e_toolbar_fm2_dir_deleted(void *data, Evas_Object *obj, void *event_info)
{
E_Toolbar *tbar;
Eina_List *l = NULL;
+ E_Gadcon_Client *gcc = NULL;
tbar = data;
if (!tbar) return;
- for (l = tbar->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(tbar->gadcon->clients, l, gcc)
{
- E_Gadcon_Client *gcc = NULL;
-
- gcc = l->data;
if (!gcc) continue;
evas_object_smart_callback_call(gcc->o_base, "dir_deleted", tbar);
}
@@ -553,14 +547,12 @@ _e_toolbar_fm2_files_deleted(void *data, Evas_Object *obj, void *event_info)
{
E_Toolbar *tbar;
Eina_List *l = NULL;
+ E_Gadcon_Client *gcc = NULL;
tbar = data;
if (!tbar) return;
- for (l = tbar->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(tbar->gadcon->clients, l, gcc)
{
- E_Gadcon_Client *gcc = NULL;
-
- gcc = l->data;
if (!gcc) continue;
evas_object_smart_callback_call(gcc->o_base, "files_deleted", tbar);
}
@@ -571,14 +563,12 @@ _e_toolbar_fm2_selected(void *data, Evas_Object *obj, void *event_info)
{
E_Toolbar *tbar;
Eina_List *l = NULL;
+ E_Gadcon_Client *gcc = NULL;
tbar = data;
if (!tbar) return;
- for (l = tbar->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(tbar->gadcon->clients, l, gcc)
{
- E_Gadcon_Client *gcc = NULL;
-
- gcc = l->data;
if (!gcc) continue;
evas_object_smart_callback_call(gcc->o_base, "selected", tbar);
}
@@ -589,14 +579,12 @@ _e_toolbar_fm2_selection_changed(void *data, Evas_Object *obj, void *event_info)
{
E_Toolbar *tbar;
Eina_List *l = NULL;
+ E_Gadcon_Client *gcc = NULL;
tbar = data;
if (!tbar) return;
- for (l = tbar->gadcon->clients; l; l = l->next)
+ EINA_LIST_FOREACH(tbar->gadcon->clients, l, gcc)
{
- E_Gadcon_Client *gcc = NULL;
-
- gcc = l->data;
if (!gcc) continue;
evas_object_smart_callback_call(gcc->o_base, "selection_changed", tbar);
}
diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c
index d31a4008b..f293362aa 100644
--- a/src/bin/e_utils.c
+++ b/src/bin/e_utils.c
@@ -126,13 +126,12 @@ EAPI E_Container *
e_util_container_number_get(int num)
{
Eina_List *l;
+ E_Manager *man;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
E_Container *con;
- man = l->data;
con = e_container_number_get(man, num);
if (con) return con;
}
@@ -507,17 +506,13 @@ EAPI E_Container *
e_util_container_window_find(Ecore_X_Window win)
{
Eina_List *l, *ll;
+ E_Manager *man;
+ E_Container *con;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- E_Manager *man;
-
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- E_Container *con;
-
- con = ll->data;
if ((con->win == win) || (con->bg_win == win) ||
(con->event_win == win))
return con;
@@ -529,7 +524,7 @@ e_util_container_window_find(Ecore_X_Window win)
EAPI E_Border *
e_util_desk_border_above(E_Border *bd)
{
- E_Border *above = NULL;
+ E_Border *bd2, *above = NULL;
Eina_List *l;
int pos, i;
@@ -543,11 +538,10 @@ e_util_desk_border_above(E_Border *bd)
else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4;
else pos = 5;
- for (l = eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd);
- (l) && (l->next) && (!above);
- l = l->next)
+ EINA_LIST_FOREACH(eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd), l, bd2)
{
- above = l->next->data;
+ if(!eina_list_next(l) || above) break;
+ above = eina_list_data_get(eina_list_next(l));
if ((above->desk != bd->desk) && (!above->sticky))
above = NULL;
}
@@ -556,11 +550,10 @@ e_util_desk_border_above(E_Border *bd)
/* Need to check the layers above */
for (i = pos + 1; (i < 7) && (!above); i++)
{
- for (l = bd->zone->container->layers[i].clients;
- (l) && (!above);
- l = l->next)
+ EINA_LIST_FOREACH(bd->zone->container->layers[i].clients, l, bd2)
{
- above = l->data;
+ if (above) break;
+ above = bd2;
if ((above->desk != bd->desk) && (!above->sticky))
above = NULL;
}
@@ -572,7 +565,7 @@ e_util_desk_border_above(E_Border *bd)
EAPI E_Border *
e_util_desk_border_below(E_Border *bd)
{
- E_Border *below = NULL;
+ E_Border *below = NULL, *bd2;
Eina_List *l;
int pos, i;
@@ -586,11 +579,10 @@ e_util_desk_border_below(E_Border *bd)
else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4;
else pos = 5;
- for (l = eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd);
- (l) && (l->prev) && (!below);
- l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd), l, bd2)
{
- below = l->prev->data;
+ if (!eina_list_prev(l) || below) break;
+ below = eina_list_data_get(eina_list_prev(l));
if ((below->desk != bd->desk) && (!below->sticky))
below = NULL;
}
@@ -601,11 +593,10 @@ e_util_desk_border_below(E_Border *bd)
{
if (bd->zone->container->layers[i].clients)
{
- for (l = eina_list_last(bd->zone->container->layers[i].clients);
- (l) && (!below);
- l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(eina_list_last(bd->zone->container->layers[i].clients), l, bd2)
{
- below = l->data;
+ if (below) break;
+ below = bd2;
if ((below->desk != bd->desk) && (!below->sticky))
below = NULL;
}
@@ -620,11 +611,12 @@ EAPI int
e_util_edje_collection_exists(const char *file, const char *coll)
{
Eina_List *clist, *l;
+ char *str;
clist = edje_file_collection_list(file);
- for (l = clist; l; l = l->next)
+ EINA_LIST_FOREACH(clist, l, str)
{
- if (!strcmp(coll, l->data))
+ if (!strcmp(coll, str))
{
edje_file_collection_list_free(clist);
return 1;
diff --git a/src/bin/e_widget.c b/src/bin/e_widget.c
index 6ff8fb03b..d596fa2d0 100644
--- a/src/bin/e_widget.c
+++ b/src/bin/e_widget.c
@@ -196,15 +196,14 @@ EAPI Evas_Object *
e_widget_focused_object_get(Evas_Object *obj)
{
Eina_List *l = NULL;
+ Evas_Object *sobj = NULL;
API_ENTRY return NULL;
if (!sd->focused) return NULL;
- for (l = sd->subobjs; l; l = l->next)
+ EINA_LIST_FOREACH(sd->subobjs, l, sobj)
{
- Evas_Object *fobj = NULL;
-
- fobj = e_widget_focused_object_get(l->data);
- if (fobj) return fobj;
+ sobj = e_widget_focused_object_get(sobj);
+ if (sobj) return sobj;
}
return obj;
}
@@ -228,6 +227,7 @@ e_widget_focus_jump(Evas_Object *obj, int forward)
else
{
Eina_List *l = NULL;
+ Evas_Object *sobj = NULL;
int focus_next = 0;
if (!sd->focused)
@@ -241,25 +241,25 @@ e_widget_focus_jump(Evas_Object *obj, int forward)
{
if (forward)
{
- for (l = sd->subobjs; l; l = l->next)
+ EINA_LIST_FOREACH(sd->subobjs, l, sobj)
{
- if (e_widget_can_focus_get(l->data))
+ if (e_widget_can_focus_get(sobj))
{
if ((focus_next) &&
- (!e_widget_disabled_get(l->data)))
+ (!e_widget_disabled_get(sobj)))
{
/* the previous focused item was unfocused - so focus
* the next one (that can be focused) */
- if (e_widget_focus_jump(l->data, forward))
+ if (e_widget_focus_jump(sobj, forward))
return 1;
else break;
}
else
{
- if (e_widget_focus_get(l->data))
+ if (e_widget_focus_get(sobj))
{
/* jump to the next focused item or focus this item */
- if (e_widget_focus_jump(l->data, forward))
+ if (e_widget_focus_jump(sobj, forward))
return 1;
/* it returned 0 - it got to the last item and is past it */
focus_next = 1;
@@ -270,25 +270,25 @@ e_widget_focus_jump(Evas_Object *obj, int forward)
}
else
{
- for (l = eina_list_last(sd->subobjs); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, sobj)
{
- if (e_widget_can_focus_get(l->data))
+ if (e_widget_can_focus_get(sobj))
{
if ((focus_next) &&
- (!e_widget_disabled_get(l->data)))
+ (!e_widget_disabled_get(sobj)))
{
/* the previous focused item was unfocused - so focus
* the next one (that can be focused) */
- if (e_widget_focus_jump(l->data, forward))
+ if (e_widget_focus_jump(sobj, forward))
return 1;
else break;
}
else
{
- if (e_widget_focus_get(l->data))
+ if (e_widget_focus_get(sobj))
{
/* jump to the next focused item or focus this item */
- if (e_widget_focus_jump(l->data, forward))
+ if (e_widget_focus_jump(sobj, forward))
return 1;
/* it returned 0 - it got to the last item and is past it */
focus_next = 1;
@@ -321,27 +321,28 @@ e_widget_focus_set(Evas_Object *obj, int first)
else
{
Eina_List *l = NULL;
+ Evas_Object *sobj;
if (first)
{
- for (l = sd->subobjs; l; l = l->next)
+ EINA_LIST_FOREACH(sd->subobjs, l, sobj)
{
- if ((e_widget_can_focus_get(l->data)) &&
- (!e_widget_disabled_get(l->data)))
+ if ((e_widget_can_focus_get(sobj)) &&
+ (!e_widget_disabled_get(sobj)))
{
- e_widget_focus_set(l->data, first);
+ e_widget_focus_set(sobj, first);
break;
}
}
}
else
{
- for (l = eina_list_last(sd->subobjs); l; l = l->prev)
+ EINA_LIST_REVERSE_FOREACH(sd->subobjs, l, sobj)
{
- if ((e_widget_can_focus_get(l->data)) &&
- (!e_widget_disabled_get(l->data)))
+ if ((e_widget_can_focus_get(sobj)) &&
+ (!e_widget_disabled_get(sobj)))
{
- e_widget_focus_set(l->data, first);
+ e_widget_focus_set(sobj, first);
break;
}
}
@@ -360,15 +361,16 @@ EAPI void
e_widget_focused_object_clear(Evas_Object *obj)
{
Eina_List *l = NULL;
+ Evas_Object *sobj = NULL;
API_ENTRY return;
if (!sd->focused) return;
sd->focused = 0;
- for (l = sd->subobjs; l; l = l->next)
+ EINA_LIST_FOREACH(sd->subobjs, l, sobj)
{
- if (e_widget_focus_get(l->data))
+ if (e_widget_focus_get(sobj))
{
- e_widget_focused_object_clear(l->data);
+ e_widget_focused_object_clear(sobj);
break;
}
}
@@ -497,16 +499,9 @@ _e_smart_add(Evas_Object *obj)
static void
_e_smart_del(Evas_Object *obj)
{
- Evas_Object *sobj = NULL;
-
INTERNAL_ENTRY;
if (sd->del_func) sd->del_func(obj);
- while (sd->subobjs)
- {
- sobj = sd->subobjs->data;
- sd->subobjs = eina_list_remove_list(sd->subobjs, sd->subobjs);
- evas_object_del(sobj);
- }
+ E_FREE_LIST(sd->subobjs, evas_object_del);
free(sd);
}
diff --git a/src/bin/e_widget_csel.c b/src/bin/e_widget_csel.c
index cb528b756..e0b538aed 100644
--- a/src/bin/e_widget_csel.c
+++ b/src/bin/e_widget_csel.c
@@ -51,6 +51,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
{
E_Widget_Data *wd = data;
Eina_List *l;
+ Evas_Object *eo, *so;
int i;
int changed = -1;
@@ -59,9 +60,10 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
wd->changing = 1;
/* entry changed */
- for (l = wd->entries, i = 0; l; l = l->next, i++)
+ i = 0;
+ EINA_LIST_FOREACH(wd->entries, l, eo)
{
- if (o == l->data)
+ if (o == eo)
{
changed = i;
switch (i)
@@ -99,6 +101,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
}
break;
}
+ i++;
}
if (changed != -1)
@@ -116,9 +119,9 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
/* update the sliders */
- for (l = wd->sliders, i = 0; l; l = l->next, i++)
+ i = 0;
+ EINA_LIST_FOREACH(wd->sliders, l, so)
{
- Evas_Object *so = l->data;
if (o != so)
{
e_widget_cslider_update(so);
@@ -127,6 +130,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
{
changed = i;
}
+ i++;
}
/* update the spectrum */
@@ -143,10 +147,11 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
e_widget_color_well_update(wd->well);
/* now update the text fields to show current values */
- for (l = wd->entries, i = 0; l; l = l->next, i++)
+ i = 0;
+ EINA_LIST_FOREACH(wd->entries, l, eo)
{
char buf[10];
- if (o == l->data) continue;
+ if (o == eo) continue;
switch (i)
{
case E_COLOR_COMPONENT_R:
@@ -168,7 +173,7 @@ _e_wid_cb_color_changed(void *data, Evas_Object *o)
snprintf(buf, 10, "%.2f", wd->cv->v);
break;
}
- e_widget_entry_text_set((Evas_Object *)(l->data), buf);
+ e_widget_entry_text_set(eo, buf);
}
wd->changing = 0;
diff --git a/src/bin/e_widget_desk_preview.c b/src/bin/e_widget_desk_preview.c
index a4642214f..20398a4eb 100644
--- a/src/bin/e_widget_desk_preview.c
+++ b/src/bin/e_widget_desk_preview.c
@@ -36,16 +36,15 @@ _e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
Eina_List *l;
+ Evas_Object *o;
wd = e_widget_data_get(obj);
if (!wd) return;
if (wd->update_handler) ecore_event_handler_del(wd->update_handler);
- for (l = wd->desks; l; l = l->next)
+ EINA_LIST_FOREACH(wd->desks, l, o)
{
- Evas_Object *o;
E_Widget_Desk_Data *dd;
- o = l->data;
dd = e_widget_data_get(o);
e_thumb_icon_end(o);
}
@@ -124,6 +123,7 @@ static void
_e_wid_reconfigure(E_Widget_Data *wd)
{
Eina_List *l, *delete = NULL;
+ Evas_Object *dw;
int x, y;
int aw, ah; /* available */
int mw, mh; /* min size for each desk */
@@ -166,9 +166,8 @@ _e_wid_reconfigure(E_Widget_Data *wd)
tw = 300;
th = (tw * zone->h) / zone->w;
- for (l = wd->desks; l; l = l->next)
+ EINA_LIST_FOREACH(wd->desks, l, dw)
{
- Evas_Object *dw = l->data;
E_Widget_Desk_Data *dd = e_widget_data_get(dw);
if (dd->x < nx && dd->y < ny)
{
@@ -182,13 +181,11 @@ _e_wid_reconfigure(E_Widget_Data *wd)
delete = eina_list_append(delete, dw);
}
}
- while (delete)
+ EINA_LIST_FREE(delete, dw)
{
- Evas_Object *dw = delete->data;
e_widget_table_unpack(wd->table, dw);
evas_object_del(dw);
wd->desks = eina_list_remove(wd->desks, dw);
- delete = eina_list_remove_list(delete, delete);
}
for (y = 0; y < ny; y++)
@@ -272,17 +269,16 @@ _e_wid_cb_bg_update(void *data, int type, void *event)
E_Event_Bg_Update *ev;
E_Widget_Data *wd;
Eina_List *l;
+ Evas_Object *o;
if (type != E_EVENT_BG_UPDATE) return 1;
wd = data;
ev = event;
- for (l = wd->desks; l; l = l->next)
+ EINA_LIST_FOREACH(wd->desks, l, o)
{
- Evas_Object *o;
E_Widget_Desk_Data *dd;
- o = l->data;
dd = e_widget_data_get(o);
if (!dd)
diff --git a/src/bin/e_widget_fsel.c b/src/bin/e_widget_fsel.c
index 0500c045c..155df0622 100644
--- a/src/bin/e_widget_fsel.c
+++ b/src/bin/e_widget_fsel.c
@@ -132,9 +132,8 @@ _e_wid_fsel_favorites_files_changed(void *data, Evas_Object *obj, void *event_in
realpath = e_fm2_real_path_get(wd->o_files_fm);
p1 = ecore_file_realpath(realpath);
if (!p1) goto done;
- for (l = icons; l; l = l->next)
+ EINA_LIST_FOREACH(icons, l, ici)
{
- ici = l->data;
if (ici->link)
{
p2 = ecore_file_realpath(ici->link);
@@ -168,7 +167,7 @@ _e_wid_fsel_favorites_selected(void *data, Evas_Object *obj, void *event_info)
if (!wd->o_files_frame) return;
selected = e_fm2_selected_list_get(wd->o_favorites_fm);
if (!selected) return;
- ici = selected->data;
+ ici = eina_list_data_get(selected);
if ((ici->link) && (ici->mount))
e_fm2_path_set(wd->o_files_fm, ici->link, "/");
else if (ici->real_link)
@@ -219,7 +218,7 @@ _e_wid_fsel_files_selection_change(void *data, Evas_Object *obj, void *event_inf
if (!wd->o_files_fm) return;
selected = e_fm2_selected_list_get(wd->o_files_fm);
if (!selected) return;
- ici = selected->data;
+ ici = eina_list_data_get(selected);
E_FREE(wd->path);
realpath = e_fm2_real_path_get(wd->o_files_fm);
if (!strcmp(realpath, "/"))
diff --git a/src/bin/e_widget_ilist.c b/src/bin/e_widget_ilist.c
index 4edc7021c..80405adaa 100644
--- a/src/bin/e_widget_ilist.c
+++ b/src/bin/e_widget_ilist.c
@@ -69,7 +69,7 @@ _queue_timer(void *data)
{
E_Widget_Queue_Item *qi;
- qi = wd->queue.queue->data;
+ qi = eina_list_data_get(wd->queue.queue);
if (qi->command == 0)
{
E_Widget_Callback *wcb, *rcb;
@@ -246,7 +246,7 @@ _queue_clear(Evas_Object *obj)
wd = e_widget_data_get(obj);
while (wd->queue.queue)
- _queue_remove(obj, wd->queue.queue->data, 1);
+ _queue_remove(obj, eina_list_data_get(wd->queue.queue), 1);
if (wd->queue.timer) ecore_timer_del(wd->queue.timer);
wd->queue.timer = NULL;
}
@@ -468,19 +468,16 @@ EAPI void
e_widget_ilist_clear(Evas_Object *obj)
{
E_Widget_Data *wd;
+ E_Widget_Callback *wcb;
wd = e_widget_data_get(obj);
_queue_clear(obj);
e_ilist_clear(wd->o_ilist);
e_scrollframe_child_pos_set(wd->o_scrollframe, 0, 0);
- while (wd->callbacks)
+ EINA_LIST_FREE(wd->callbacks, wcb)
{
- E_Widget_Callback *wcb;
-
- wcb = wd->callbacks->data;
if (wcb->value) free(wcb->value);
free(wcb);
- wd->callbacks = eina_list_remove_list(wd->callbacks, wd->callbacks);
}
}
@@ -739,17 +736,14 @@ static void
_e_wid_del_hook(Evas_Object *obj)
{
E_Widget_Data *wd;
+ E_Widget_Callback *wcb;
wd = e_widget_data_get(obj);
_queue_clear(obj);
- while (wd->callbacks)
+ EINA_LIST_FREE(wd->callbacks, wcb)
{
- E_Widget_Callback *wcb;
-
- wcb = wd->callbacks->data;
if (wcb->value) free(wcb->value);
free(wcb);
- wd->callbacks = eina_list_remove_list(wd->callbacks, wd->callbacks);
}
free(wd);
}
diff --git a/src/bin/e_widget_radio.c b/src/bin/e_widget_radio.c
index 8a440fc9a..33fd34a8a 100644
--- a/src/bin/e_widget_radio.c
+++ b/src/bin/e_widget_radio.c
@@ -153,12 +153,13 @@ e_widget_radio_toggle_set(Evas_Object *obj, int toggle)
if (toggle)
{
Eina_List *l;
+ Evas_Object *sobj;
- for (l = wd->group->radios; l; l = l->next)
+ EINA_LIST_FOREACH(wd->group->radios, l, sobj)
{
- if (l->data != obj)
+ if (sobj != obj)
{
- wd = e_widget_data_get(l->data);
+ wd = e_widget_data_get(sobj);
if (wd->valnum == *(wd->group->valptr))
{
edje_object_signal_emit(wd->o_radio, "e,state,off", "e");
@@ -217,13 +218,14 @@ _e_wid_do(Evas_Object *obj)
if ((wd->group) && (wd->group->valptr))
{
Eina_List *l;
+ Evas_Object *sobj;
int toggled = 0;
- for (l = wd->group->radios; l; l = l->next)
+ EINA_LIST_FOREACH(wd->group->radios, l, sobj)
{
- if (l->data != obj)
+ if (sobj != obj)
{
- wd = e_widget_data_get(l->data);
+ wd = e_widget_data_get(sobj);
if (wd->valnum == *(wd->group->valptr))
{
edje_object_signal_emit(wd->o_radio, "e,state,off", "e");
diff --git a/src/bin/e_widget_toolbook.c b/src/bin/e_widget_toolbook.c
index 67e54ce82..382b31c67 100644
--- a/src/bin/e_widget_toolbook.c
+++ b/src/bin/e_widget_toolbook.c
@@ -19,7 +19,6 @@ e_widget_toolbook_add(Evas *evas, int icon_w, int icon_h)
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
- Evas_Coord mw, mh;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
@@ -83,18 +82,15 @@ static void
_item_sel(void *data1, void *data2)
{
E_Widget_Data *wd;
- Evas_Object *obj, *sobj;
+ Evas_Object *o, *obj, *sobj;
Eina_List *l;
obj = data1;
sobj = data2;
wd = e_widget_data_get(obj);
- for (l = wd->content; l; l = l->next)
+ EINA_LIST_FOREACH(wd->content, l, o)
{
- Evas_Object *o;
-
- o = l->data;
if (o == sobj) evas_object_show(o);
else evas_object_hide(o);
}
diff --git a/src/bin/e_xinerama.c b/src/bin/e_xinerama.c
index 02091b186..3fcff6b3f 100644
--- a/src/bin/e_xinerama.c
+++ b/src/bin/e_xinerama.c
@@ -65,13 +65,9 @@ e_xinerama_fake_screen_add(int x, int y, int w, int h)
static void
_e_xinerama_clean(void)
{
- E_Screen *s = NULL;
-
- EINA_LIST_FREE(all_screens, s)
- E_FREE(s);
- EINA_LIST_FREE(chosen_screens, s);
- EINA_LIST_FREE(fake_screens, s)
- E_FREE(s);
+ E_FREE_LIST(all_screens, E_FREE);
+ eina_list_free(chosen_screens);
+ E_FREE_LIST(fake_screens, E_FREE);
}
static void
@@ -80,6 +76,7 @@ _e_xinerama_update(void)
int n;
Ecore_X_Window *roots;
Eina_List *l;
+ E_Screen *scr;
roots = ecore_x_window_root_list(&n);
if (roots)
@@ -139,22 +136,17 @@ _e_xinerama_update(void)
}
}
/* now go through all_screens... and build a list of chosen screens */
- for (l = all_screens; l; l = l->next)
+ EINA_LIST_FOREACH(all_screens, l, scr)
{
Eina_List *ll;
- E_Screen *scr;
- int add = 0;
+ E_Screen *scr2;
+ int add = 1;
Eina_List *removes;
- scr = l->data;
- add = 1;
removes = NULL;
/* does this screen intersect with any we have chosen? */
- for (ll = chosen_screens; ll; ll = ll->next)
+ EINA_LIST_FOREACH(chosen_screens, ll, scr2)
{
- E_Screen *scr2;
-
- scr2 = ll->data;
/* if they intersect */
if (E_INTERSECTS(scr->x, scr->y, scr->w, scr->h,
scr2->x, scr2->y, scr2->w, scr2->h))
@@ -173,10 +165,9 @@ _e_xinerama_update(void)
}
}
/* if there are screens to remove - remove them */
- while (removes)
+ EINA_LIST_FREE(removes, scr2)
{
- chosen_screens = eina_list_remove(chosen_screens, removes->data);
- removes = eina_list_remove_list(removes, removes);
+ chosen_screens = eina_list_remove(chosen_screens, scr2);
}
/* if this screen is to be added, add it */
if (add)
@@ -185,14 +176,13 @@ _e_xinerama_update(void)
chosen_screens = eina_list_sort(chosen_screens,
eina_list_count(chosen_screens),
_e_xinerama_cb_screen_sort);
- for (n = 0, l = chosen_screens; l; l = l->next, n++)
+ n = 0;
+ EINA_LIST_FOREACH(chosen_screens, l, scr)
{
- E_Screen *scr;
-
- scr = l->data;
printf("E17 INIT: XINERAMA CHOSEN: [%i], %ix%i+%i+%i\n",
scr->screen, scr->w, scr->h, scr->x, scr->y);
scr->escreen = n;
+ n++;
}
}
diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c
index 4c0c50299..9e2d37819 100644
--- a/src/bin/e_zone.c
+++ b/src/bin/e_zone.c
@@ -419,6 +419,7 @@ EAPI E_Zone *
e_zone_current_get(E_Container *con)
{
Eina_List *l = NULL;
+ E_Zone *zone;
E_OBJECT_CHECK_RETURN(con, NULL);
E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL);
@@ -427,18 +428,14 @@ e_zone_current_get(E_Container *con)
int x, y;
ecore_x_pointer_xy_get(con->win, &x, &y);
- for (l = con->zones; l; l = l->next)
+ EINA_LIST_FOREACH(con->zones, l, zone)
{
- E_Zone *zone;
-
- zone = l->data;
if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h))
return zone;
}
}
if (!con->zones) return NULL;
- l = con->zones;
- return (E_Zone *)l->data;
+ return (E_Zone *)eina_list_data_get(con->zones);
}
EAPI void
@@ -478,12 +475,10 @@ e_zone_flip_coords_handle(E_Zone *zone, int x, int y)
cx = next_zone->x;
cy = next_zone->y;
zones = eina_list_next(zones);
- while (zones)
+ EINA_LIST_FOREACH(eina_list_next(zones), zones, next_zone)
{
- next_zone = (E_Zone *)zones->data;
if (next_zone->x != cx) one_col = 0;
if (next_zone->y != cy) one_row = 0;
- zones = zones->next;
}
}
if (eina_list_count(zone->container->manager->containers) > 1)
@@ -771,18 +766,14 @@ e_zone_flip_win_disable(void)
Eina_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
+ E_Zone *zone;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- con = ll->data;
- for (lll = con->zones; lll; lll = lll->next)
+ EINA_LIST_FOREACH(con->zones, lll, zone)
{
- E_Zone *zone;
-
- zone = lll->data;
ecore_x_window_hide(zone->edge.left);
ecore_x_window_hide(zone->edge.right);
ecore_x_window_hide(zone->edge.top);
@@ -806,18 +797,14 @@ e_zone_flip_win_restore(void)
Eina_List *l, *ll, *lll;
E_Manager *man;
E_Container *con;
+ E_Zone *zone;
- for (l = e_manager_list(); l; l = l->next)
+ EINA_LIST_FOREACH(e_manager_list(), l, man)
{
- man = l->data;
- for (ll = man->containers; ll; ll = ll->next)
+ EINA_LIST_FOREACH(man->containers, ll, con)
{
- con = ll->data;
- for (lll = con->zones; lll; lll = lll->next)
+ EINA_LIST_FOREACH(con->zones, lll, zone)
{
- E_Zone *zone;
-
- zone = lll->data;
ecore_x_window_show(zone->edge.left);
ecore_x_window_show(zone->edge.right);
ecore_x_window_show(zone->edge.top);
@@ -946,7 +933,6 @@ static void
_e_zone_free(E_Zone *zone)
{
E_Container *con;
- Eina_List *l;
Ecore_Animator *anim;
void *data;
int x, y;
@@ -985,15 +971,7 @@ _e_zone_free(E_Zone *zone)
}
/* remove handlers */
- for (l = zone->handlers; l; l = l->next)
- {
- Ecore_Event_Handler *h;
-
- h = l->data;
- ecore_event_handler_del(h);
- }
- eina_list_free(zone->handlers);
- zone->handlers = NULL;
+ E_FREE_LIST(zone->handlers, ecore_event_handler_del);
con = zone->container;
if (zone->name) eina_stringshare_del(zone->name);