From ec8b606614faf05b419226e816e96a4037a9e05c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 30 Jan 2018 13:12:32 -0500 Subject: [PATCH] add macro for adding a prepended event handler to a list --- src/bin/e_macros.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bin/e_macros.h b/src/bin/e_macros.h index 44f68b6cf..1e890432e 100644 --- a/src/bin/e_macros.h +++ b/src/bin/e_macros.h @@ -100,6 +100,15 @@ list = eina_list_append(list, _eh); \ } \ while (0) +# define E_LIST_HANDLER_APPEND_PRE(list, type, callback, data) \ + do \ + { \ + Ecore_Event_Handler *_eh; \ + _eh = ecore_event_handler_prepend(type, (Ecore_Event_Handler_Cb)callback, data); \ + assert(_eh); \ + list = eina_list_append(list, _eh); \ + } \ + while (0) # define E_CLAMP(x, min, max) (x < min ? min : (x > max ? max : x)) # define E_RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \