eolian_mono: change property name from args to Args
authorYeongjong Lee <yj34.lee@samsung.com>
Wed, 29 Jan 2020 04:45:56 +0000 (13:45 +0900)
committerYeongjong Lee <yj34.lee@samsung.com>
Wed, 29 Jan 2020 04:48:20 +0000 (13:48 +0900)
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

src/bin/eolian_mono/eolian/mono/events.hh
src/bindings/mono/efl_mono/efl_csharp_application.cs
src/tests/efl_mono/Events.cs
src/tests/efl_mono/Model.cs

index b6cb4aa..2040a2e 100644 (file)
@@ -170,7 +170,7 @@ struct pack_event_info_and_call_visitor
         {
            return as_generator(
                 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"
               ).generate(sink, attributes::unused, *context);
         }
@@ -190,8 +190,8 @@ struct pack_event_info_and_call_visitor
 
       match const str_table[] =
         {
-           {"string", [] { return "e.arg"; }}
-           , {"stringshare", [] { return "e.arg"; }}
+           {"string", [] { return "e.Arg"; }}
+           , {"stringshare", [] { return "e.Arg"; }}
         };
 
       auto str_accept_func = [&](std::string const& conversion)
@@ -208,9 +208,9 @@ struct pack_event_info_and_call_visitor
 
       match const value_table [] =
         {
-           {"bool", [] { return "e.arg ? (byte) 1 : (byte) 0"; }}
-           , {"Eina.Error", [] { return "(int)e.arg"; }}
-           , {nullptr, [] { return "e.arg"; }}
+           {"bool", [] { return "e.Arg ? (byte) 1 : (byte) 0"; }}
+           , {"Eina.Error", [] { return "(int)e.Arg"; }}
+           , {nullptr, [] { return "e.Arg"; }}
         };
 
       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))
         return *b;
 
-      return value_accept_func("e.args");
+      return value_accept_func("e.Args");
    }
    bool operator()(grammar::attributes::klass_name const&) const
    {
       auto const& indent = current_indentation(*context);
       return as_generator(
                           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"
                           ).generate(sink, attributes::unused, *context);
    }
@@ -243,15 +243,15 @@ struct pack_event_info_and_call_visitor
       std::string info_variable;
 
       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")
-        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")
-        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")
-        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
-        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"
                           << indent.inc() << info_variable
                           << 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"
                         << 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"
                  ).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context))
         return false;
@@ -427,7 +427,7 @@ struct event_definition_generator
            auto sub_context = change_indentation(indent.inc().inc(), context);
 
            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;
            if (!(*etype).original_type.visit(unpack_event_args_visitor<decltype(arg_initializer_sink), decltype(sub_context)>{arg_initializer_sink, &sub_context, *etype}))
              return false;
index f016f7b..bfed035 100644 (file)
@@ -210,9 +210,9 @@ public abstract class Application
 #endif
         app.Arguments += (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;
                 var argv = new string[n];
                 for (int i = 0; i < n; ++i)
@@ -223,7 +223,7 @@ public abstract class Application
                 OnInitialize(argv);
             }
 
-            OnArguments(evt.arg);
+            OnArguments(evt.Arg);
         };
         app.Pause += (object sender, EventArgs e) =>
         {
index 74bf005..d849659 100644 (file)
@@ -70,7 +70,7 @@ class TestEoEvents
         string received_string = null;
 
         obj.EvtWithStringEvent += (object sender, Dummy.TestObjectEvtWithStringEventArgs e) => {
-            received_string = e.arg;
+            received_string = e.Arg;
         };
 
         obj.EmitEventWithString("Some args");
@@ -85,7 +85,7 @@ class TestEoEvents
         int received_int= 0;
 
         obj.EvtWithIntEvent += (object sender, Dummy.TestObjectEvtWithIntEventArgs e) => {
-            received_int = e.arg;
+            received_int = e.Arg;
         };
 
         obj.EmitEventWithInt(-1984);
@@ -100,7 +100,7 @@ class TestEoEvents
         bool received_bool = false;
 
         obj.EvtWithBoolEvent += (object sender, Dummy.TestObjectEvtWithBoolEventArgs e) => {
-            received_bool = e.arg;
+            received_bool = e.Arg;
         };
 
         obj.EmitEventWithBool(true);
@@ -118,7 +118,7 @@ class TestEoEvents
         var obj = new Dummy.TestObject();
         uint received_uint = 0;
         obj.EvtWithUintEvent += (object sender, Dummy.TestObjectEvtWithUintEventArgs e) => {
-            received_uint = e.arg;
+            received_uint = e.Arg;
         };
 
         obj.EmitEventWithUint(0xbeef);
@@ -132,7 +132,7 @@ class TestEoEvents
         var obj = new Dummy.TestObject();
         float received_float = 0;
         obj.EvtWithFloatEvent += (object sender, Dummy.TestObjectEvtWithFloatEventArgs e) => {
-            received_float = e.arg;
+            received_float = e.Arg;
         };
 
         obj.EmitEventWithFloat(3.14f);
@@ -147,7 +147,7 @@ class TestEoEvents
         double received_double = 0;
         double reference = float.MaxValue + 42;
         obj.EvtWithDoubleEvent += (object sender, Dummy.TestObjectEvtWithDoubleEventArgs e) => {
-            received_double = e.arg;
+            received_double = e.Arg;
         };
 
         obj.EmitEventWithDouble(reference);
@@ -162,7 +162,7 @@ class TestEoEvents
         Dummy.TestObject received_obj = null;
 
         obj.EvtWithObjEvent += (object sender, Dummy.TestObjectEvtWithObjEventArgs e) => {
-            received_obj = e.arg;
+            received_obj = e.Arg;
         };
 
         var sent_obj = new Dummy.TestObject();
@@ -180,7 +180,7 @@ class TestEoEvents
         Eina.Error received_error = 0;
 
         obj.EvtWithErrorEvent += (object sender, Dummy.TestObjectEvtWithErrorEventArgs e) => {
-            received_error = e.arg;
+            received_error = e.Arg;
         };
 
         Eina.Error sent_error = -2001;
@@ -197,7 +197,7 @@ class TestEoEvents
         Dummy.StructSimple received_struct = default(Dummy.StructSimple);
 
         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");
@@ -215,7 +215,7 @@ class TestEoEvents
         Dummy.StructComplex received_struct = default(Dummy.StructComplex);
 
         obj.EvtWithStructComplexEvent += (object sender, Dummy.TestObjectEvtWithStructComplexEventArgs e) => {
-            received_struct = e.arg;
+            received_struct = e.Arg;
         };
 
         Dummy.StructComplex sent_struct = StructHelpers.structComplexWithValues();
@@ -238,7 +238,7 @@ class TestEoEvents
         sent.Append("Ghi");
 
         obj.EvtWithArrayEvent += (object sender, Dummy.TestObjectEvtWithArrayEventArgs e) => {
-            received = e.arg as List<string>;
+            received = e.Arg as List<string>;
         };
 
         obj.EmitEventWithArray(sent);
@@ -341,7 +341,7 @@ class TestEventWithDeadWrappers
         // attach to evt with int
         EventHandler<Dummy.TestObjectEvtWithIntEventArgs> cb = (object sender, Dummy.TestObjectEvtWithIntEventArgs args) => {
             callbackCalled = true;
-            received = args.arg;
+            received = args.Arg;
             Test.Assert(Object.ReferenceEquals(sender, wref.Target));
         };
 
index 69596af..008f792 100644 (file)
@@ -73,7 +73,7 @@ public static class TestModel {
         parent.Visible = false;
         var factory = new Efl.Ui.ItemFactory<Efl.Ui.Button>(parent);
         factory.PropertyBoundEvent += (object sender, Efl.Ui.PropertyBindPropertyBoundEventArgs args) => {
-            propertyBound = args.arg;
+            propertyBound = args.Arg;
             callbackCalled = true;
         };