summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2020-01-29 13:45:56 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-01-29 13:45:56 +0900
commit5ddd384aee818504633825caf0af3afc57dc1e79 (patch)
tree253fa5cba7ea0702aae8ab8357ed9dc8d66c4546 /src
parent46c65ff0db04b6d92c13978815264e43def13205 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh30
-rw-r--r--src/bindings/mono/efl_mono/efl_csharp_application.cs6
-rw-r--r--src/tests/efl_mono/Events.cs24
-rw-r--r--src/tests/efl_mono/Model.cs2
4 files changed, 31 insertions, 31 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
index b6cb4aa511..2040a2ef04 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -170,7 +170,7 @@ struct pack_event_info_and_call_visitor
170 { 170 {
171 return as_generator( 171 return as_generator(
172 indent.inc() << "Contract.Requires(e != null, nameof(e));\n" 172 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
173 << indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n" 173 << indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.Arg));\n"
174 << indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n" 174 << indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
175 ).generate(sink, attributes::unused, *context); 175 ).generate(sink, attributes::unused, *context);
176 } 176 }
@@ -190,8 +190,8 @@ struct pack_event_info_and_call_visitor
190 190
191 match const str_table[] = 191 match const str_table[] =
192 { 192 {
193 {"string", [] { return "e.arg"; }} 193 {"string", [] { return "e.Arg"; }}
194 , {"stringshare", [] { return "e.arg"; }} 194 , {"stringshare", [] { return "e.Arg"; }}
195 }; 195 };
196 196
197 auto str_accept_func = [&](std::string const& conversion) 197 auto str_accept_func = [&](std::string const& conversion)
@@ -208,9 +208,9 @@ struct pack_event_info_and_call_visitor
208 208
209 match const value_table [] = 209 match const value_table [] =
210 { 210 {
211 {"bool", [] { return "e.arg ? (byte) 1 : (byte) 0"; }} 211 {"bool", [] { return "e.Arg ? (byte) 1 : (byte) 0"; }}
212 , {"Eina.Error", [] { return "(int)e.arg"; }} 212 , {"Eina.Error", [] { return "(int)e.Arg"; }}
213 , {nullptr, [] { return "e.arg"; }} 213 , {nullptr, [] { return "e.Arg"; }}
214 }; 214 };
215 215
216 auto value_accept_func = [&](std::string const& conversion) 216 auto value_accept_func = [&](std::string const& conversion)
@@ -225,14 +225,14 @@ struct pack_event_info_and_call_visitor
225 if (eina::optional<bool> b = type_match::get_match(value_table, filter_func, value_accept_func)) 225 if (eina::optional<bool> b = type_match::get_match(value_table, filter_func, value_accept_func))
226 return *b; 226 return *b;
227 227
228 return value_accept_func("e.args"); 228 return value_accept_func("e.Args");
229 } 229 }
230 bool operator()(grammar::attributes::klass_name const&) const 230 bool operator()(grammar::attributes::klass_name const&) const
231 { 231 {
232 auto const& indent = current_indentation(*context); 232 auto const& indent = current_indentation(*context);
233 return as_generator( 233 return as_generator(
234 indent.inc() << "Contract.Requires(e != null, nameof(e));\n" 234 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
235 << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n" 235 << indent.inc() << "IntPtr info = e.Arg.NativeHandle;\n"
236 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n" 236 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
237 ).generate(sink, attributes::unused, *context); 237 ).generate(sink, attributes::unused, *context);
238 } 238 }
@@ -243,15 +243,15 @@ struct pack_event_info_and_call_visitor
243 std::string info_variable; 243 std::string info_variable;
244 244
245 if (type.outer.base_type == "iterator") 245 if (type.outer.base_type == "iterator")
246 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.arg, ") + (is_own ? "true" : "false") + ");\n"; 246 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
247 else if (type.outer.base_type == "accessor") 247 else if (type.outer.base_type == "accessor")
248 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.arg, ") + (is_own ? "true" : "false") + ");\n"; 248 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
249 else if (type.outer.base_type == "array") 249 else if (type.outer.base_type == "array")
250 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.arg, ") + (is_own ? "true" : "false") + ");\n"; 250 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
251 else if (type.outer.base_type == "list") 251 else if (type.outer.base_type == "list")
252 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.arg, ") + (is_own ? "true" : "false") + ");\n"; 252 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.Arg, ") + (is_own ? "true" : "false") + ");\n";
253 else 253 else
254 info_variable = "IntPtr info = e.arg.Handle;\n"; 254 info_variable = "IntPtr info = e.Arg.Handle;\n";
255 return as_generator(indent.inc() << "Contract.Requires(e != null, nameof(e));\n" 255 return as_generator(indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
256 << indent.inc() << info_variable 256 << indent.inc() << info_variable
257 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n" 257 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
@@ -326,7 +326,7 @@ struct event_argument_wrapper_generator
326 326
327 if (!as_generator(scope_tab(2) << "/// </summary>\n" 327 if (!as_generator(scope_tab(2) << "/// </summary>\n"
328 << scope_tab(2) << "/// <value>" << documentation_string << "</value>\n" 328 << scope_tab(2) << "/// <value>" << documentation_string << "</value>\n"
329 << scope_tab(2) << "public " << type << " arg { get; set; }\n" 329 << scope_tab(2) << "public " << type << " Arg { get; set; }\n"
330 << scope_tab << "}\n\n" 330 << scope_tab << "}\n\n"
331 ).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context)) 331 ).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context))
332 return false; 332 return false;
@@ -427,7 +427,7 @@ struct event_definition_generator
427 auto sub_context = change_indentation(indent.inc().inc(), context); 427 auto sub_context = change_indentation(indent.inc().inc(), context);
428 428
429 if (!as_generator(", info => new " << wrapper_args_type << "{ " 429 if (!as_generator(", info => new " << wrapper_args_type << "{ "
430 << "arg = ").generate(arg_initializer_sink, attributes::unused, context)) 430 << "Arg = ").generate(arg_initializer_sink, attributes::unused, context))
431 return false; 431 return false;
432 if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype})) 432 if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype}))
433 return false; 433 return false;
diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs
index c4abdfe76c..1cf5d0d07b 100644
--- a/src/bindings/mono/efl_mono/efl_csharp_application.cs
+++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs
@@ -206,9 +206,9 @@ public abstract class Application
206#endif 206#endif
207 app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) => 207 app.ArgumentsEvent += (object sender, LoopArgumentsEventArgs evt) =>
208 { 208 {
209 if (evt.arg.Initialization) 209 if (evt.Arg.Initialization)
210 { 210 {
211 var evtArgv = evt.arg.Argv; 211 var evtArgv = evt.Arg.Argv;
212 int n = evtArgv.Count; 212 int n = evtArgv.Count;
213 var argv = new string[n]; 213 var argv = new string[n];
214 for (int i = 0; i < n; ++i) 214 for (int i = 0; i < n; ++i)
@@ -219,7 +219,7 @@ public abstract class Application
219 OnInitialize(argv); 219 OnInitialize(argv);
220 } 220 }
221 221
222 OnArguments(evt.arg); 222 OnArguments(evt.Arg);
223 }; 223 };
224 app.PauseEvent += (object sender, EventArgs e) => 224 app.PauseEvent += (object sender, EventArgs e) =>
225 { 225 {
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs
index 2abcc98b63..20c4b4491d 100644
--- a/src/tests/efl_mono/Events.cs
+++ b/src/tests/efl_mono/Events.cs
@@ -66,7 +66,7 @@ class TestEoEvents
66 string received_string = null; 66 string received_string = null;
67 67
68 obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => { 68 obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => {
69 received_string = e.arg; 69 received_string = e.Arg;
70 }; 70 };
71 71
72 obj.EmitEventWithString("Some args"); 72 obj.EmitEventWithString("Some args");
@@ -81,7 +81,7 @@ class TestEoEvents
81 int received_int= 0; 81 int received_int= 0;
82 82
83 obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => { 83 obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => {
84 received_int = e.arg; 84 received_int = e.Arg;
85 }; 85 };
86 86
87 obj.EmitEventWithInt(-1984); 87 obj.EmitEventWithInt(-1984);
@@ -96,7 +96,7 @@ class TestEoEvents
96 bool received_bool = false; 96 bool received_bool = false;
97 97
98 obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => { 98 obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => {
99 received_bool = e.arg; 99 received_bool = e.Arg;
100 }; 100 };
101 101
102 obj.EmitEventWithBool(true); 102 obj.EmitEventWithBool(true);
@@ -114,7 +114,7 @@ class TestEoEvents
114 var obj = new Dummy.TestObject(); 114 var obj = new Dummy.TestObject();
115 uint received_uint = 0; 115 uint received_uint = 0;
116 obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => { 116 obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => {
117 received_uint = e.arg; 117 received_uint = e.Arg;
118 }; 118 };
119 119
120 obj.EmitEventWithUint(0xbeef); 120 obj.EmitEventWithUint(0xbeef);
@@ -128,7 +128,7 @@ class TestEoEvents
128 var obj = new Dummy.TestObject(); 128 var obj = new Dummy.TestObject();
129 float received_float = 0; 129 float received_float = 0;
130 obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => { 130 obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => {
131 received_float = e.arg; 131 received_float = e.Arg;
132 }; 132 };
133 133
134 obj.EmitEventWithFloat(3.14f); 134 obj.EmitEventWithFloat(3.14f);
@@ -143,7 +143,7 @@ class TestEoEvents
143 double received_double = 0; 143 double received_double = 0;
144 double reference = float.MaxValue + 42; 144 double reference = float.MaxValue + 42;
145 obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => { 145 obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => {
146 received_double = e.arg; 146 received_double = e.Arg;
147 }; 147 };
148 148
149 obj.EmitEventWithDouble(reference); 149 obj.EmitEventWithDouble(reference);
@@ -158,7 +158,7 @@ class TestEoEvents
158 Dummy.TestObject received_obj = null; 158 Dummy.TestObject received_obj = null;
159 159
160 obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => { 160 obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => {
161 received_obj = e.arg; 161 received_obj = e.Arg;
162 }; 162 };
163 163
164 var sent_obj = new Dummy.TestObject(); 164 var sent_obj = new Dummy.TestObject();
@@ -176,7 +176,7 @@ class TestEoEvents
176 Eina.Error received_error = 0; 176 Eina.Error received_error = 0;
177 177
178 obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => { 178 obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => {
179 received_error = e.arg; 179 received_error = e.Arg;
180 }; 180 };
181 181
182 Eina.Error sent_error = -2001; 182 Eina.Error sent_error = -2001;
@@ -193,7 +193,7 @@ class TestEoEvents
193 Dummy.StructSimple received_struct = default(Dummy.StructSimple); 193 Dummy.StructSimple received_struct = default(Dummy.StructSimple);
194 194
195 obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => { 195 obj.EvtWithStructEvent += (object sender, Dummy.TestObjectEvtWithStructEventArgs e) => {
196 received_struct = e.arg; 196 received_struct = e.Arg;
197 }; 197 };
198 198
199 Dummy.StructSimple sent_struct = new Dummy.StructSimple(fstring: "Struct Event"); 199 Dummy.StructSimple sent_struct = new Dummy.StructSimple(fstring: "Struct Event");
@@ -211,7 +211,7 @@ class TestEoEvents
211 Dummy.StructComplex received_struct = default(Dummy.StructComplex); 211 Dummy.StructComplex received_struct = default(Dummy.StructComplex);
212 212
213 obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => { 213 obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => {
214 received_struct = e.arg; 214 received_struct = e.Arg;
215 }; 215 };
216 216
217 Dummy.StructComplex sent_struct = StructHelpers.structComplexWithValues(); 217 Dummy.StructComplex sent_struct = StructHelpers.structComplexWithValues();
@@ -234,7 +234,7 @@ class TestEoEvents
234 sent.Append("Ghi"); 234 sent.Append("Ghi");
235 235
236 obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => { 236 obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => {
237 received = e.arg as List<string>; 237 received = e.Arg as List<string>;
238 }; 238 };
239 239
240 obj.EmitEventWithArray(sent); 240 obj.EmitEventWithArray(sent);
@@ -337,7 +337,7 @@ class TestEventWithDeadWrappers
337 // attach to evt with int 337 // attach to evt with int
338 EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => { 338 EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => {
339 callbackCalled = true; 339 callbackCalled = true;
340 received = args.arg; 340 received = args.Arg;
341 Test.Assert(Object.ReferenceEquals(sender, wref.Target)); 341 Test.Assert(Object.ReferenceEquals(sender, wref.Target));
342 }; 342 };
343 343
diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs
index 69596af25d..008f79291b 100644
--- a/src/tests/efl_mono/Model.cs
+++ b/src/tests/efl_mono/Model.cs
@@ -73,7 +73,7 @@ public static class TestModel {
73 parent.Visible = false; 73 parent.Visible = false;
74 var factory = new Efl.Ui.ItemFactory<Efl.Ui.Button>(parent); 74 var factory = new Efl.Ui.ItemFactory<Efl.Ui.Button>(parent);
75 factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => { 75 factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => {
76 propertyBound = args.arg; 76 propertyBound = args.Arg;
77 callbackCalled = true; 77 callbackCalled = true;
78 }; 78 };
79 79