Summary: Using a simple wrapper as event parameters are not ownable.
Reviewers: vitor.sousa
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7981
}
bool operator()(attributes::complex_type_def const&) const
{
- return as_generator("UNSUPPORTED").generate(sink, attributes::unused, *context);
+ return as_generator("new " << eolian_mono::type << "(evt.Info, false, false)").generate(sink, type, *context);
}
};
using System;
+using System.Linq;
namespace TestSuite
{
Test.AssertEquals(sent_struct.Fobj, received_struct.Fobj);
}
- public static void event_in_init_callback()
+ public static void event_with_list_payload()
{
- int received = 0;
- int sent = 42;
var obj = new Dummy.TestObject();
- obj.EvtWithIntEvt += (object sender, Dummy.TestObjectEvtWithIntEvt_Args e) => {
+ Eina.List<string> received = null;
+ Eina.List<string> sent = new Eina.List<string>();
+
+ sent.Append("Abc");
+ sent.Append("Def");
+ sent.Append("Ghi");
+
+ obj.EvtWithListEvt += (object sender, Dummy.TestObjectEvtWithListEvt_Args e) => {
received = e.arg;
};
- obj.EmitEventWithInt(sent);
+ obj.EmitEventWithList(sent);
- Test.AssertEquals(sent, received);
+ Test.AssertEquals(sent.Length, received.Length);
+ var pairs = sent.Zip(received, (string sentItem, string receivedItem) => new { Sent = sentItem, Received = receivedItem } );
+ foreach (var pair in pairs)
+ Test.AssertEquals(pair.Sent, pair.Received);
}
}
}
}
+ emit_event_with_list {
+ params {
+ @in data: list<string>;
+ }
+ }
+
append_to_strbuf {
params {
@in buf: strbuf;
evt,with,error @hot: Eina.Error;
evt,with,struct @hot: Dummy.StructSimple;
evt,with,struct,complex @hot: Dummy.StructComplex;
+ evt,with,list @hot: list<string>;
}
}
efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_STRUCT_COMPLEX, &data);
}
+void _dummy_test_object_emit_event_with_list(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_List *data)
+{
+ efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_LIST, data);
+}
+
Efl_Object *_dummy_test_object_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const char *name)
{
if (!strcmp(name, "part_one"))