From ca2353437bd81676e9b4671f9bec69c86a6cc127 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Fri, 20 Sep 2019 19:14:02 -0300 Subject: [PATCH] eolian_mono: add more verbs to generate C# method beginning with verb 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 | 37 ++++++++++++++++++++++++- src/bindings/mono/efl_mono/Bind.cs | 6 ++-- src/tests/efl_mono/Parts.cs | 2 +- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index b206311..e68de6b 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -123,7 +123,42 @@ static const std::vector 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 not_verbs = diff --git a/src/bindings/mono/efl_mono/Bind.cs b/src/bindings/mono/efl_mono/Bind.cs index 1d29c25..14c45d9 100644 --- a/src/bindings/mono/efl_mono/Bind.cs +++ b/src/bindings/mono/efl_mono/Bind.cs @@ -37,7 +37,7 @@ public class BindableProperty { 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 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 /// Binds the given factory to this part. 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; } } diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs index a27c1b4..14743ac 100644 --- a/src/tests/efl_mono/Parts.cs +++ b/src/tests/efl_mono/Parts.cs @@ -55,7 +55,7 @@ public static class TestMVVMParts { var factory = new Efl.Ui.ItemFactory(); 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); -- 2.7.4