felipealmeida pushed a commit to branch master.

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

commit d40b046685263b1a3afec595dc08b91e2dcc9371
Author: Felipe Magno de Almeida <fel...@expertisesolutions.com.br>
Date:   Mon Feb 29 11:01:04 2016 -0300

    eolian-cxx: Fix C++ events with new Eo_Event_Cb signature
---
 src/bindings/eo_cxx/eo_cxx_interop.hh                         | 6 ++----
 src/bindings/eo_cxx/eo_event.hh                               | 8 ++++----
 src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh | 2 +-
 src/lib/eolian_cxx/grammar/parameters_generator.hh            | 2 +-
 src/tests/eolian_cxx/callback.c                               | 6 ++----
 5 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/bindings/eo_cxx/eo_cxx_interop.hh 
b/src/bindings/eo_cxx/eo_cxx_interop.hh
index e0fd2ed..7cd7b35 100644
--- a/src/bindings/eo_cxx/eo_cxx_interop.hh
+++ b/src/bindings/eo_cxx/eo_cxx_interop.hh
@@ -438,11 +438,9 @@ C get_callback()
 }
 
 template <typename F>
-Eina_Bool free_callback_calback(void* data, Eo* obj EINA_UNUSED
-                                , Eo_Event_Description const* e EINA_UNUSED
-                                , void* event_info EINA_UNUSED)
+Eina_Bool free_callback_callback(void* data, ::Eo_Event2 const*)
 {
-   delete (F*) data;
+   delete static_cast<F*>(data);
    return EO_CALLBACK_CONTINUE;
 }
 
diff --git a/src/bindings/eo_cxx/eo_event.hh b/src/bindings/eo_cxx/eo_event.hh
index 965a2c6..d0b335e 100644
--- a/src/bindings/eo_cxx/eo_event.hh
+++ b/src/bindings/eo_cxx/eo_event.hh
@@ -137,12 +137,12 @@ Eina_Bool really_call_event(T& wrapper, F& f, 
Eo_Event_Description const& desc,
 
 template <typename T, typename F>
 Eina_Bool
-event_callback(void *data, Eo *obj, Eo_Event_Description const* desc, void 
*info)
+event_callback(void *data, ::Eo_Event2 const* event)
 {
-   T wrapper(::eo_ref(obj));
+   T wrapper(::eo_ref(event->obj));
    F *f = static_cast<F*>(data);
-   return _detail::really_call_event(wrapper, *f, *desc, info
-                                     , std::is_void<decltype((*f)(wrapper, 
*desc, info))>());
+   return _detail::really_call_event(wrapper, *f, *event->desc, 
event->event_info
+                                     , std::is_void<decltype((*f)(wrapper, 
*event->desc, event->event_info))>());
 }
 
 }
diff --git a/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh 
b/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh
index ab64936..73847a8 100644
--- a/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh
+++ b/src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh
@@ -174,7 +174,7 @@ operator<<(std::ostream& out, functors_constructor_methods 
const& x)
                       d.out << tab(3)
                             << "eo_do(_eoptr," << endl
                             << tab(4) << 
"eo_event_callback_add(EO_BASE_EVENT_DEL, "
-                            << "&::efl::eolian::free_callback_calback<"
+                            << "&::efl::eolian::free_callback_callback<"
                             << parameter_no_ref_type(d.type, d.name)
                             << ">, " << callback_tmp(d.name) << "));" << endl;
                  })
diff --git a/src/lib/eolian_cxx/grammar/parameters_generator.hh 
b/src/lib/eolian_cxx/grammar/parameters_generator.hh
index 3b59ea0..ecda9d8 100644
--- a/src/lib/eolian_cxx/grammar/parameters_generator.hh
+++ b/src/lib/eolian_cxx/grammar/parameters_generator.hh
@@ -122,7 +122,7 @@ inline std::ostream&
 operator<<(std::ostream& out, callback_parameter_free_ev_add const& x)
 {
    out << "eo_do(" << x._eo_raw_expr
-       << ", eo_event_callback_add(EO_BASE_EVENT_DEL, 
&::efl::eolian::free_callback_calback<"
+       << ", eo_event_callback_add(EO_BASE_EVENT_DEL, 
&::efl::eolian::free_callback_callback<"
        << parameter_no_ref_type(x._type, x._name) << ">, "
        << callback_tmp(x._name) << "));";
    return out;
diff --git a/src/tests/eolian_cxx/callback.c b/src/tests/eolian_cxx/callback.c
index 4ad49ff..c08af89 100644
--- a/src/tests/eolian_cxx/callback.c
+++ b/src/tests/eolian_cxx/callback.c
@@ -17,11 +17,9 @@ typedef struct _Callback_Data Callback_Data;
 
 #define MY_CLASS CALLBACK_CLASS
 
-static Eina_Bool _callback_callback_added(void* data EINA_UNUSED, Eo* obj 
EINA_UNUSED
-                                          , Eo_Event_Description const* e 
EINA_UNUSED
-                                          , void* event_info EINA_UNUSED)
+static Eina_Bool _callback_callback_added(void* data EINA_UNUSED, Eo_Event2 
const* event)
 {
-  Callback_Data* pd = event_info;
+  Callback_Data* pd = event->event_info;
   ++pd->callbacks;
   eo_event_callback_call(CALLBACK_EVENT_CALL_ON_ADD, &pd->callbacks);
   return EINA_TRUE;

-- 


Reply via email to