summaryrefslogtreecommitdiff
path: root/src/bin
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/bin
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/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh30
1 files changed, 15 insertions, 15 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;