forked from enlightenment/efl
eolian-cxx: Fix C++ events with new Eo_Event_Cb signature
This commit is contained in:
parent
9ad7ddbcd4
commit
d40b046685
|
@ -438,11 +438,9 @@ C get_callback()
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename F>
|
template <typename F>
|
||||||
Eina_Bool free_callback_calback(void* data, Eo* obj EINA_UNUSED
|
Eina_Bool free_callback_callback(void* data, ::Eo_Event2 const*)
|
||||||
, Eo_Event_Description const* e EINA_UNUSED
|
|
||||||
, void* event_info EINA_UNUSED)
|
|
||||||
{
|
{
|
||||||
delete (F*) data;
|
delete static_cast<F*>(data);
|
||||||
return EO_CALLBACK_CONTINUE;
|
return EO_CALLBACK_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,12 +137,12 @@ Eina_Bool really_call_event(T& wrapper, F& f, Eo_Event_Description const& desc,
|
||||||
|
|
||||||
template <typename T, typename F>
|
template <typename T, typename F>
|
||||||
Eina_Bool
|
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);
|
F *f = static_cast<F*>(data);
|
||||||
return _detail::really_call_event(wrapper, *f, *desc, info
|
return _detail::really_call_event(wrapper, *f, *event->desc, event->event_info
|
||||||
, std::is_void<decltype((*f)(wrapper, *desc, info))>());
|
, std::is_void<decltype((*f)(wrapper, *event->desc, event->event_info))>());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ operator<<(std::ostream& out, functors_constructor_methods const& x)
|
||||||
d.out << tab(3)
|
d.out << tab(3)
|
||||||
<< "eo_do(_eoptr," << endl
|
<< "eo_do(_eoptr," << endl
|
||||||
<< tab(4) << "eo_event_callback_add(EO_BASE_EVENT_DEL, "
|
<< 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)
|
<< parameter_no_ref_type(d.type, d.name)
|
||||||
<< ">, " << callback_tmp(d.name) << "));" << endl;
|
<< ">, " << callback_tmp(d.name) << "));" << endl;
|
||||||
})
|
})
|
||||||
|
|
|
@ -122,7 +122,7 @@ inline std::ostream&
|
||||||
operator<<(std::ostream& out, callback_parameter_free_ev_add const& x)
|
operator<<(std::ostream& out, callback_parameter_free_ev_add const& x)
|
||||||
{
|
{
|
||||||
out << "eo_do(" << x._eo_raw_expr
|
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) << ">, "
|
<< parameter_no_ref_type(x._type, x._name) << ">, "
|
||||||
<< callback_tmp(x._name) << "));";
|
<< callback_tmp(x._name) << "));";
|
||||||
return out;
|
return out;
|
||||||
|
|
|
@ -17,11 +17,9 @@ typedef struct _Callback_Data Callback_Data;
|
||||||
|
|
||||||
#define MY_CLASS CALLBACK_CLASS
|
#define MY_CLASS CALLBACK_CLASS
|
||||||
|
|
||||||
static Eina_Bool _callback_callback_added(void* data EINA_UNUSED, Eo* obj EINA_UNUSED
|
static Eina_Bool _callback_callback_added(void* data EINA_UNUSED, Eo_Event2 const* event)
|
||||||
, Eo_Event_Description const* e EINA_UNUSED
|
|
||||||
, void* event_info EINA_UNUSED)
|
|
||||||
{
|
{
|
||||||
Callback_Data* pd = event_info;
|
Callback_Data* pd = event->event_info;
|
||||||
++pd->callbacks;
|
++pd->callbacks;
|
||||||
eo_event_callback_call(CALLBACK_EVENT_CALL_ON_ADD, &pd->callbacks);
|
eo_event_callback_call(CALLBACK_EVENT_CALL_ON_ADD, &pd->callbacks);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
Loading…
Reference in New Issue