eolian-cxx: Fix C++ events with new Eo_Event_Cb signature

This commit is contained in:
Felipe Magno de Almeida 2016-02-29 11:01:04 -03:00
parent 9ad7ddbcd4
commit d40b046685
5 changed files with 10 additions and 14 deletions

View File

@ -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;
}

View File

@ -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))>());
}
}

View File

@ -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;
})

View File

@ -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;

View File

@ -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;