summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-02-29 11:01:04 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2016-02-29 11:01:04 -0300
commitd40b046685263b1a3afec595dc08b91e2dcc9371 (patch)
treeeb77ed2b7cdb8fa4d0e6b731c51633a87ad194c3
parent9ad7ddbcd425702077b7cbf17c9de0f97e1ec956 (diff)
eolian-cxx: Fix C++ events with new Eo_Event_Cb signature
-rw-r--r--src/bindings/eo_cxx/eo_cxx_interop.hh6
-rw-r--r--src/bindings/eo_cxx/eo_event.hh8
-rw-r--r--src/lib/eolian_cxx/grammar/eo_class_constructors_generator.hh2
-rw-r--r--src/lib/eolian_cxx/grammar/parameters_generator.hh2
-rw-r--r--src/tests/eolian_cxx/callback.c6
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 e0fd2ed355..7cd7b3577b 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()
438} 438}
439 439
440template <typename F> 440template <typename F>
441Eina_Bool free_callback_calback(void* data, Eo* obj EINA_UNUSED 441Eina_Bool free_callback_callback(void* data, ::Eo_Event2 const*)
442 , Eo_Event_Description const* e EINA_UNUSED
443 , void* event_info EINA_UNUSED)
444{ 442{
445 delete (F*) data; 443 delete static_cast<F*>(data);
446 return EO_CALLBACK_CONTINUE; 444 return EO_CALLBACK_CONTINUE;
447} 445}
448 446
diff --git a/src/bindings/eo_cxx/eo_event.hh b/src/bindings/eo_cxx/eo_event.hh
index 965a2c6697..d0b335e0e5 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,
137 137
138template <typename T, typename F> 138template <typename T, typename F>
139Eina_Bool 139Eina_Bool
140event_callback(void *data, Eo *obj, Eo_Event_Description const* desc, void *info) 140event_callback(void *data, ::Eo_Event2 const* event)
141{ 141{
142 T wrapper(::eo_ref(obj)); 142 T wrapper(::eo_ref(event->obj));
143 F *f = static_cast<F*>(data); 143 F *f = static_cast<F*>(data);
144 return _detail::really_call_event(wrapper, *f, *desc, info 144 return _detail::really_call_event(wrapper, *f, *event->desc, event->event_info
145 , std::is_void<decltype((*f)(wrapper, *desc, info))>()); 145 , std::is_void<decltype((*f)(wrapper, *event->desc, event->event_info))>());
146} 146}
147 147
148} 148}
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 ab64936a84..73847a8c39 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)
174 d.out << tab(3) 174 d.out << tab(3)
175 << "eo_do(_eoptr," << endl 175 << "eo_do(_eoptr," << endl
176 << tab(4) << "eo_event_callback_add(EO_BASE_EVENT_DEL, " 176 << tab(4) << "eo_event_callback_add(EO_BASE_EVENT_DEL, "
177 << "&::efl::eolian::free_callback_calback<" 177 << "&::efl::eolian::free_callback_callback<"
178 << parameter_no_ref_type(d.type, d.name) 178 << parameter_no_ref_type(d.type, d.name)
179 << ">, " << callback_tmp(d.name) << "));" << endl; 179 << ">, " << callback_tmp(d.name) << "));" << endl;
180 }) 180 })
diff --git a/src/lib/eolian_cxx/grammar/parameters_generator.hh b/src/lib/eolian_cxx/grammar/parameters_generator.hh
index 3b59ea0a64..ecda9d8e2a 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&
122operator<<(std::ostream& out, callback_parameter_free_ev_add const& x) 122operator<<(std::ostream& out, callback_parameter_free_ev_add const& x)
123{ 123{
124 out << "eo_do(" << x._eo_raw_expr 124 out << "eo_do(" << x._eo_raw_expr
125 << ", eo_event_callback_add(EO_BASE_EVENT_DEL, &::efl::eolian::free_callback_calback<" 125 << ", eo_event_callback_add(EO_BASE_EVENT_DEL, &::efl::eolian::free_callback_callback<"
126 << parameter_no_ref_type(x._type, x._name) << ">, " 126 << parameter_no_ref_type(x._type, x._name) << ">, "
127 << callback_tmp(x._name) << "));"; 127 << callback_tmp(x._name) << "));";
128 return out; 128 return out;
diff --git a/src/tests/eolian_cxx/callback.c b/src/tests/eolian_cxx/callback.c
index 4ad49fff52..c08af8915d 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;
17 17
18#define MY_CLASS CALLBACK_CLASS 18#define MY_CLASS CALLBACK_CLASS
19 19
20static Eina_Bool _callback_callback_added(void* data EINA_UNUSED, Eo* obj EINA_UNUSED 20static Eina_Bool _callback_callback_added(void* data EINA_UNUSED, Eo_Event2 const* event)
21 , Eo_Event_Description const* e EINA_UNUSED
22 , void* event_info EINA_UNUSED)
23{ 21{
24 Callback_Data* pd = event_info; 22 Callback_Data* pd = event->event_info;
25 ++pd->callbacks; 23 ++pd->callbacks;
26 eo_event_callback_call(CALLBACK_EVENT_CALL_ON_ADD, &pd->callbacks); 24 eo_event_callback_call(CALLBACK_EVENT_CALL_ON_ADD, &pd->callbacks);
27 return EINA_TRUE; 25 return EINA_TRUE;