summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-15 18:45:38 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-15 18:45:38 +0900
commit76631f502a8234c04ed8124bfdebe62ed5bdf954 (patch)
treeabe50c8cf4eb50b64f71516ce811e9928ae6229d
parenta53ef37c5411218091101445e6c1db2035498d7a (diff)
efl_mono: remove class ExtensionTag
Summary: Since class BindablePart and class BindableProperty use generic type constraint as "where T : <class name>", class ExtensionTag is no longer needed. Reviewers: SanghyeonLee, felipealmeida, YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11101
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh10
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh5
-rw-r--r--src/bindings/mono/efl_mono/Bind.cs14
3 files changed, 6 insertions, 23 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index df6f62a2fb..0c2adebe42 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -285,9 +285,8 @@ struct property_extension_method_definition_generator
285 if (property.setter.is_engaged()) 285 if (property.setter.is_engaged())
286 { 286 {
287 attributes::type_def prop_type = property.setter->parameters[0].type; 287 attributes::type_def prop_type = property.setter->parameters[0].type;
288 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<" 288 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.Ui.ItemFactory<T> fac) where T : "
289 << name_helpers::klass_full_concrete_or_interface_name(cls) 289 << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
290 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
291 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n" 290 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n"
292 << scope_tab(2) << "}\n\n" 291 << scope_tab(2) << "}\n\n"
293 ).generate(sink, std::make_tuple(prop_type, prop_type), context)) 292 ).generate(sink, std::make_tuple(prop_type, prop_type), context))
@@ -302,9 +301,8 @@ struct property_extension_method_definition_generator
302 if (property.setter.is_engaged()) 301 if (property.setter.is_engaged())
303 { 302 {
304 attributes::type_def prop_type = property.setter->parameters[0].type; 303 attributes::type_def prop_type = property.setter->parameters[0].type;
305 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.BindablePart<T> part, Efl.Csharp.ExtensionTag<" 304 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.BindablePart<T> part) where T : "
306 << name_helpers::klass_full_concrete_or_interface_name(cls) 305 << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
307 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
308 << scope_tab(2) << scope_tab << "Contract.Requires(part != null, nameof(part));\n" 306 << scope_tab(2) << scope_tab << "Contract.Requires(part != null, nameof(part));\n"
309 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n" 307 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n"
310 << scope_tab(2) << "}\n\n" 308 << scope_tab(2) << "}\n\n"
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
index 4facf27209..d87b0b56ac 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -70,9 +70,8 @@ struct part_extension_method_definition_generator
70 bindableClass = "Efl.BindableFactoryPart"; 70 bindableClass = "Efl.BindableFactoryPart";
71 71
72 if (!as_generator( 72 if (!as_generator(
73 scope_tab(2) << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<" 73 scope_tab(2) << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac) where T : "
74 << name_helpers::klass_full_concrete_or_interface_name(cls) 74 << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n"
75 << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n"
76 << scope_tab(2) << "{\n" 75 << scope_tab(2) << "{\n"
77 << scope_tab(2) << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\", fac);\n" 76 << scope_tab(2) << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\", fac);\n"
78 << scope_tab(2) << "}\n\n" 77 << scope_tab(2) << "}\n\n"
diff --git a/src/bindings/mono/efl_mono/Bind.cs b/src/bindings/mono/efl_mono/Bind.cs
index 2a4fcbded5..302f1dadd2 100644
--- a/src/bindings/mono/efl_mono/Bind.cs
+++ b/src/bindings/mono/efl_mono/Bind.cs
@@ -148,20 +148,6 @@ public class BindableFactoryPart<T>
148 } 148 }
149} 149}
150 150
151namespace Csharp
152{
153
154/// <summary>Helper class to differentiate between factory extension methods.
155///
156/// For internal use only.</summary>
157[EditorBrowsable(EditorBrowsableState.Never)]
158public class ExtensionTag<TBase, TInherited>
159 where TInherited : TBase
160{
161}
162
163}
164
165} 151}
166 152
167#endif 153#endif