forked from enlightenment/efl
eolian_mono: change property name from args to Args
Summary: PascalCasing is always used for property names. Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: woohyun, felipealmeida, segfaultxavi Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11149
This commit is contained in:
parent
46c65ff0db
commit
5ddd384aee
|
@ -170,7 +170,7 @@ struct pack_event_info_and_call_visitor
|
||||||
{
|
{
|
||||||
return as_generator(
|
return as_generator(
|
||||||
indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
|
indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
|
||||||
<< indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n"
|
<< indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.Arg));\n"
|
||||||
<< indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
|
<< indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
|
||||||
).generate(sink, attributes::unused, *context);
|
).generate(sink, attributes::unused, *context);
|
||||||
}
|
}
|
||||||
|
@ -190,8 +190,8 @@ struct pack_event_info_and_call_visitor
|
||||||
|
|
||||||
match const str_table[] =
|
match const str_table[] =
|
||||||
{
|
{
|
||||||
{"string", [] { return "e.arg"; }}
|
{"string", [] { return "e.Arg"; }}
|
||||||
, {"stringshare", [] { return "e.arg"; }}
|
, {"stringshare", [] { return "e.Arg"; }}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto str_accept_func = [&](std::string const& conversion)
|
auto str_accept_func = [&](std::string const& conversion)
|
||||||
|
@ -208,9 +208,9 @@ struct pack_event_info_and_call_visitor
|
||||||
|
|
||||||
match const value_table [] =
|
match const value_table [] =
|
||||||
{
|
{
|
||||||
{"bool", [] { return "e.arg ? (byte) 1 : (byte) 0"; }}
|
{"bool", [] { return "e.Arg ? (byte) 1 : (byte) 0"; }}
|
||||||
, {"Eina.Error", [] { return "(int)e.arg"; }}
|
, {"Eina.Error", [] { return "(int)e.Arg"; }}
|
||||||
, {nullptr, [] { return "e.arg"; }}
|
, {nullptr, [] { return "e.Arg"; }}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto value_accept_func = [&](std::string const& conversion)
|
auto value_accept_func = [&](std::string const& conversion)
|
||||||
|
@ -225,14 +225,14 @@ struct pack_event_info_and_call_visitor
|
||||||
if (eina::optional<bool> b = type_match::get_match(value_table, filter_func, value_accept_func))
|
if (eina::optional<bool> b = type_match::get_match(value_table, filter_func, value_accept_func))
|
||||||
return *b;
|
return *b;
|
||||||
|
|
||||||
return value_accept_func("e.args");
|
return value_accept_func("e.Args");
|
||||||
}
|
}
|
||||||
bool operator()(grammar::attributes::klass_name const&) const
|
bool operator()(grammar::attributes::klass_name const&) const
|
||||||
{
|
{
|
||||||
auto const& indent = current_indentation(*context);
|
auto const& indent = current_indentation(*context);
|
||||||
return as_generator(
|
return as_generator(
|
||||||
indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
|
indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
|
||||||
<< indent.inc() << "IntPtr info = e.arg.NativeHandle;\n"
|
<< indent.inc() << "IntPtr info = e.Arg.NativeHandle;\n"
|
||||||
<< indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
|
<< indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
|
||||||
).generate(sink, attributes::unused, *context);
|
).generate(sink, attributes::unused, *context);
|
||||||
}
|
}
|
||||||
|
@ -243,15 +243,15 @@ struct pack_event_info_and_call_visitor
|
||||||
std::string info_variable;
|
std::string info_variable;
|
||||||
|
|
||||||
if (type.outer.base_type == "iterator")
|
if (type.outer.base_type == "iterator")
|
||||||
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.arg, ") + (is_own ? "true" : "false") + ");\n";
|
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
|
||||||
else if (type.outer.base_type == "accessor")
|
else if (type.outer.base_type == "accessor")
|
||||||
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.arg, ") + (is_own ? "true" : "false") + ");\n";
|
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
|
||||||
else if (type.outer.base_type == "array")
|
else if (type.outer.base_type == "array")
|
||||||
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.arg, ") + (is_own ? "true" : "false") + ");\n";
|
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
|
||||||
else if (type.outer.base_type == "list")
|
else if (type.outer.base_type == "list")
|
||||||
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.arg, ") + (is_own ? "true" : "false") + ");\n";
|
info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
|
||||||
else
|
else
|
||||||
info_variable = "IntPtr info = e.arg.Handle;\n";
|
info_variable = "IntPtr info = e.Arg.Handle;\n";
|
||||||
return as_generator(indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
|
return as_generator(indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
|
||||||
<< indent.inc() << info_variable
|
<< indent.inc() << info_variable
|
||||||
<< indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
|
<< indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
|
||||||
|
@ -326,7 +326,7 @@ struct event_argument_wrapper_generator
|
||||||
|
|
||||||
if (!as_generator(scope_tab(2) << "/// </summary>\n"
|
if (!as_generator(scope_tab(2) << "/// </summary>\n"
|
||||||
<< scope_tab(2) << "/// <value>" << documentation_string << "</value>\n"
|
<< scope_tab(2) << "/// <value>" << documentation_string << "</value>\n"
|
||||||
<< scope_tab(2) << "public " << type << " arg { get; set; }\n"
|
<< scope_tab(2) << "public " << type << " Arg { get; set; }\n"
|
||||||
<< scope_tab << "}\n\n"
|
<< scope_tab << "}\n\n"
|
||||||
).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context))
|
).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context))
|
||||||
return false;
|
return false;
|
||||||
|
@ -427,7 +427,7 @@ struct event_definition_generator
|
||||||
auto sub_context = change_indentation(indent.inc().inc(), context);
|
auto sub_context = change_indentation(indent.inc().inc(), context);
|
||||||
|
|
||||||
if (!as_generator(", info => new " << wrapper_args_type << "{ "
|
if (!as_generator(", info => new " << wrapper_args_type << "{ "
|
||||||
<< "arg = ").generate(arg_initializer_sink, attributes::unused, context))
|
<< "Arg = ").generate(arg_initializer_sink, attributes::unused, context))
|
||||||
return false;
|
return false;
|
||||||
if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype}))
|
if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype}))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -206,9 +206,9 @@ public abstract class Application
|
||||||
#endif
|
#endif
|
||||||
app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) =>
|
app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) =>
|
||||||
{
|
{
|
||||||
if (evt.arg.Initialization)
|
if (evt.Arg.Initialization)
|
||||||
{
|
{
|
||||||
var evtArgv = evt.arg.Argv;
|
var evtArgv = evt.Arg.Argv;
|
||||||
int n = evtArgv.Count;
|
int n = evtArgv.Count;
|
||||||
var argv = new string[n];
|
var argv = new string[n];
|
||||||
for (int i = 0; i < n; ++i)
|
for (int i = 0; i < n; ++i)
|
||||||
|
@ -219,7 +219,7 @@ public abstract class Application
|
||||||
OnInitialize(argv);
|
OnInitialize(argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
OnArguments(evt.arg);
|
OnArguments(evt.Arg);
|
||||||
};
|
};
|
||||||
app.PauseEvent += (object sender, EventArgs e) =>
|
app.PauseEvent += (object sender, EventArgs e) =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,7 +66,7 @@ class TestEoEvents
|
||||||
string received_string = null;
|
string received_string = null;
|
||||||
|
|
||||||
obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => {
|
obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => {
|
||||||
received_string = e.arg;
|
received_string = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithString("Some args");
|
obj.EmitEventWithString("Some args");
|
||||||
|
@ -81,7 +81,7 @@ class TestEoEvents
|
||||||
int received_int= 0;
|
int received_int= 0;
|
||||||
|
|
||||||
obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => {
|
obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => {
|
||||||
received_int = e.arg;
|
received_int = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithInt(-1984);
|
obj.EmitEventWithInt(-1984);
|
||||||
|
@ -96,7 +96,7 @@ class TestEoEvents
|
||||||
bool received_bool = false;
|
bool received_bool = false;
|
||||||
|
|
||||||
obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => {
|
obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => {
|
||||||
received_bool = e.arg;
|
received_bool = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithBool(true);
|
obj.EmitEventWithBool(true);
|
||||||
|
@ -114,7 +114,7 @@ class TestEoEvents
|
||||||
var obj = new Dummy.TestObject();
|
var obj = new Dummy.TestObject();
|
||||||
uint received_uint = 0;
|
uint received_uint = 0;
|
||||||
obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => {
|
obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => {
|
||||||
received_uint = e.arg;
|
received_uint = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithUint(0xbeef);
|
obj.EmitEventWithUint(0xbeef);
|
||||||
|
@ -128,7 +128,7 @@ class TestEoEvents
|
||||||
var obj = new Dummy.TestObject();
|
var obj = new Dummy.TestObject();
|
||||||
float received_float = 0;
|
float received_float = 0;
|
||||||
obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => {
|
obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => {
|
||||||
received_float = e.arg;
|
received_float = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithFloat(3.14f);
|
obj.EmitEventWithFloat(3.14f);
|
||||||
|
@ -143,7 +143,7 @@ class TestEoEvents
|
||||||
double received_double = 0;
|
double received_double = 0;
|
||||||
double reference = float.MaxValue + 42;
|
double reference = float.MaxValue + 42;
|
||||||
obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => {
|
obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => {
|
||||||
received_double = e.arg;
|
received_double = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithDouble(reference);
|
obj.EmitEventWithDouble(reference);
|
||||||
|
@ -158,7 +158,7 @@ class TestEoEvents
|
||||||
Dummy.TestObject received_obj = null;
|
Dummy.TestObject received_obj = null;
|
||||||
|
|
||||||
obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => {
|
obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => {
|
||||||
received_obj = e.arg;
|
received_obj = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
var sent_obj = new Dummy.TestObject();
|
var sent_obj = new Dummy.TestObject();
|
||||||
|
@ -176,7 +176,7 @@ class TestEoEvents
|
||||||
Eina.Error received_error = 0;
|
Eina.Error received_error = 0;
|
||||||
|
|
||||||
obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => {
|
obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => {
|
||||||
received_error = e.arg;
|
received_error = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
Eina.Error sent_error = -2001;
|
Eina.Error sent_error = -2001;
|
||||||
|
@ -193,7 +193,7 @@ class TestEoEvents
|
||||||
Dummy.StructSimple received_struct = default(Dummy.StructSimple);
|
Dummy.StructSimple received_struct = default(Dummy.StructSimple);
|
||||||
|
|
||||||
obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => {
|
obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => {
|
||||||
received_struct = e.arg;
|
received_struct = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
Dummy.StructSimple sent_struct = new Dummy.StructSimple(fstring: "Struct Event");
|
Dummy.StructSimple sent_struct = new Dummy.StructSimple(fstring: "Struct Event");
|
||||||
|
@ -211,7 +211,7 @@ class TestEoEvents
|
||||||
Dummy.StructComplex received_struct = default(Dummy.StructComplex);
|
Dummy.StructComplex received_struct = default(Dummy.StructComplex);
|
||||||
|
|
||||||
obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => {
|
obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => {
|
||||||
received_struct = e.arg;
|
received_struct = e.Arg;
|
||||||
};
|
};
|
||||||
|
|
||||||
Dummy.StructComplex sent_struct = StructHelpers.structComplexWithValues();
|
Dummy.StructComplex sent_struct = StructHelpers.structComplexWithValues();
|
||||||
|
@ -234,7 +234,7 @@ class TestEoEvents
|
||||||
sent.Append("Ghi");
|
sent.Append("Ghi");
|
||||||
|
|
||||||
obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => {
|
obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => {
|
||||||
received = e.arg as List<string>;
|
received = e.Arg as List<string>;
|
||||||
};
|
};
|
||||||
|
|
||||||
obj.EmitEventWithArray(sent);
|
obj.EmitEventWithArray(sent);
|
||||||
|
@ -337,7 +337,7 @@ class TestEventWithDeadWrappers
|
||||||
// attach to evt with int
|
// attach to evt with int
|
||||||
EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => {
|
EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => {
|
||||||
callbackCalled = true;
|
callbackCalled = true;
|
||||||
received = args.arg;
|
received = args.Arg;
|
||||||
Test.Assert(Object.ReferenceEquals(sender, wref.Target));
|
Test.Assert(Object.ReferenceEquals(sender, wref.Target));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ public static class TestModel {
|
||||||
parent.Visible = false;
|
parent.Visible = false;
|
||||||
var factory = new Efl.Ui.ItemFactory<Efl.Ui.Button>(parent);
|
var factory = new Efl.Ui.ItemFactory<Efl.Ui.Button>(parent);
|
||||||
factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => {
|
factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => {
|
||||||
propertyBound = args.arg;
|
propertyBound = args.Arg;
|
||||||
callbackCalled = true;
|
callbackCalled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue