jackdanielz pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d95224b5a7552c8f6219e250d0b965282d4b3807

commit d95224b5a7552c8f6219e250d0b965282d4b3807
Author: Daniel Zaoui <[email protected]>
Date:   Mon Oct 27 08:44:02 2014 +0200

    Eo: add function name to the eo_do pre and post hooks.
    
    This is useful to determine the Eolian class/function.
---
 src/bindings/eo_cxx/eo_inherit_bindings.hh |  4 ++--
 src/lib/eo/Eo.h                            | 26 +++++++++++++-------------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/bindings/eo_cxx/eo_inherit_bindings.hh 
b/src/bindings/eo_cxx/eo_inherit_bindings.hh
index 7f7bdf9..e560b06 100644
--- a/src/bindings/eo_cxx/eo_inherit_bindings.hh
+++ b/src/bindings/eo_cxx/eo_inherit_bindings.hh
@@ -250,9 +250,9 @@ EAPI void inherit_constructor(void* this_, Args args)
         return;
      }
    func_t func = (func_t) call.func;
-   EO_HOOK_CALL_PREPARE(eo_hook_call_pre);
+   EO_HOOK_CALL_PREPARE(eo_hook_call_pre, "");
    func(call.obj, call.data, this_, args);
-   EO_HOOK_CALL_PREPARE(eo_hook_call_post);
+   EO_HOOK_CALL_PREPARE(eo_hook_call_post, "");
 }
 
 template <typename T>
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index 21999c6..037b33f 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -476,7 +476,7 @@ typedef struct _Eo_Op_Call_Data
    void     *data;
 } Eo_Op_Call_Data;
 
-typedef void (*Eo_Hook_Call)(const Eo_Class *klass_id, const Eo *obj, void 
*func, ...);
+typedef void (*Eo_Hook_Call)(const Eo_Class *klass_id, const Eo *obj, const 
char *eo_func_name, void *func, ...);
 
 EAPI extern Eo_Hook_Call eo_hook_call_pre;
 EAPI extern Eo_Hook_Call eo_hook_call_post;
@@ -484,13 +484,13 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
 // to pass the internal function call to EO_FUNC_BODY (as Func parameter)
 #define EO_FUNC_CALL(...) __VA_ARGS__
 
-#define EO_HOOK_CALL_PREPARE(Hook)                                     \
+#define EO_HOOK_CALL_PREPARE(Hook, FuncName)                                \
      if (Hook)                                                          \
-       Hook(call.klass, call.obj, call.func);
+       Hook(call.klass, call.obj, FuncName, call.func);
 
-#define EO_HOOK_CALL_PREPAREV(Hook, ...)                               \
+#define EO_HOOK_CALL_PREPAREV(Hook, FuncName, ...)                          \
      if (Hook)                                                          \
-       Hook(call.klass, call.obj, call.func, __VA_ARGS__);
+       Hook(call.klass, call.obj, FuncName, call.func, __VA_ARGS__);
 
 // cache OP id, get real fct and object data then do the call
 #define EO_FUNC_COMMON_OP(Name, DefRet)                                 \
@@ -510,9 +510,9 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
      typedef Ret (*_Eo_##Name##_func)(Eo *, void *obj_data);           \
      Ret _r;                                                            \
      EO_FUNC_COMMON_OP(Name, DefRet);                                  \
-     EO_HOOK_CALL_PREPARE(eo_hook_call_pre);                          \
+     EO_HOOK_CALL_PREPARE(eo_hook_call_pre, #Name);                    \
      _r = _func_(call.obj, call.data);                                  \
-     EO_HOOK_CALL_PREPARE(eo_hook_call_post);                         \
+     EO_HOOK_CALL_PREPARE(eo_hook_call_post, #Name);                    \
      return _r;                                                         \
   }
 
@@ -522,9 +522,9 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
   {                                                                     \
      typedef void (*_Eo_##Name##_func)(Eo *, void *obj_data);          \
      EO_FUNC_COMMON_OP(Name, );                                        \
-     EO_HOOK_CALL_PREPARE(eo_hook_call_pre);                          \
+     EO_HOOK_CALL_PREPARE(eo_hook_call_pre, #Name);                          \
      _func_(call.obj, call.data);                                       \
-     EO_HOOK_CALL_PREPARE(eo_hook_call_post);                         \
+     EO_HOOK_CALL_PREPARE(eo_hook_call_post, #Name);                         \
   }
 
 #define EO_FUNC_BODYV(Name, Ret, DefRet, Arguments, ...)               \
@@ -534,9 +534,9 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
      typedef Ret (*_Eo_##Name##_func)(Eo *, void *obj_data, __VA_ARGS__); \
      Ret _r;                                                            \
      EO_FUNC_COMMON_OP(Name, DefRet);                                  \
-     EO_HOOK_CALL_PREPAREV(eo_hook_call_pre, Arguments);              \
+     EO_HOOK_CALL_PREPAREV(eo_hook_call_pre, #Name, Arguments);              \
      _r = _func_(call.obj, call.data, Arguments);                       \
-     EO_HOOK_CALL_PREPAREV(eo_hook_call_post, Arguments);             \
+     EO_HOOK_CALL_PREPAREV(eo_hook_call_post, #Name, Arguments);             \
      return _r;                                                         \
   }
 
@@ -546,9 +546,9 @@ EAPI extern Eo_Hook_Call eo_hook_call_post;
   {                                                                     \
      typedef void (*_Eo_##Name##_func)(Eo *, void *obj_data, __VA_ARGS__); \
      EO_FUNC_COMMON_OP(Name, );                                        \
-     EO_HOOK_CALL_PREPAREV(eo_hook_call_pre, Arguments);              \
+     EO_HOOK_CALL_PREPAREV(eo_hook_call_pre, #Name, Arguments);              \
      _func_(call.obj, call.data, Arguments);                            \
-     EO_HOOK_CALL_PREPAREV(eo_hook_call_post, Arguments);             \
+     EO_HOOK_CALL_PREPAREV(eo_hook_call_post, #Name, Arguments);             \
   }
 
 // OP ID of an overriding function

-- 


Reply via email to