summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Efl_Mono.am10
-rw-r--r--src/bin/eolian_mono/eolian/mono/blacklist.hh45
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh12
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_pointer.hh12
-rw-r--r--src/bin/eolian_mono/eolian/mono/helpers.hh7
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh17
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh3
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh4
-rw-r--r--src/bindings/mono/efl_mono/efl_csharp_application.cs2
-rw-r--r--src/bindings/mono/meson.build6
-rw-r--r--src/examples/ecore/efl_mono_loop_timer_example.cs6
-rw-r--r--src/examples/elementary/efl_ui_slider_mono.cs6
-rw-r--r--src/examples/elementary/efl_ui_unit_converter.cs7
-rw-r--r--src/tests/efl_mono/Eo.cs6
-rw-r--r--src/tests/efl_mono/Parts.cs9
-rw-r--r--src/tests/efl_mono/dummy_part_holder.eo13
-rw-r--r--src/tests/efl_mono/dummy_test_object.eo8
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c56
-rw-r--r--src/tests/efl_mono/meson.build2
19 files changed, 180 insertions, 51 deletions
diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am
index e6d330c..91bb1cd 100644
--- a/src/Makefile_Efl_Mono.am
+++ b/src/Makefile_Efl_Mono.am
@@ -67,6 +67,7 @@ efl_mono_test_files = \
67 tests/efl_mono/dummy_test_iface.eo \ 67 tests/efl_mono/dummy_test_iface.eo \
68 tests/efl_mono/dummy_another_iface.eo \ 68 tests/efl_mono/dummy_another_iface.eo \
69 tests/efl_mono/dummy_child.eo \ 69 tests/efl_mono/dummy_child.eo \
70 tests/efl_mono/dummy_part_holder.eo \
70 tests/efl_mono/dummy_numberwrapper.eo \ 71 tests/efl_mono/dummy_numberwrapper.eo \
71 tests/efl_mono/mono_test_driver.sh 72 tests/efl_mono/mono_test_driver.sh
72 73
@@ -177,6 +178,10 @@ lib/elementary/elm_genlist_eo.cs \
177lib/elementary/elm_view_list_eo.cs \ 178lib/elementary/elm_view_list_eo.cs \
178lib/elementary/elm_genlist_item_eo.cs \ 179lib/elementary/elm_genlist_item_eo.cs \
179lib/elementary/elm_gengrid_eo.cs \ 180lib/elementary/elm_gengrid_eo.cs \
181lib/elementary/elm_code_widget.eo.cs \
182lib/elementary/elm_multibuttonentry_part.eo.cs \
183lib/elementary/elm_atspi_bridge.eo.cs \
184lib/elementary/elm_atspi_app_object.eo.cs \
180lib/elementary/elm_glview_eo.cs 185lib/elementary/elm_glview_eo.cs
181 186
182efl_mono_blacklisted_files = \ 187efl_mono_blacklisted_files = \
@@ -406,6 +411,8 @@ tests/efl_mono/libefl_mono_native_test.c: \
406 tests/efl_mono/dummy_another_iface.eo.c \ 411 tests/efl_mono/dummy_another_iface.eo.c \
407 tests/efl_mono/dummy_child.eo.h \ 412 tests/efl_mono/dummy_child.eo.h \
408 tests/efl_mono/dummy_child.eo.c \ 413 tests/efl_mono/dummy_child.eo.c \
414 tests/efl_mono/dummy_part_holder.eo.h \
415 tests/efl_mono/dummy_part_holder.eo.c \
409 tests/efl_mono/dummy_numberwrapper.eo.h \ 416 tests/efl_mono/dummy_numberwrapper.eo.h \
410 tests/efl_mono/dummy_numberwrapper.eo.c \ 417 tests/efl_mono/dummy_numberwrapper.eo.c \
411 tests/efl_mono/dummy_inherit_iface.eo.h \ 418 tests/efl_mono/dummy_inherit_iface.eo.h \
@@ -418,6 +425,7 @@ efl_mono_test_eolian_mono_files = tests/efl_mono/dummy_test_object.eo.cs \
418tests/efl_mono/dummy_test_iface.eo.cs \ 425tests/efl_mono/dummy_test_iface.eo.cs \
419tests/efl_mono/dummy_another_iface.eo.cs \ 426tests/efl_mono/dummy_another_iface.eo.cs \
420tests/efl_mono/dummy_child.eo.cs \ 427tests/efl_mono/dummy_child.eo.cs \
428tests/efl_mono/dummy_part_holder.eo.cs \
421tests/efl_mono/dummy_numberwrapper.eo.cs \ 429tests/efl_mono/dummy_numberwrapper.eo.cs \
422tests/efl_mono/dummy_inherit_iface.eo.cs \ 430tests/efl_mono/dummy_inherit_iface.eo.cs \
423tests/efl_mono/dummy_inherit_helper.eo.cs 431tests/efl_mono/dummy_inherit_helper.eo.cs
@@ -493,7 +501,7 @@ tests/efl_mono/%.eo.cs: tests/efl_mono/%.eo $(_EOLIAN_MONO_DEP)
493 $(MKDIR_P) $(dir $@); \ 501 $(MKDIR_P) $(dir $@); \
494 $(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport "@DLIB_PREFIX_MONO@efl_mono_native_test@DLIB_SUFFIX_MONO@" -o $@ $(ALL_EO_REFS) $< 502 $(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport "@DLIB_PREFIX_MONO@efl_mono_native_test@DLIB_SUFFIX_MONO@" -o $@ $(ALL_EO_REFS) $<
495 503
496CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/dummy_test_object.eo.cs tests/efl_mono/dummy_child.eo.cs tests/efl_mono/dummy_numberwrapper.eo.cs tests/efl_mono/dummy_test_object.eo.c tests/efl_mono/dummy_child.eo.c tests/efl_mono/dummy_numberwrapper.eo.c tests/efl_mono/dummy_test_object.eo.h tests/efl_mono/dummy_child.eo.h tests/efl_mono/dummy_numberwrapper.eo.h tests/efl_mono/efl_mono.config 504CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/dummy_test_object.eo.cs tests/efl_mono/dummy_child.eo.cs tests/efl_mono/dummy_numberwrapper.eo.cs tests/efl_mono/dummy_test_object.eo.c tests/efl_mono/dummy_child.eo.c tests/efl_mono/dummy_numberwrapper.eo.c tests/efl_mono/dummy_test_object.eo.h tests/efl_mono/dummy_child.eo.h tests/efl_mono/dummy_part_holder.eo.cs tests/efl_mono/dummy_part_holder.eo.c tests/efl_mono/dummy_part_holder.eo.h tests/efl_mono/dummy_numberwrapper.eo.h tests/efl_mono/efl_mono.config
497 505
498endif 506endif
499 507
diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh
index c11437b..2b9d8ad 100644
--- a/src/bin/eolian_mono/eolian/mono/blacklist.hh
+++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh
@@ -67,6 +67,7 @@ inline bool is_function_blacklisted(attributes::function_def const& func, Contex
67// Blacklist structs that require some kind of manual binding. 67// Blacklist structs that require some kind of manual binding.
68inline bool is_struct_blacklisted(std::string const& full_name) 68inline bool is_struct_blacklisted(std::string const& full_name)
69{ 69{
70 // For now, these manual structs are blacklisted regardless of beta status
70 return full_name == "Efl.Event_Description" 71 return full_name == "Efl.Event_Description"
71 || full_name == "Eina.Binbuf" 72 || full_name == "Eina.Binbuf"
72 || full_name == "Eina.Strbuf" 73 || full_name == "Eina.Strbuf"
@@ -78,11 +79,28 @@ inline bool is_struct_blacklisted(std::string const& full_name)
78 || full_name == "Eina.Future"; 79 || full_name == "Eina.Future";
79} 80}
80 81
81inline bool is_struct_blacklisted(attributes::struct_def const& struct_) 82template <typename Context>
83inline bool is_struct_blacklisted(attributes::struct_def const& struct_, Context context)
82{ 84{
85 auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
86 if (struct_.is_beta && !options.want_beta)
87 return true;
88
83 return is_struct_blacklisted(name_helpers::struct_full_eolian_name(struct_)); 89 return is_struct_blacklisted(name_helpers::struct_full_eolian_name(struct_));
84} 90}
85 91
92// Struct as type_def is for places where the struct is used as a struct field or parameter/return.
93template <typename Context>
94inline bool is_struct_blacklisted(attributes::type_def const& struct_, Context context)
95{
96 auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
97 if (struct_.is_beta && !options.want_beta)
98 return true;
99
100 auto regular = efl::eina::get<attributes::regular_type_def>(struct_.original_type);
101 return is_struct_blacklisted(name_helpers::type_full_eolian_name(regular));
102}
103
86inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_) 104inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_)
87{ 105{
88 return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_)); 106 return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_));
@@ -114,6 +132,31 @@ inline bool is_property_blacklisted(attributes::property_def const& property, Co
114 return is_property_blacklisted(name); 132 return is_property_blacklisted(name);
115} 133}
116 134
135template<typename Context>
136inline bool is_class_blacklisted(attributes::klass_def const& cls, Context context)
137{
138 auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
139
140 return cls.is_beta && !options.want_beta;
141}
142
143template<typename Context>
144inline bool is_class_blacklisted(attributes::klass_name const& cls, Context context)
145{
146 auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
147
148 return cls.is_beta && !options.want_beta;
149}
150
151
152template<typename Context>
153inline bool is_event_blacklisted(attributes::event_def const& evt, Context context)
154{
155 auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
156
157 return evt.beta && !options.want_beta;
158}
159
117} 160}
118 161
119} 162}
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
index 76e82bd..d8dc043 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -93,6 +93,9 @@ struct event_argument_wrapper_generator
93 if (!etype.is_engaged()) 93 if (!etype.is_engaged())
94 return true; 94 return true;
95 95
96 if (blacklist::is_event_blacklisted(evt, context))
97 return true;
98
96 std::string evt_name = name_helpers::managed_event_name(evt.name); 99 std::string evt_name = name_helpers::managed_event_name(evt.name);
97 100
98 return as_generator("///<summary>Event argument wrapper for event <see cref=\"" 101 return as_generator("///<summary>Event argument wrapper for event <see cref=\""
@@ -119,6 +122,9 @@ struct event_declaration_generator
119 std::string wrapper_args_type; 122 std::string wrapper_args_type;
120 std::string evt_name = name_helpers::managed_event_name(evt.name); 123 std::string evt_name = name_helpers::managed_event_name(evt.name);
121 124
125 if (blacklist::is_event_blacklisted(evt, context))
126 return true;
127
122 if (evt.type.is_engaged()) 128 if (evt.type.is_engaged())
123 wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">"; 129 wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">";
124 130
@@ -143,6 +149,9 @@ struct event_registration_generator
143 { 149 {
144 std::string wrapper_event_name; 150 std::string wrapper_event_name;
145 151
152 if (blacklist::is_event_blacklisted(evt, context))
153 return true;
154
146 if (is_inherited_event && !helpers::is_unique_event(evt, leaf_klass)) 155 if (is_inherited_event && !helpers::is_unique_event(evt, leaf_klass))
147 wrapper_event_name = name_helpers::translate_inherited_event_name(evt, klass); 156 wrapper_event_name = name_helpers::translate_inherited_event_name(evt, klass);
148 else 157 else
@@ -172,6 +181,9 @@ struct event_definition_generator
172 template<typename OutputIterator, typename Context> 181 template<typename OutputIterator, typename Context>
173 bool generate(OutputIterator sink, attributes::event_def const& evt, Context context) const 182 bool generate(OutputIterator sink, attributes::event_def const& evt, Context context) const
174 { 183 {
184 if (blacklist::is_event_blacklisted(evt, context))
185 return true;
186
175 std::string managed_evt_name = name_helpers::managed_event_name(evt.name); 187 std::string managed_evt_name = name_helpers::managed_event_name(evt.name);
176 188
177 bool is_unique = helpers::is_unique_event(evt, leaf_klass); 189 bool is_unique = helpers::is_unique_event(evt, leaf_klass);
diff --git a/src/bin/eolian_mono/eolian/mono/function_pointer.hh b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
index a7e692b..f3918f1 100644
--- a/src/bin/eolian_mono/eolian/mono/function_pointer.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
@@ -9,15 +9,17 @@
9#include "function_helpers.hh" 9#include "function_helpers.hh"
10#include "documentation.hh" 10#include "documentation.hh"
11#include "generation_contexts.hh" 11#include "generation_contexts.hh"
12#include "blacklist.hh"
12 13
13namespace eolian_mono { 14namespace eolian_mono {
14 15
15// Blacklist structs that require some kind of manual binding. 16// Blacklist structs that require some kind of manual binding.
16static bool is_function_ptr_blacklisted(attributes::function_def const& func) 17template <typename Context>
18static bool is_function_ptr_blacklisted(attributes::function_def const& func, Context context)
17{ 19{
18 std::string name = name_helpers::function_ptr_full_eolian_name(func); 20 std::string name = name_helpers::function_ptr_full_eolian_name(func);
19 21
20 return false; 22 return blacklist::is_function_blacklisted(func, context);
21} 23}
22 24
23struct function_pointer { 25struct function_pointer {
@@ -28,13 +30,13 @@ struct function_pointer {
28 // FIXME export Typedecl in eolian_cxx API 30 // FIXME export Typedecl in eolian_cxx API
29 auto funcptr_ctx = context_add_tag(class_context{class_context::function_ptr}, context); 31 auto funcptr_ctx = context_add_tag(class_context{class_context::function_ptr}, context);
30 32
33 if (is_function_ptr_blacklisted(f, context))
34 return true;
35
31 std::string return_type; 36 std::string return_type;
32 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) 37 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
33 return false; 38 return false;
34 39
35 if (is_function_ptr_blacklisted(f))
36 return true;
37
38 if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx)) 40 if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx))
39 return false; 41 return false;
40 42
diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh
index 87a1e9d..a4bb169 100644
--- a/src/bin/eolian_mono/eolian/mono/helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/helpers.hh
@@ -102,8 +102,10 @@ std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfa
102 102
103// Returns the set of interfaces implemented by this type that haven't been implemented 103// Returns the set of interfaces implemented by this type that haven't been implemented
104// by a regular parent class. 104// by a regular parent class.
105std::set<attributes::klass_name, attributes::compare_klass_name_by_name> non_implemented_interfaces(attributes::klass_def const& cls) 105template<typename Context>
106std::set<attributes::klass_name, attributes::compare_klass_name_by_name> non_implemented_interfaces(attributes::klass_def const& cls, Context context)
106{ 107{
108 auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
107 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> implemented_interfaces; 109 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> implemented_interfaces;
108 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfaces; 110 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfaces;
109 111
@@ -114,6 +116,9 @@ std::set<attributes::klass_name, attributes::compare_klass_name_by_name> non_imp
114 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); 116 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
115 for(auto&& inherit : c.immediate_inherits) 117 for(auto&& inherit : c.immediate_inherits)
116 { 118 {
119 if (inherit.is_beta && !options.want_beta)
120 continue;
121
117 switch(inherit.type) 122 switch(inherit.type)
118 { 123 {
119 case attributes::class_type::mixin: 124 case attributes::class_type::mixin:
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 0689648..a9f270d 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -95,6 +95,13 @@ struct klass
95 bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const 95 bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const
96 { 96 {
97 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "klass_generator: " << cls.eolian_name << std::endl; 97 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "klass_generator: " << cls.eolian_name << std::endl;
98
99 if (blacklist::is_class_blacklisted(cls, context))
100 {
101 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "class " << cls.eolian_name << " is blacklisted. Skipping." << std::endl;
102 return true;
103 }
104
98 std::string suffix, class_type; 105 std::string suffix, class_type;
99 switch(cls.type) 106 switch(cls.type)
100 { 107 {
@@ -183,7 +190,7 @@ struct klass
183 return false; 190 return false;
184 191
185 bool root = !helpers::has_regular_ancestor(cls); 192 bool root = !helpers::has_regular_ancestor(cls);
186 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> inherit_interfaces = helpers::non_implemented_interfaces(cls); 193 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> inherit_interfaces = helpers::non_implemented_interfaces(cls, context);
187 std::vector<attributes::klass_name> inherit_classes; 194 std::vector<attributes::klass_name> inherit_classes;
188 std::copy_if(cls.immediate_inherits.begin(), cls.immediate_inherits.end() 195 std::copy_if(cls.immediate_inherits.begin(), cls.immediate_inherits.end()
189 , std::back_inserter(inherit_classes) 196 , std::back_inserter(inherit_classes)
@@ -268,7 +275,7 @@ struct klass
268 if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, concrete_cxt)) 275 if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, concrete_cxt))
269 return false; 276 return false;
270 277
271 for (auto&& klass : helpers::non_implemented_interfaces(cls)) 278 for (auto&& klass : helpers::non_implemented_interfaces(cls, concrete_cxt))
272 { 279 {
273 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); 280 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
274 if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, concrete_cxt)) 281 if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, concrete_cxt))
@@ -340,7 +347,7 @@ struct klass
340 if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, inherit_cxt)) 347 if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, inherit_cxt))
341 return false; 348 return false;
342 349
343 for (auto&& klass : helpers::non_implemented_interfaces(cls)) 350 for (auto&& klass : helpers::non_implemented_interfaces(cls, inherit_cxt))
344 { 351 {
345 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); 352 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
346 if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, inherit_cxt)) 353 if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, inherit_cxt))
@@ -644,7 +651,7 @@ struct klass
644 if (!as_generator(*(event_registration(cls, cls))).generate(sink, cls.events, context)) 651 if (!as_generator(*(event_registration(cls, cls))).generate(sink, cls.events, context))
645 return false; 652 return false;
646 653
647 for (auto&& c : helpers::non_implemented_interfaces(cls)) 654 for (auto&& c : helpers::non_implemented_interfaces(cls, context))
648 { 655 {
649 // Only non-regular types (which declare events through interfaces) need to register them. 656 // Only non-regular types (which declare events through interfaces) need to register them.
650 if (c.type == attributes::class_type::regular) 657 if (c.type == attributes::class_type::regular)
@@ -742,7 +749,7 @@ struct klass
742 // Inherited events 749 // Inherited events
743 750
744 // For now, as mixins can inherit from regular classes, we can't filter out inherited events. 751 // For now, as mixins can inherit from regular classes, we can't filter out inherited events.
745 auto inherits = helpers::non_implemented_interfaces(cls); 752 auto inherits = helpers::non_implemented_interfaces(cls, context);
746 for (auto&& c : inherits) 753 for (auto&& c : inherits)
747 { 754 {
748 attributes::klass_def klass(get_klass(c, cls.unit), cls.unit); 755 attributes::klass_def klass(get_klass(c, cls.unit), cls.unit);
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
index 47951f4..2a8d2e1 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -18,6 +18,9 @@ struct part_definition_generator
18 template <typename OutputIterator, typename Context> 18 template <typename OutputIterator, typename Context>
19 bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const 19 bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const
20 { 20 {
21 if (blacklist::is_class_blacklisted(part.klass, context))
22 return true;
23
21 auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass); 24 auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass);
22 return as_generator(scope_tab << documentation 25 return as_generator(scope_tab << documentation
23 << scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n" 26 << scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n"
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 17485d1..ba058d0 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -196,6 +196,7 @@ struct to_internal_field_convert_generator
196 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 196 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
197 { 197 {
198 auto field_name = name_helpers::to_field_name(field.name); 198 auto field_name = name_helpers::to_field_name(field.name);
199 // FIXME Replace need_struct_conversion(regular) with need_struct_conversion(type)
199 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 200 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
200 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 201 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
201 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type); 202 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
@@ -496,10 +497,9 @@ struct struct_entities_generator
496 template <typename OutputIterator, typename Context> 497 template <typename OutputIterator, typename Context>
497 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 498 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
498 { 499 {
499 if (blacklist::is_struct_blacklisted(struct_)) 500 if (blacklist::is_struct_blacklisted(struct_, context))
500 return true; 501 return true;
501 502
502
503 if (!name_helpers::open_namespaces(sink, struct_.namespaces, context)) 503 if (!name_helpers::open_namespaces(sink, struct_.namespaces, context))
504 return false; 504 return false;
505 505
diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs
index 84732d3..b487cf6 100644
--- a/src/bindings/mono/efl_mono/efl_csharp_application.cs
+++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs
@@ -106,7 +106,9 @@ namespace Efl {
106 Efl.App app = Efl.App.AppMain; 106 Efl.App app = Efl.App.AppMain;
107 Eina.Array<String> command_line = new Eina.Array<String>(); 107 Eina.Array<String> command_line = new Eina.Array<String>();
108 command_line.Append(Environment.GetCommandLineArgs()); 108 command_line.Append(Environment.GetCommandLineArgs());
109#if EFL_BETA
109 app.SetCommandArray(command_line); 110 app.SetCommandArray(command_line);
111#endif
110 app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => { 112 app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => {
111 if (evt.arg.Initialization) { 113 if (evt.arg.Initialization) {
112 OnInitialize(evt.arg.Argv); 114 OnInitialize(evt.arg.Argv);
diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build
index 4f04a01..13fe4ca 100644
--- a/src/bindings/mono/meson.build
+++ b/src/bindings/mono/meson.build
@@ -85,7 +85,11 @@ blacklisted_files = [
85 'elm_view_list.eo', 85 'elm_view_list.eo',
86 'elm_genlist_item.eo', 86 'elm_genlist_item.eo',
87 'elm_gengrid.eo', 87 'elm_gengrid.eo',
88 'elm_glview_eo.cs' 88 'elm_glview_eo.cs',
89 'elm_code_widget.eo',
90 'elm_multibuttonentry_part.eo',
91 'elm_atspi_bridge.eo',
92 'elm_atspi_app_object.eo',
89] 93]
90 94
91efl_mono_lib = library('eflcustomexportsmono', 95efl_mono_lib = library('eflcustomexportsmono',
diff --git a/src/examples/ecore/efl_mono_loop_timer_example.cs b/src/examples/ecore/efl_mono_loop_timer_example.cs
index 5b5af06..a6ad05b 100644
--- a/src/examples/ecore/efl_mono_loop_timer_example.cs
+++ b/src/examples/ecore/efl_mono_loop_timer_example.cs
@@ -4,6 +4,7 @@ using System.Runtime.CompilerServices;
4 4
5class TestMain 5class TestMain
6{ 6{
7#if EFL_BETA
7 private Efl.Loop loop; 8 private Efl.Loop loop;
8 private int count; 9 private int count;
9 10
@@ -48,6 +49,11 @@ class TestMain
48 { 49 {
49 Console.WriteLine("Ooops. Should not have been called..."); 50 Console.WriteLine("Ooops. Should not have been called...");
50 } 51 }
52#else
53 public static void Main()
54 {
55 }
56#endif
51} 57}
52 58
53 59
diff --git a/src/examples/elementary/efl_ui_slider_mono.cs b/src/examples/elementary/efl_ui_slider_mono.cs
index 3ef10cb..c2a3232 100644
--- a/src/examples/elementary/efl_ui_slider_mono.cs
+++ b/src/examples/elementary/efl_ui_slider_mono.cs
@@ -2,6 +2,7 @@ using System;
2 2
3public class Example 3public class Example
4{ 4{
5#if EFL_BETA
5 public static Efl.Ui.Button CreateButton(Efl.Object parent, 6 public static Efl.Ui.Button CreateButton(Efl.Object parent,
6 string text, 7 string text,
7 int w, int h, 8 int w, int h,
@@ -73,5 +74,10 @@ public class Example
73 74
74 Efl.All.Shutdown(); 75 Efl.All.Shutdown();
75 } 76 }
77#else
78 public static void Main()
79 {
80 }
81#endif
76 82
77} 83}
diff --git a/src/examples/elementary/efl_ui_unit_converter.cs b/src/examples/elementary/efl_ui_unit_converter.cs
index 5bbbe17..3460af3 100644
--- a/src/examples/elementary/efl_ui_unit_converter.cs
+++ b/src/examples/elementary/efl_ui_unit_converter.cs
@@ -2,7 +2,7 @@ using System;
2 2
3public class Example 3public class Example
4{ 4{
5 5#if EFL_BETA
6 private static double KMS_PER_MILE = 1.609344; 6 private static double KMS_PER_MILE = 1.609344;
7 7
8 private static double KmsToMiles(double kms) 8 private static double KmsToMiles(double kms)
@@ -146,5 +146,10 @@ public class Example
146 146
147 Efl.All.Shutdown(); 147 Efl.All.Shutdown();
148 } 148 }
149#else
150 public static void Main()
151 {
152 }
153#endif
149 154
150} 155}
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 08c5e2d..9329fba 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -95,16 +95,16 @@ class TestEo
95} 95}
96 96
97 97
98class MyLoop : Efl.Loop 98class MyObject : Efl.Object
99{ 99{
100 public MyLoop() : base(null) { } 100 public MyObject() : base(null) { }
101} 101}
102 102
103class TestEoInherit 103class TestEoInherit
104{ 104{
105 public static void instantiate_inherited() 105 public static void instantiate_inherited()
106 { 106 {
107 Efl.Loop loop = new MyLoop(); 107 Efl.Object loop = new MyObject();
108 Test.Assert(loop.NativeHandle != System.IntPtr.Zero); 108 Test.Assert(loop.NativeHandle != System.IntPtr.Zero);
109 } 109 }
110} 110}
diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs
index 5afed1f..50527c1 100644
--- a/src/tests/efl_mono/Parts.cs
+++ b/src/tests/efl_mono/Parts.cs
@@ -7,17 +7,18 @@ using System.Diagnostics.CodeAnalysis;
7 7
8namespace TestSuite { 8namespace TestSuite {
9 9
10#if EFL_BETA
10 11
11[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")] 12[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
12public static class TestParts 13public static class TestParts
13{ 14{
14 public static void basic_part_test() 15 public static void basic_part_test()
15 { 16 {
16 var t = new Dummy.TestObject(); 17 var t = new Dummy.PartHolder();
17 do_part_test(t); 18 do_part_test(t);
18 } 19 }
19 20
20 private class Child : Dummy.TestObject 21 private class Child : Dummy.PartHolder
21 { 22 {
22 public Child() : base(null) {} 23 public Child() : base(null) {}
23 } 24 }
@@ -27,7 +28,7 @@ public static class TestParts
27 do_part_test(t); 28 do_part_test(t);
28 } 29 }
29 30
30 private static void do_part_test(Dummy.TestObject t) 31 private static void do_part_test(Dummy.PartHolder t)
31 { 32 {
32 var p1 = t.PartOne; 33 var p1 = t.PartOne;
33 var p2 = t.PartTwo; 34 var p2 = t.PartTwo;
@@ -38,4 +39,6 @@ public static class TestParts
38 } 39 }
39} 40}
40 41
42#endif
43
41} 44}
diff --git a/src/tests/efl_mono/dummy_part_holder.eo b/src/tests/efl_mono/dummy_part_holder.eo
new file mode 100644
index 0000000..2dc5ad7
--- /dev/null
+++ b/src/tests/efl_mono/dummy_part_holder.eo
@@ -0,0 +1,13 @@
1import eina_types;
2
3class @beta Dummy.Part_Holder extends Dummy.Test_Object implements Efl.Part {
4
5 parts {
6 part_one: Dummy.Test_Object; [[ Part number one. ]]
7 part_two: Dummy.Test_Object; [[ Part number two. ]]
8 }
9 implements {
10 Efl.Part.part_get;
11 Efl.Object.constructor;
12 }
13}
diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo
index 517c783..d0311e9 100644
--- a/src/tests/efl_mono/dummy_test_object.eo
+++ b/src/tests/efl_mono/dummy_test_object.eo
@@ -101,12 +101,7 @@ function Dummy.FormatCb {
101 } 101 }
102}; 102};
103 103
104class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface, Dummy.Another_Iface { 104class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface, Dummy.Another_Iface {
105
106 parts {
107 part_one: Dummy.Test_Object; [[ Part number one. ]]
108 part_two: Dummy.Test_Object; [[ Part number two. ]]
109 }
110 methods { 105 methods {
111 return_object { 106 return_object {
112 return: Dummy.Test_Object; 107 return: Dummy.Test_Object;
@@ -1395,7 +1390,6 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface
1395 class.constructor; 1390 class.constructor;
1396 class.destructor; 1391 class.destructor;
1397 Efl.Object.constructor; 1392 Efl.Object.constructor;
1398 Efl.Part.part_get;
1399 Efl.Object.provider_find; 1393 Efl.Object.provider_find;
1400 Dummy.Test_Iface.emit_test_conflicted; 1394 Dummy.Test_Iface.emit_test_conflicted;
1401 Dummy.Test_Iface.emit_nonconflicted; 1395 Dummy.Test_Iface.emit_nonconflicted;
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index e4c7d72..8968e46 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -52,6 +52,7 @@
52#include "dummy_another_iface.eo.h" 52#include "dummy_another_iface.eo.h"
53#include "dummy_inherit_iface.eo.h" 53#include "dummy_inherit_iface.eo.h"
54#include "dummy_inherit_helper.eo.h" 54#include "dummy_inherit_helper.eo.h"
55#include "dummy_part_holder.eo.h"
55 56
56#include <interfaces/efl_part.eo.h> 57#include <interfaces/efl_part.eo.h>
57 58
@@ -67,8 +68,6 @@ typedef struct Dummy_Test_Object_Data
67 Eina_Value *stored_value; 68 Eina_Value *stored_value;
68 Dummy_StructSimple stored_struct; 69 Dummy_StructSimple stored_struct;
69 int stored_int; 70 int stored_int;
70 Eo *part_one;
71 Eo *part_two;
72 Eina_Promise *promise; 71 Eina_Promise *promise;
73 Eina_List *list_for_accessor; 72 Eina_List *list_for_accessor;
74 int setter_only; 73 int setter_only;
@@ -91,6 +90,12 @@ typedef struct Dummy_Child_Data
91 Eina_Bool optional_beta_ctor_was_called; 90 Eina_Bool optional_beta_ctor_was_called;
92} Dummy_Child_Data; 91} Dummy_Child_Data;
93 92
93typedef struct Dummy_Part_Holder_Data
94{
95 Eo *part_one;
96 Eo *part_two;
97} Dummy_Part_Holder_Data;
98
94typedef struct Dummy_Inherit_Helper_Data 99typedef struct Dummy_Inherit_Helper_Data
95{ 100{
96} Dummy_Inherit_Helper_Data; 101} Dummy_Inherit_Helper_Data;
@@ -145,14 +150,6 @@ static Efl_Object*
145_dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd) 150_dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
146{ 151{
147 efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS)); 152 efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS));
148
149 // To avoid an infinite loop calling the same constructor
150 if (!efl_parent_get(obj))
151 {
152 pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one"));
153 pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
154 }
155
156 pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj); 153 pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
157 dummy_numberwrapper_number_set(pd->provider, 1999); 154 dummy_numberwrapper_number_set(pd->provider, 1999);
158 155
@@ -3792,16 +3789,6 @@ void _dummy_test_object_emit_event_with_list(Eo *obj, EINA_UNUSED Dummy_Test_Obj
3792 efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_LIST, data); 3789 efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_LIST, data);
3793} 3790}
3794 3791
3795Efl_Object *_dummy_test_object_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const char *name)
3796{
3797 if (!strcmp(name, "part_one"))
3798 return pd->part_one;
3799 else if (!strcmp(name, "part_two"))
3800 return pd->part_two;
3801 else
3802 return NULL;
3803}
3804
3805void _dummy_test_object_append_to_strbuf(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Strbuf *buf, const char *str) 3792void _dummy_test_object_append_to_strbuf(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Strbuf *buf, const char *str)
3806{ 3793{
3807 eina_strbuf_append(buf, str); 3794 eina_strbuf_append(buf, str);
@@ -4024,6 +4011,34 @@ const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Dummy_Te
4024 return dummy_inherit_iface_stringshare_test (x, eina_stringshare_add("hello world")); 4011 return dummy_inherit_iface_stringshare_test (x, eina_stringshare_add("hello world"));
4025} 4012}
4026 4013
4014// Part holder
4015static Efl_Object*
4016_dummy_part_holder_efl_object_constructor(Eo *obj, Dummy_Part_Holder_Data *pd)
4017{
4018 efl_constructor(efl_super(obj, DUMMY_PART_HOLDER_CLASS));
4019
4020 // To avoid an infinite loop calling the same constructor
4021 if (!efl_parent_get(obj))
4022 {
4023 pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one"));
4024 pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
4025 }
4026
4027 return obj;
4028}
4029
4030Efl_Object *_dummy_part_holder_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Part_Holder_Data *pd, const char *name)
4031{
4032 if (!strcmp(name, "part_one"))
4033 return pd->part_one;
4034 else if (!strcmp(name, "part_two"))
4035 return pd->part_two;
4036 else
4037 return NULL;
4038}
4039
4040
4041
4027#include "dummy_test_object.eo.c" 4042#include "dummy_test_object.eo.c"
4028#include "dummy_numberwrapper.eo.c" 4043#include "dummy_numberwrapper.eo.c"
4029#include "dummy_child.eo.c" 4044#include "dummy_child.eo.c"
@@ -4031,4 +4046,5 @@ const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Dummy_Te
4031#include "dummy_another_iface.eo.c" 4046#include "dummy_another_iface.eo.c"
4032#include "dummy_inherit_helper.eo.c" 4047#include "dummy_inherit_helper.eo.c"
4033#include "dummy_inherit_iface.eo.c" 4048#include "dummy_inherit_iface.eo.c"
4049#include "dummy_part_holder.eo.c"
4034 4050
diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build
index 52c6e31..f9fcbcf 100644
--- a/src/tests/efl_mono/meson.build
+++ b/src/tests/efl_mono/meson.build
@@ -1,4 +1,4 @@
1eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo'] 1eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo', 'dummy_part_holder.eo']
2 2
3eo_file_targets = [] 3eo_file_targets = []
4 4