From 81b723aa986fac4cddb62b1a1b0884507776d72f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 19 Feb 2013 12:51:38 +0000 Subject: [PATCH] add E_LIST_REVERSE_FREE --- ChangeLog | 1 + NEWS | 1 + src/bin/e.h | 16 +++++++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c41b9de8..c0e8adb0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2013-02-22 Mike Blumenkrantz * compositor now allows user changing/remembering of object opacity + * added E_LIST_REVERSE_FREE macro 2013-02-20 Mike Blumenkrantz diff --git a/NEWS b/NEWS index 810131707..4555eff3d 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,7 @@ Additions: * added utility function for printing all objects above a given object * added e_layout functions for returning objects above or below a layout child * added functions for noting objects which are part of a popup + * added E_LIST_REVERSE_FREE macro Config: * Added option for disabling icons in menus * Added option for disabling pointer warping when performing directional focus changes using winlist diff --git a/src/bin/e.h b/src/bin/e.h index 42d87f35c..2aa39ac09 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -174,6 +174,11 @@ typedef struct _E_Rect E_Rect; #ifndef MAX # define MAX(x, y) (((x) > (y)) ? (x) : (y)) #endif + +#if (EINA_VERSION_MAJOR == 1) && (EINA_VERSION_MINOR < 8) +# define eina_list_last_data_get(X) eina_list_data_get(eina_list_last(X)) +#endif + # define E_FN_DEL(_fn, _h) do { if (_h) { _fn((void*)_h); _h = NULL; } } while (0) # define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) \ (((x) < ((xx) + (ww))) && ((y) < ((yy) + (hh))) && (((x) + (w)) > (xx)) && (((y) + (h)) > (yy))) @@ -198,6 +203,12 @@ typedef struct _E_Rect E_Rect; } \ while (0) +# define E_LIST_REVERSE_FREE(list, data) \ + for (data = eina_list_last_data_get(list); \ + list; \ + list = eina_list_remove_list(list, eina_list_last(list)), \ + data = eina_list_last_data_get(list)) + # define E_LIST_FOREACH(list, func) \ do \ { \ @@ -248,11 +259,6 @@ typedef struct _E_Rect E_Rect; } \ } - -#if (EINA_VERSION_MAJOR == 1) && (EINA_VERSION_MINOR < 8) -# define eina_list_last_data_get(X) eina_list_data_get(eina_list_last(X)) -#endif - # define E_REMOTE_OPTIONS 1 # define E_REMOTE_OUT 2 # define E_WM_IN 3