eolian_mono: add more verbs to generate C# method beginning with verb
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Fri, 20 Sep 2019 22:14:02 +0000 (19:14 -0300)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 22 Sep 2019 21:11:58 +0000 (06:11 +0900)
Summary:
C# language binding generates C# method name beginning with verb by
checking verb list in name_helpers.hh.

Some verbs used in eo method are missing in the current verb list. So
they are added into the verb list.

In this scheme, there is a problem that some words can be used as a verb
in some methods but they also can be used as a noun in other methods.
(e.g. drag_start as a verb / cursor_word_start as a noun)

So "start" and "scroll" are not added to verb list in this patch.
To resolve the above problem, we may need a new eo syntax to rename or
reverse the name in language bindings.

Test Plan: Check C# method names in .eo.cs files if the name begins with verb.

Reviewers: felipealmeida, SanghyeonLee, woohyun, Jaehyun_Cho, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10001

src/bin/eolian_mono/eolian/mono/name_helpers.hh
src/bindings/mono/efl_mono/Bind.cs
src/tests/efl_mono/Parts.cs

index b206311..e68de6b 100644 (file)
@@ -123,7 +123,42 @@ static const std::vector<std::string> verbs =
     "unpack",
     "emit",
     "call",
-    "append"
+    "append",
+    "apply",
+    "bind",
+    "cancel",
+    "copy",
+    "create",
+    "cut",
+    "delete",
+    "deselect",
+    "detach",
+    "do",
+    "gen",
+    "insert",
+    "iterate",
+    "join",
+    "leave",
+    "limit",
+    "paste",
+    "parse",
+    "prepend",
+    "process",
+    "query",
+    "refresh",
+    "remove",
+    "register",
+    "reject",
+    "release",
+    "reply",
+    "send",
+    "select",
+    "serialize",
+    "steal",
+    "sync",
+    "toggle",
+    "unbind",
+    "unregister"
   };
 
 const std::vector<std::string> not_verbs =
index 1d29c25..14c45d9 100644 (file)
@@ -37,7 +37,7 @@ public class BindableProperty<T>
     {
         if (this.partName == null)
         {
-            return this.binder.PropertyBind(this.propertyName, modelProperty);
+            return this.binder.BindProperty(this.propertyName, modelProperty);
         }
         else
         {
@@ -59,7 +59,7 @@ public class BindableProperty<T>
             var partBinder = partMethod.Invoke(partHolder, new System.Object[] { this.partName }) as Efl.Ui.IPropertyBind;
             if (partBinder != null)
             {
-                return partBinder.PropertyBind(this.propertyName, modelProperty);
+                return partBinder.BindProperty(this.propertyName, modelProperty);
             }
             else
             {
@@ -112,7 +112,7 @@ public class BindableFactoryPart<T>
     /// <summary>Binds the given factory to this part.</summary>
     public Eina.Error BindFactory(Efl.Ui.IFactory factory)
     {
-        this.Binder.FactoryBind(this.PartName, factory);
+        this.Binder.BindFactory(this.PartName, factory);
         return Eina.Error.NO_ERROR;
     }
 }
index a27c1b4..14743ac 100644 (file)
@@ -55,7 +55,7 @@ public static class TestMVVMParts
     {
         var factory = new Efl.Ui.ItemFactory<Efl.Ui.ListDefaultItem>();
         var iconFactory = new Efl.Ui.ImageFactory(null);
-        iconFactory.PropertyBind("filename", "modelProperty");
+        iconFactory.BindProperty("filename", "modelProperty");
         var error = factory.IconPart().BindFactory(iconFactory);
 
         Test.AssertEquals(error, Eina.Error.NO_ERROR);