summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/part_definition.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-08-23 14:12:08 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-08-23 14:17:44 -0300
commitf3d9238e15ceb189644e9069ed3a477b9beb3d86 (patch)
tree3d281d38dac4d04e48679ae65efc1184a7ceac92 /src/bin/eolian_mono/eolian/mono/part_definition.hh
parent1aa05ab41be00da32fcc3cc83a95c605dbeb9a58 (diff)
csharp: Add bindable factory parts support
Summary: This commit makes parts that implement `Efl.IContent` use BindFactory instead of property binding. ``` var factory = new Efl.Ui.ItemFactory<Efl.Ui.ListDefaultItem>(); var iconFactory = new Efl.Ui.ImageFactory(null); iconFactory.PropertyBind("filename", "modelProperty"); factory.IconPart().BindFactory(iconFactory); ``` Fixes T7628 Reviewers: cedric, felipealmeida, SanghyeonLee Reviewed By: felipealmeida Tags: #efl Maniphest Tasks: T7628 Differential Revision: https://phab.enlightenment.org/D9653
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/part_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
index ec6ef61551..3569f438d5 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -47,12 +47,19 @@ struct part_extension_method_definition_generator
47 /* auto unit = (const Eolian_Unit*) context_find_tag<eolian_state_context>(context).state; */ 47 /* auto unit = (const Eolian_Unit*) context_find_tag<eolian_state_context>(context).state; */
48 /* auto klass = get_klass(part.klass, unit); */ 48 /* auto klass = get_klass(part.klass, unit); */
49 49
50 std::string bindableClass = "Efl.BindablePart";
51
52 // Efl.Content parts should be bound only throught FactoryBind
53 attributes::klass_def c(get_klass(part.klass, cls.unit), cls.unit);
54 if (helpers::inherits_from(c, "Efl.IContent"))
55 bindableClass = "Efl.BindableFactoryPart";
56
50 if (!as_generator( 57 if (!as_generator(
51 scope_tab << "public static Efl.BindablePart<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<" 58 scope_tab << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<"
52 << name_helpers::klass_full_concrete_or_interface_name(cls) 59 << name_helpers::klass_full_concrete_or_interface_name(cls)
53 << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n" 60 << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n"
54 << scope_tab << "{\n" 61 << scope_tab << "{\n"
55 << scope_tab << scope_tab << "return new Efl.BindablePart<" << part_klass_name << ">(\"" << part.name << "\" ,fac);\n" 62 << scope_tab << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\" ,fac);\n"
56 << scope_tab << "}\n" 63 << scope_tab << "}\n"
57 ).generate(sink, attributes::unused, context)) 64 ).generate(sink, attributes::unused, context))
58 return false; 65 return false;