summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2020-01-30 16:49:04 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2020-02-18 16:47:38 -0300
commit595cb754b3aa280cdbebcb5fa0c51f287099b713 (patch)
tree49ce2ed6e0e25b7268267d8255dddf46266dfe71
parentd00dadb79ab1c216ecc0519716ca25a1f92c3632 (diff)
eolian-mono: Make Get/Set internal for generated properties
Make Get and Set methods internal for properties that get the property syntax generated. Reviewed-by: João Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11252
-rw-r--r--src/bin/eolian_mono/eolian/mono/async_function_definition.hh5
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh174
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh96
-rw-r--r--src/bin/eolian_mono/eolian/mono/helpers.hh106
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh45
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh33
-rw-r--r--src/bin/eolian_mono/eolian/mono/property_definition.hh383
-rw-r--r--src/bindings/cxx/eina_cxx/eina_variant.hh239
-rw-r--r--src/bindings/mono/efl_mono/GenericModel.cs24
-rw-r--r--src/bindings/mono/eo_mono/EoWrapper.cs2
-rw-r--r--src/lib/eolian_cxx/grammar/context.hpp25
-rw-r--r--src/tests/efl_mono/Eina.cs258
-rw-r--r--src/tests/efl_mono/EinaTestData.cs30
-rw-r--r--src/tests/efl_mono/Eo.cs45
-rw-r--r--src/tests/efl_mono/Events.cs8
-rw-r--r--src/tests/efl_mono/Model.cs2
-rw-r--r--src/tests/efl_mono/Parts.cs8
-rw-r--r--src/tests/efl_mono/StructHelpers.cs4
18 files changed, 1200 insertions, 287 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
index bc0bb6863a..3fddb03780 100644
--- a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
@@ -36,6 +36,7 @@
36#include "using_decl.hh" 36#include "using_decl.hh"
37#include "generation_contexts.hh" 37#include "generation_contexts.hh"
38#include "blacklist.hh" 38#include "blacklist.hh"
39#include "documentation.hh"
39 40
40namespace eolian_mono { 41namespace eolian_mono {
41 42
@@ -71,8 +72,10 @@ struct async_function_declaration_generator
71 if(f.scope != attributes::member_scope::scope_public) 72 if(f.scope != attributes::member_scope::scope_public)
72 return true; 73 return true;
73 74
75 auto ref = documentation_generator::function_conversion (f, context);
76
74 if (!as_generator( 77 if (!as_generator(
75 scope_tab(2) << "/// <summary>Async wrapper for <see cref=\"" << name_helpers::managed_method_name(f) << "\" />.\n" 78 scope_tab(2) << "/// <summary>Async wrapper for <see cref=\"" << ref << "\" />.\n"
76 ).generate(sink, attributes::unused, context)) 79 ).generate(sink, attributes::unused, context))
77 return false; 80 return false;
78 81
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index d15f91437d..eac5e1a179 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -23,6 +23,7 @@
23#include "name_helpers.hh" 23#include "name_helpers.hh"
24#include "generation_contexts.hh" 24#include "generation_contexts.hh"
25#include "blacklist.hh" 25#include "blacklist.hh"
26#include "property_definition.hh"
26 27
27#include <Eina.h> 28#include <Eina.h>
28 29
@@ -76,7 +77,8 @@ struct documentation_generator
76 // The name_tail parameter is the last 4 chars of the original string, which 77 // The name_tail parameter is the last 4 chars of the original string, which
77 // could be ".set" or ".get" and in this case they are ignored by Eolian. 78 // could be ".set" or ".get" and in this case they are ignored by Eolian.
78 // We want them to know what the documentation intended to reference. 79 // We want them to know what the documentation intended to reference.
79 static std::string function_conversion(const ::Eolian_Object *klass, const ::Eolian_Function *function, std::string name_tail) 80 template <typename Context>
81 static std::string function_conversion(const ::Eolian_Object *klass, const ::Eolian_Function *function, std::string name_tail, Context const& context)
80 { 82 {
81 ::Eolian_Function_Type ftype = ::eolian_function_type_get(function); 83 ::Eolian_Function_Type ftype = ::eolian_function_type_get(function);
82 const char* eo_name = ::eolian_function_name_get(function); 84 const char* eo_name = ::eolian_function_name_get(function);
@@ -113,26 +115,65 @@ struct documentation_generator
113 name += name_helpers::managed_method_name({function, ftype, NULL, eolian_object_unit_get(EOLIAN_OBJECT(function))}); 115 name += name_helpers::managed_method_name({function, ftype, NULL, eolian_object_unit_get(EOLIAN_OBJECT(function))});
114 break; 116 break;
115 case ::EOLIAN_PROP_SET: 117 case ::EOLIAN_PROP_SET:
116 name += ".Set";
117 name += name_helpers::property_managed_name(klass_d, eo_name);
118 break;
119 case ::EOLIAN_PROP_GET: 118 case ::EOLIAN_PROP_GET:
120 name += ".Get";
121 name += name_helpers::property_managed_name(klass_d, eo_name);
122 break;
123 case ::EOLIAN_PROPERTY: 119 case ::EOLIAN_PROPERTY:
120 {
121 efl::eina::optional<attributes::function_def> getter_func;
122 efl::eina::optional<attributes::function_def> setter_func;
123 auto unit = (const Eolian_Unit*) context_find_tag<eolian_state_context>(context).state;
124 if (ftype == ::EOLIAN_PROPERTY || ftype == ::EOLIAN_PROP_GET)
125 getter_func = attributes::function_def{function, ::EOLIAN_PROP_GET, nullptr, unit};
126 if (ftype == ::EOLIAN_PROPERTY || ftype == ::EOLIAN_PROP_SET)
127 setter_func = attributes::function_def{function, ::EOLIAN_PROP_SET, nullptr, unit};
128 attributes::property_def property{function, getter_func, setter_func, unit};
129
130 std::string short_name = name_helpers::property_managed_name(klass_d, eo_name);
131 class_context::wrapper_kind klass_kind;
132 if (helpers::is_managed_interface(klass_d))
133 klass_kind = class_context::interface;
134 else
135 klass_kind = class_context::inherit;
136 auto my_context = grammar::context_replace_tag(class_context{klass_kind}, context);
137
138 if (name_tail == ".get")
139 {
140 if (property_generate_wrapper_getter (property, my_context))
141 {
142 name += "." + short_name;
143 }
144 else
145 {
146 name += ".Get" + short_name;
147 }
148 }
149 else if (name_tail == ".set")
150 {
151 if (property_generate_wrapper_setter (property, my_context))
152 {
153 name += "." + short_name;
154 }
155 else
156 {
157 name += ".Set" + short_name;
158 }
159 }
160 else
124 { 161 {
125 int getter_nkeys = property_num_keys(function, ::EOLIAN_PROP_GET); 162 switch (ftype)
126 int setter_nkeys = property_num_keys(function, ::EOLIAN_PROP_SET); 163 {
127 std::string short_name = name_helpers::property_managed_name(klass_d, eo_name); 164 case ::EOLIAN_PROPERTY:
128 bool blacklisted = blacklist::is_property_blacklisted(name + "." + short_name); 165 case ::EOLIAN_PROP_GET:
129 // EO properties with keys or blacklisted are not converted into C# properties. 166 if (property_generate_wrapper_getter (property, my_context))
130 // In these cases we refer to the getter method instead of the property. 167 name += "." + short_name;
131 if ((getter_nkeys > 0) || (setter_nkeys > 0) || (blacklisted)) name += ".Get" + short_name; 168 else
132 else if (name_tail == ".get") name += ".Get" + short_name; 169 name += ".Get" + short_name;
133 else if (name_tail == ".set") name += ".Set" + short_name; 170 break;
134 else name += "." + short_name; 171 default:
172 name += ".Set" + short_name;
173 break;
174 }
135 } 175 }
176 }
136 break; 177 break;
137 default: 178 default:
138 break; 179 break;
@@ -140,33 +181,89 @@ struct documentation_generator
140 return name; 181 return name;
141 } 182 }
142 183
143 static std::string function_conversion(attributes::function_def const& func) 184 template <typename Context>
185 static std::string function_conversion(attributes::function_def const& func, Context const& context)
144 { 186 {
145 // This function is called only from the constructor reference conversion, so it does not 187 // This function is called only from the constructor reference conversion, so it does not
146 // need to check whether this function non-public in a interface returning an empty reference (yet). 188 // need to check whether this function non-public in a interface returning an empty reference (yet).
147 std::string name = name_helpers::klass_full_concrete_or_interface_name(func.klass); 189 std::string name = name_helpers::klass_full_concrete_or_interface_name(func.klass);
148 switch (func.type) 190 switch (func.type)
149 { 191 {
150 // managed_method_name takes care of reordering the function name so the get/set goes first 192 // managed_method_name takes care of reordering the function name so the get/set goes first
151 // for properties 193 // for properties
152 case attributes::function_type::method: 194 case attributes::function_type::method:
153 case attributes::function_type::prop_set: 195 if (blacklist::is_function_blacklisted(func.c_name))return "";
154 case attributes::function_type::prop_get: 196 if (!name.empty()) name += ".";
155 if (blacklist::is_function_blacklisted(func.c_name))return ""; 197 name += name_helpers::managed_method_name(func);
156 if (!name.empty()) name += "."; 198 break;
157 name += name_helpers::managed_method_name(func); 199 case attributes::function_type::prop_set:
158 break; 200 case attributes::function_type::prop_get:
159 default: 201 case attributes::function_type::property:
160 // No need to deal with property as function_defs are converted to get/set when building a given klass_def. 202 {
161 break; 203 auto unit = (const Eolian_Unit*) context_find_tag<eolian_state_context>(context).state;
204 auto klass = get_klass(func.klass, unit);
205 attributes::klass_def klass_d(klass, unit);
206
207 auto eo_name = func.name;
208 auto prop_name = eo_name;
209 if (prop_name.size () > 4
210 &&
211 ( prop_name.substr(prop_name.size() - 4) == "_set"
212 || prop_name.substr(prop_name.size() - 4) == "_get"))
213 {
214 prop_name = prop_name.substr(0, prop_name.size() - 4);
215 }
216 std::string short_name = name_helpers::property_managed_name(klass_d, prop_name);
217 assert (prop_name.size() <= 4 ||
218 (prop_name.substr(prop_name.size() - 4) != "_set"
219 && prop_name.substr(prop_name.size() - 4) != "_get"));
220 assert (short_name.size() <= 3 ||
221 (short_name.substr(short_name.size() - 3) != "Set"
222 && short_name.substr(short_name.size() - 3) != "Get"));
223
224 // We need to replace the current class context with the context
225 // from the class that originated this property.
226 class_context::wrapper_kind klass_kind;
227 if (helpers::is_managed_interface(klass_d))
228 klass_kind = class_context::interface;
229 else
230 klass_kind = class_context::inherit;
231
232 auto my_context = grammar::context_replace_tag(class_context{klass_kind}, context);
233
234 auto function = eolian_class_function_by_name_get (klass, prop_name.c_str(), EOLIAN_PROPERTY);
235 attributes::function_def getter_func{function, ::EOLIAN_PROP_GET, nullptr, unit};
236 attributes::function_def setter_func{function, ::EOLIAN_PROP_SET, nullptr, unit};
237 attributes::property_def prop{function, getter_func, setter_func, unit};
238
239 if (func.type == attributes::function_type::prop_get || func.type == attributes::function_type::property)
240 {
241 if (property_generate_wrapper_getter (prop, my_context))
242 name += "." + short_name;
243 else
244 name += ".Get" + short_name;
245 }
246 else if (func.type == attributes::function_type::prop_set)
247 {
248 if (property_generate_wrapper_setter (prop, my_context))
249 name += "." + short_name;
250 else
251 name += ".Set" + short_name;
252 }
253 }
254 break;
255 default:
256 // No need to deal with property as function_defs are converted to get/set when building a given klass_def.
257 break;
162 } 258 }
163 259
164 return name; 260 return name;
165 } 261 }
166 262
167 // Turns an Eolian reference like @Efl.Input.Pointer.tool into a <see> tag 263 // Turns an Eolian reference like @Efl.Input.Pointer.tool into a <see> tag
264 template <typename Context>
168 static std::string ref_conversion(const ::Eolian_Doc_Token *token, const Eolian_State *state, std::string name_tail, 265 static std::string ref_conversion(const ::Eolian_Doc_Token *token, const Eolian_State *state, std::string name_tail,
169 bool want_beta) 266 bool want_beta, Context const& context)
170 { 267 {
171 const Eolian_Object *data, *data2; 268 const Eolian_Object *data, *data2;
172 ::Eolian_Object_Type type = 269 ::Eolian_Object_Type type =
@@ -195,7 +292,7 @@ struct documentation_generator
195 is_beta = eolian_object_is_beta(data) || eolian_object_is_beta(data2); 292 is_beta = eolian_object_is_beta(data) || eolian_object_is_beta(data2);
196 break; 293 break;
197 case ::EOLIAN_OBJECT_FUNCTION: 294 case ::EOLIAN_OBJECT_FUNCTION:
198 ref += function_conversion(data, (const ::Eolian_Function *)data2, name_tail); 295 ref += function_conversion(data, (const ::Eolian_Function *)data2, name_tail, context);
199 is_beta = eolian_object_is_beta(data) || eolian_object_is_beta(data2); 296 is_beta = eolian_object_is_beta(data) || eolian_object_is_beta(data2);
200 break; 297 break;
201 case ::EOLIAN_OBJECT_CONSTANT: 298 case ::EOLIAN_OBJECT_CONSTANT:
@@ -226,8 +323,9 @@ struct documentation_generator
226 return ref; 323 return ref;
227 } 324 }
228 325
229 // Turns EO documentation syntax into C# triple-slash XML comment syntax 326 // Turns EO documentation syntax into C# triple-slash XML comment syntax
230 static std::string syntax_conversion(std::string text, const Eolian_State *state, bool want_beta) 327 template <typename Context>
328 static std::string syntax_conversion(std::string text, const Eolian_State *state, bool want_beta, Context const& context)
231 { 329 {
232 std::string new_text, ref; 330 std::string new_text, ref;
233 ::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN; 331 ::Eolian_Doc_Token_Type previous_token_type = ::EOLIAN_DOC_TOKEN_UNKNOWN;
@@ -266,7 +364,7 @@ struct documentation_generator
266 new_text += token_text; 364 new_text += token_text;
267 break; 365 break;
268 case ::EOLIAN_DOC_TOKEN_REF: 366 case ::EOLIAN_DOC_TOKEN_REF:
269 ref = ref_conversion(&token, state, name_tail, want_beta); 367 ref = ref_conversion(&token, state, name_tail, want_beta, context);
270 if (ref != "") 368 if (ref != "")
271 { 369 {
272 if (utils::ends_with(ref, BETA_REF_SUFFIX)) 370 if (utils::ends_with(ref, BETA_REF_SUFFIX))
@@ -333,7 +431,7 @@ struct documentation_generator
333 if (!as_generator(html_escaped_string).generate(std::back_inserter(new_text), text, context)) 431 if (!as_generator(html_escaped_string).generate(std::back_inserter(new_text), text, context))
334 return false; 432 return false;
335 auto options = context_find_tag<options_context>(context); 433 auto options = context_find_tag<options_context>(context);
336 new_text = syntax_conversion( new_text, context_find_tag<eolian_state_context>(context).state, options.want_beta); 434 new_text = syntax_conversion( new_text, context_find_tag<eolian_state_context>(context).state, options.want_beta, context);
337 435
338 std::string tabs; 436 std::string tabs;
339 as_generator(scope_tab(scope_size) << "/// ").generate (std::back_inserter(tabs), attributes::unused, context); 437 as_generator(scope_tab(scope_size) << "/// ").generate (std::back_inserter(tabs), attributes::unused, context);
@@ -698,7 +796,7 @@ struct documentation_generator
698 796
699 for (auto &&param : ctor.function.parameters) 797 for (auto &&param : ctor.function.parameters)
700 { 798 {
701 auto ref = function_conversion(func); 799 auto ref = function_conversion(func, context);
702 800
703 if (!context_find_tag<options_context>(context).want_beta && func.is_beta) 801 if (!context_find_tag<options_context>(context).want_beta && func.is_beta)
704 { 802 {
@@ -741,7 +839,7 @@ struct documentation_string_generator
741 839
742 auto options = context_find_tag<options_context>(context); 840 auto options = context_find_tag<options_context>(context);
743 auto state = context_find_tag<eolian_state_context>(context).state; 841 auto state = context_find_tag<eolian_state_context>(context).state;
744 if (!as_generator(string).generate(sink, documentation_generator::syntax_conversion(escaped, state, options.want_beta), context)) 842 if (!as_generator(string).generate(sink, documentation_generator::syntax_conversion(escaped, state, options.want_beta, context), context))
745 return false; 843 return false;
746 844
747 return true; 845 return true;
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 3c30cdd3fe..6aeaadcedb 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -27,6 +27,7 @@
27#include "grammar/alternative.hpp" 27#include "grammar/alternative.hpp"
28#include "grammar/attribute_reorder.hpp" 28#include "grammar/attribute_reorder.hpp"
29#include "grammar/counter.hpp" 29#include "grammar/counter.hpp"
30#include "property_definition.hh"
30#include "logging.hh" 31#include "logging.hh"
31#include "type.hh" 32#include "type.hh"
32#include "name_helpers.hh" 33#include "name_helpers.hh"
@@ -44,6 +45,7 @@ namespace eolian_mono {
44struct native_function_definition_generator 45struct native_function_definition_generator
45{ 46{
46 attributes::klass_def const* klass; 47 attributes::klass_def const* klass;
48 std::vector<attributes::property_def> properties;
47 49
48 template <typename OutputIterator, typename Context> 50 template <typename OutputIterator, typename Context>
49 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const 51 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
@@ -52,6 +54,24 @@ struct native_function_definition_generator
52 if(blacklist::is_function_blacklisted(f, context)) 54 if(blacklist::is_function_blacklisted(f, context))
53 return true; 55 return true;
54 56
57 auto it = std::find_if (properties.begin(), properties.end()
58 , [&] (attributes::property_def const& prop)
59 {
60 return (prop.getter && *prop.getter == f)
61 || (prop.setter && *prop.setter == f);
62 });
63 if (it != properties.end())
64 {
65 if (it->getter && *it->getter == f)
66 {
67 if (property_generate_wrapper_getter (*it, context))
68 return true;
69 }
70 else
71 if (property_generate_wrapper_setter (*it, context))
72 return true;
73 }
74
55 auto const& indent = current_indentation(context); 75 auto const& indent = current_indentation(context);
56 76
57 // Delegate for the C# method we will export to EO as a method implementation. 77 // Delegate for the C# method we will export to EO as a method implementation.
@@ -184,10 +204,6 @@ struct native_function_definition_generator
184 204
185struct function_definition_generator 205struct function_definition_generator
186{ 206{
187 function_definition_generator(bool do_super = false)
188 : do_super(do_super)
189 {}
190
191 template <typename OutputIterator, typename Context> 207 template <typename OutputIterator, typename Context>
192 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const 208 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
193 { 209 {
@@ -197,6 +213,25 @@ struct function_definition_generator
197 if(blacklist::is_function_blacklisted(f, context)) 213 if(blacklist::is_function_blacklisted(f, context))
198 return true; 214 return true;
199 215
216 auto function_scope = eolian_mono::function_scope_get(f);
217 auto it = std::find_if (properties.begin(), properties.end()
218 , [&] (attributes::property_def const& prop)
219 {
220 return (prop.getter && *prop.getter == f)
221 || (prop.setter && *prop.setter == f);
222 });
223 if (it != properties.end())
224 {
225 if (it->getter && *it->getter == f)
226 {
227 if (property_generate_wrapper_getter (*it, context))
228 function_scope = "internal ";
229 }
230 else
231 if (property_generate_wrapper_setter (*it, context))
232 function_scope = "internal ";
233 }
234
200 // Do not generate static function for concrete class 235 // Do not generate static function for concrete class
201 if (is_concrete && f.is_static) 236 if (is_concrete && f.is_static)
202 return true; 237 return true;
@@ -219,7 +254,7 @@ struct function_definition_generator
219 self = ""; 254 self = "";
220 255
221 if(!as_generator 256 if(!as_generator
222 (scope_tab(2) << eolian_mono::function_scope_get(f) << ((do_super && !f.is_static) ? "virtual " : "") << (f.is_static ? "static " : "") << return_type << " " << string << "(" << (parameter % ", ") 257 (scope_tab(2) << function_scope << ((do_super && !f.is_static) ? "virtual " : "") << (f.is_static ? "static " : "") << return_type << " " << string << "(" << (parameter % ", ")
223 << ") {\n" 258 << ") {\n"
224 << scope_tab(3) << eolian_mono::function_definition_preamble() 259 << scope_tab(3) << eolian_mono::function_definition_preamble()
225 << klass_full_native_inherit_name(f.klass) << "." << string << "_ptr.Value.Delegate(" 260 << klass_full_native_inherit_name(f.klass) << "." << string << "_ptr.Value.Delegate("
@@ -235,24 +270,29 @@ struct function_definition_generator
235 } 270 }
236 271
237 bool do_super; 272 bool do_super;
273 std::vector<attributes::property_def> properties;
238}; 274};
239 275
240struct function_definition_parameterized 276struct function_definition_parameterized
241{ 277{
242 function_definition_generator operator()(bool do_super) const 278 function_definition_generator operator()(bool do_super, std::vector<attributes::property_def> properties) const
279 {
280 return {do_super, properties};
281 }
282 function_definition_generator operator()(std::vector<attributes::property_def> properties) const
243 { 283 {
244 return {do_super}; 284 return {false, properties};
245 } 285 }
246} const function_definition; 286} const function_definition;
247function_definition_generator as_generator(function_definition_parameterized) 287// function_definition_generator as_generator(function_definition_parameterized)
248{ 288// {
249 return {}; 289// return {};
250} 290// }
251struct native_function_definition_parameterized 291struct native_function_definition_parameterized
252{ 292{
253 native_function_definition_generator operator()(attributes::klass_def const& klass) const 293 native_function_definition_generator operator()(attributes::klass_def const& klass, std::vector<attributes::property_def> properties) const
254 { 294 {
255 return {&klass}; 295 return {&klass, properties};
256 } 296 }
257} const native_function_definition; 297} const native_function_definition;
258 298
@@ -356,27 +396,19 @@ struct property_wrapper_definition_generator
356 // if (get_params > 0 || set_params > 1) 396 // if (get_params > 0 || set_params > 1)
357 // return true; 397 // return true;
358 398
359 if (property.getter 399 if (property.getter && !property.getter->keys.empty())
360 && std::find_if (property.getter->parameters.begin()
361 , property.getter->parameters.end()
362 , [] (parameter_def const& p)
363 {
364 return p.direction != parameter_direction::out;
365 }) != property.getter->parameters.end())
366 return true; 400 return true;
367 if (property.setter 401 if (property.setter && !property.setter->keys.empty())
368 && std::find_if (property.setter->parameters.begin()
369 , property.setter->parameters.end()
370 , [] (parameter_def const& p)
371 {
372 return p.direction != parameter_direction::in;
373 }) != property.setter->parameters.end())
374 return true; 402 return true;
375 403
376 if (property.getter && property.setter) 404 if (property.getter && property.setter)
377 { 405 {
378 if (get_params != 0 && property.setter->parameters.size() != property.getter->parameters.size()) 406 if (property.setter->values.size() != property.getter->values.size())
379 return true; 407 {
408 if (!std::equal(property.setter->values.begin(), property.setter->values.end()
409 , property.getter->values.begin()))
410 return true;
411 }
380 } 412 }
381 413
382 std::vector<attributes::parameter_def> parameters; 414 std::vector<attributes::parameter_def> parameters;
@@ -481,9 +513,11 @@ struct property_wrapper_definition_generator
481 if (property.getter.is_engaged() && is_interface) 513 if (property.getter.is_engaged() && is_interface)
482 { 514 {
483 if (is_get_public) 515 if (is_get_public)
516 {
484 if (!as_generator(scope_tab(2) << scope_tab << set_scope << "get;\n" 517 if (!as_generator(scope_tab(2) << scope_tab << set_scope << "get;\n"
485 ).generate(sink, attributes::unused, context)) 518 ).generate(sink, attributes::unused, context))
486 return false; 519 return false;
520 }
487 } 521 }
488 else if (property.getter.is_engaged() && get_params == 0/*parameters.size() == 1 && property.getter.is_engaged()*/) 522 else if (property.getter.is_engaged() && get_params == 0/*parameters.size() == 1 && property.getter.is_engaged()*/)
489 { 523 {
@@ -526,9 +560,11 @@ struct property_wrapper_definition_generator
526 if (property.setter.is_engaged() && is_interface) 560 if (property.setter.is_engaged() && is_interface)
527 { 561 {
528 if (is_set_public) 562 if (is_set_public)
563 {
529 if (!as_generator(scope_tab(2) << scope_tab << set_scope << "set;\n" 564 if (!as_generator(scope_tab(2) << scope_tab << set_scope << "set;\n"
530 ).generate(sink, attributes::unused, context)) 565 ).generate(sink, attributes::unused, context))
531 return false; 566 return false;
567 }
532 } 568 }
533 else if (parameters.size() == 1 && property.setter.is_engaged()) 569 else if (parameters.size() == 1 && property.setter.is_engaged())
534 { 570 {
diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh
index b34a985749..f704ef00af 100644
--- a/src/bin/eolian_mono/eolian/mono/helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/helpers.hh
@@ -248,6 +248,67 @@ std::vector<attributes::function_def> get_all_implementable_methods(attributes::
248 return ret; 248 return ret;
249} 249}
250 250
251/*
252 * Gets all properties that this class should implement (i.e. that come from an unimplemented interface/mixin and the class itself)
253 */
254template<typename Context>
255std::vector<attributes::property_def> get_all_implementable_properties(attributes::klass_def const& cls, Context const& context)
256{
257 bool want_beta = efl::eolian::grammar::context_find_tag<options_context>(context).want_beta;
258 std::vector<attributes::property_def> ret;
259 auto filter_beta = [&want_beta](attributes::property_def const& prop) {
260 if (!want_beta)
261 return prop.getter && !prop.setter ? !prop.getter->is_beta
262 : prop.getter && prop.setter ? !prop.getter->is_beta || !prop.setter->is_beta
263 : true
264 ;
265 else
266 return true;
267 };
268
269 std::copy_if(cls.properties.begin(), cls.properties.end(), std::back_inserter(ret), filter_beta);
270
271 // Non implemented interfaces
272 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> implemented_interfaces;
273 std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfaces;
274 std::function<void(attributes::klass_name const&, bool)> inherit_algo =
275 [&] (attributes::klass_name const &klass, bool is_implemented)
276 {
277 attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
278 for (auto&& inherit: c.immediate_inherits)
279 {
280 switch(inherit.type)
281 {
282 case attributes::class_type::mixin:
283 case attributes::class_type::interface_:
284 interfaces.insert(inherit);
285 if (is_implemented)
286 implemented_interfaces.insert(inherit);
287 inherit_algo(inherit, is_implemented);
288 break;
289 case attributes::class_type::abstract_:
290 case attributes::class_type::regular:
291 inherit_algo(inherit, true);
292 default:
293 break;
294 }
295 }
296 };
297
298 inherit_algo(attributes::get_klass_name(cls), false);
299
300 for (auto&& inherit : implemented_interfaces)
301 interfaces.erase(inherit);
302
303 for (auto&& inherit : interfaces)
304 {
305 attributes::klass_def klass(get_klass(inherit, cls.unit), cls.unit);
306 std::copy_if(klass.properties.cbegin(), klass.properties.cend(), std::back_inserter(ret), filter_beta);
307 }
308
309 return ret;
310}
311
251template<typename Klass> 312template<typename Klass>
252inline bool is_managed_interface(Klass const& klass) 313inline bool is_managed_interface(Klass const& klass)
253{ 314{
@@ -284,6 +345,51 @@ std::vector<attributes::function_def> get_all_registerable_methods(attributes::k
284 return ret; 345 return ret;
285} 346}
286 347
348bool is_function_registerable (attributes::function_def func, attributes::klass_def const& cls)
349{
350 if (cls == func.klass)
351 return true;
352
353 if (is_managed_interface(func.klass) && func.is_static)
354 return true;
355
356 if (!is_managed_interface(func.klass) || func.scope != attributes::member_scope::scope_public)
357 return true;
358 return false;
359}
360
361// /*
362// * Gets all methods that this class should register (i.e. that comes from it and non-public interface methods
363// * that this class is the first one implementing)
364// */
365// template<typename Context>
366// std::vector<attributes::property_def> get_all_registerable_properties(attributes::klass_def const& cls, Context const& context)
367// {
368// std::vector<attributes::property_def> ret;
369
370// auto implementable_properties = get_all_implementable_properties(cls, context);
371
372// std::copy_if(implementable_properties.cbegin(), implementable_properties.cend(), std::back_inserter(ret)
373// , [&cls](attributes::property_def const & property) {
374// auto klass = property.getter ? property.getter->klass
375// : property.setter->klass;
376
377// if (cls == klass)
378// return true;
379
380// if (is_managed_interface(klass) && ((property.getter && property.getter->is_static)
381// || (property.setter && property.setter->is_static)))
382// return true;
383
384// if (!is_managed_interface(klass) || ((property.getter && property.getter->scope != attributes::member_scope::scope_public)
385// || (property.setter && property.setter->scope != attributes::member_scope::scope_public)))
386// return true;
387// return false;
388// });
389
390// return ret;
391// }
392
287/* 393/*
288 * Checks whether the given is unique going up the inheritance tree from leaf_klass 394 * Checks whether the given is unique going up the inheritance tree from leaf_klass
289 */ 395 */
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index da6fd6d45c..9a494ef4c2 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -29,6 +29,7 @@
29#include "name_helpers.hh" 29#include "name_helpers.hh"
30#include "async_function_definition.hh" 30#include "async_function_definition.hh"
31#include "function_definition.hh" 31#include "function_definition.hh"
32#include "property_definition.hh"
32#include "function_registration.hh" 33#include "function_registration.hh"
33#include "function_declaration.hh" 34#include "function_declaration.hh"
34#include "documentation.hh" 35#include "documentation.hh"
@@ -142,7 +143,27 @@ struct klass
142 if(!as_generator("\n" << scope_tab << "{\n").generate(sink, attributes::unused, iface_cxt)) 143 if(!as_generator("\n" << scope_tab << "{\n").generate(sink, attributes::unused, iface_cxt))
143 return false; 144 return false;
144 145
145 if(!as_generator(*(function_declaration)).generate(sink, cls.functions, iface_cxt)) 146 auto properties = cls.properties;
147 auto functions = cls.functions;
148 functions.erase (std::remove_if (functions.begin(), functions.end()
149 , [&] (attributes::function_def const& f)
150 {
151 auto it = std::find_if (properties.begin(), properties.end()
152 , [&f] (attributes::property_def const& prop)
153 {
154 return (prop.getter && *prop.getter == f)
155 || (prop.setter && *prop.setter == f);
156 });
157 if (it != properties.end())
158 {
159 if (it->getter && *it->getter == f)
160 return property_generate_wrapper_getter (*it, iface_cxt);
161 else if (it->setter && *it->setter == f)
162 return property_generate_wrapper_setter (*it, iface_cxt);
163 }
164 return false;
165 }), functions.end());
166 if(!as_generator(*(function_declaration)).generate(sink, functions, iface_cxt))
146 return false; 167 return false;
147 168
148 if(!as_generator(*(async_function_declaration)).generate(sink, cls.functions, iface_cxt)) 169 if(!as_generator(*(async_function_declaration)).generate(sink, cls.functions, iface_cxt))
@@ -158,7 +179,10 @@ struct klass
158 ).generate(sink, p, iface_cxt)) 179 ).generate(sink, p, iface_cxt))
159 return false; 180 return false;
160 181
161 if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, cls.properties, iface_cxt)) 182 properties.erase(std::remove_if (properties.begin(), properties.end()
183 , [&] (attributes::property_def const& prop)
184 { return !property_generate_wrapper_getter (prop, iface_cxt); }), properties.end());
185 if (!as_generator(*(property_wrapper_definition(cls))).generate(sink, properties, iface_cxt))
162 return false; 186 return false;
163 187
164 // End of interface declaration 188 // End of interface declaration
@@ -246,7 +270,7 @@ struct klass
246 270
247 // Inherit function definitions 271 // Inherit function definitions
248 auto implemented_methods = helpers::get_all_implementable_methods(cls, inherit_cxt); 272 auto implemented_methods = helpers::get_all_implementable_methods(cls, inherit_cxt);
249 if(!as_generator(*(function_definition(true))) 273 if(!as_generator(*(function_definition(true, helpers::get_all_implementable_properties(cls, inherit_cxt))))
250 .generate(sink, implemented_methods, inherit_cxt)) return false; 274 .generate(sink, implemented_methods, inherit_cxt)) return false;
251 275
252 // Async wrappers 276 // Async wrappers
@@ -337,6 +361,7 @@ struct klass
337 auto native_inherit_name = name_helpers::klass_native_inherit_name(cls); 361 auto native_inherit_name = name_helpers::klass_native_inherit_name(cls);
338 auto inherit_name = name_helpers::klass_inherit_name(cls); 362 auto inherit_name = name_helpers::klass_inherit_name(cls);
339 auto implementable_methods = helpers::get_all_registerable_methods(cls, context); 363 auto implementable_methods = helpers::get_all_registerable_methods(cls, context);
364 auto implementable_properties = helpers::get_all_implementable_properties(cls, context);
340 bool root = !helpers::has_regular_ancestor(cls); 365 bool root = !helpers::has_regular_ancestor(cls);
341 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete; 366 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
342 auto const& indent = current_indentation(inative_cxt).inc(); 367 auto const& indent = current_indentation(inative_cxt).inc();
@@ -376,11 +401,12 @@ struct klass
376 return false; 401 return false;
377 } 402 }
378 403
379 if(implementable_methods.size() >= 1) 404 if(!implementable_methods.empty())
380 { 405 {
381 if(!as_generator( 406 if(!as_generator(
382 indent << scope_tab << "private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(" 407 indent << scope_tab << "private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule("
383 << context_find_tag<library_context>(context).actual_library_name(cls.filename) << ");\n\n" 408 << context_find_tag<library_context>(context).actual_library_name(cls.filename) << "); // " << implementable_methods.size()
409 << " " << implementable_properties.size() << "\n\n"
384 ).generate(sink, attributes::unused, inative_cxt)) 410 ).generate(sink, attributes::unused, inative_cxt))
385 return false; 411 return false;
386 } 412 }
@@ -455,10 +481,17 @@ struct klass
455 // Native method definitions 481 // Native method definitions
456 if(!as_generator( 482 if(!as_generator(
457 indent << scope_tab << "#pragma warning disable CA1707, CS1591, SA1300, SA1600\n\n" 483 indent << scope_tab << "#pragma warning disable CA1707, CS1591, SA1300, SA1600\n\n"
458 << *(native_function_definition(cls)) 484 << *(native_function_definition(cls, implementable_properties))
459 << indent << scope_tab << "#pragma warning restore CA1707, CS1591, SA1300, SA1600\n\n") 485 << indent << scope_tab << "#pragma warning restore CA1707, CS1591, SA1300, SA1600\n\n")
460 .generate(sink, implementable_methods, change_indentation(indent.inc(), inative_cxt))) return false; 486 .generate(sink, implementable_methods, change_indentation(indent.inc(), inative_cxt))) return false;
461 487
488 if(!as_generator(
489 indent << scope_tab << "#pragma warning disable CA1707, CS1591, SA1300, SA1600\n\n"
490 << *(native_property_function_definition(cls, cls))
491 << indent << scope_tab << "#pragma warning restore CA1707, CS1591, SA1300, SA1600\n\n")
492 .generate(sink, implementable_properties
493 , change_indentation(indent.inc(), inative_cxt))) return false;
494
462 if(!as_generator(indent << "}\n").generate(sink, attributes::unused, inative_cxt)) return false; 495 if(!as_generator(indent << "}\n").generate(sink, attributes::unused, inative_cxt)) return false;
463 } 496 }
464 return true; 497 return true;
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index abd94641ef..59faa0d493 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -34,6 +34,7 @@ namespace eolian_mono {
34 struct argument_generator; 34 struct argument_generator;
35 struct argument_invocation_generator; 35 struct argument_invocation_generator;
36 struct native_argument_invocation_generator; 36 struct native_argument_invocation_generator;
37 struct native_tuple_argument_invocation_generator;
37 struct native_convert_in_variable_generator; 38 struct native_convert_in_variable_generator;
38 struct convert_in_variable_generator; 39 struct convert_in_variable_generator;
39 struct native_convert_out_variable_generator; 40 struct native_convert_out_variable_generator;
@@ -109,6 +110,16 @@ struct attributes_needed< ::eolian_mono::native_argument_invocation_generator> :
109} 110}
110 111
111template <> 112template <>
113struct is_eager_generator< ::eolian_mono::native_tuple_argument_invocation_generator> : std::true_type {};
114template <>
115struct is_generator< ::eolian_mono::native_tuple_argument_invocation_generator> : std::true_type {};
116
117namespace type_traits {
118template <>
119struct attributes_needed< ::eolian_mono::native_tuple_argument_invocation_generator> : std::integral_constant<int, 1> {};
120}
121
122template <>
112struct is_eager_generator< ::eolian_mono::native_convert_in_variable_generator> : std::true_type {}; 123struct is_eager_generator< ::eolian_mono::native_convert_in_variable_generator> : std::true_type {};
113template <> 124template <>
114struct is_generator< ::eolian_mono::native_convert_in_variable_generator> : std::true_type {}; 125struct is_generator< ::eolian_mono::native_convert_in_variable_generator> : std::true_type {};
@@ -552,6 +563,28 @@ struct native_argument_invocation_generator
552 } 563 }
553} const native_argument_invocation {}; 564} const native_argument_invocation {};
554 565
566struct native_tuple_argument_invocation_generator
567{
568 template <typename OutputIterator, typename Context>
569 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
570 {
571 std::string arg;// = direction_modifier(param);
572
573 if (param_should_use_out_var(param, true))
574 arg += out_variable_name(param.param_name);
575 else if (param_should_use_in_var(param, true))
576 arg += in_variable_name(param.param_name);
577 else if (param.type.original_type.visit(is_fp_visitor{}))
578 {
579 arg += escape_keyword(param.param_name) + "_wrapper.ManagedCb";
580 }
581 else // FIXME Wrap data and C function pointers into some kind of structure.
582 arg += escape_keyword(param.param_name);
583
584 return as_generator(arg).generate(sink, attributes::unused, context);
585 }
586} const native_tuple_argument_invocation {};
587
555// Generates the correct parameter name when invoking a function 588// Generates the correct parameter name when invoking a function
556struct argument_invocation_generator 589struct argument_invocation_generator
557{ 590{
diff --git a/src/bin/eolian_mono/eolian/mono/property_definition.hh b/src/bin/eolian_mono/eolian/mono/property_definition.hh
new file mode 100644
index 0000000000..df94fc36e8
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/property_definition.hh
@@ -0,0 +1,383 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef EOLIAN_MONO_PROPERTY_DEFINITION_HH
17#define EOLIAN_MONO_PROPERTY_DEFINITION_HH
18
19#include "grammar/generator.hpp"
20#include "grammar/klass_def.hpp"
21
22#include "grammar/indentation.hpp"
23#include "grammar/list.hpp"
24#include "grammar/alternative.hpp"
25#include "type.hh"
26#include "parameter.hh"
27#include "name_helpers.hh"
28#include "using_decl.hh"
29#include "blacklist.hh"
30
31#include <eina_variant.hh>
32
33namespace eolian_mono {
34
35struct compare_get_and_set_value_type
36{
37 inline bool operator () (attributes::parameter_def const& get, attributes::parameter_def const& set) const;
38 inline bool operator () (attributes::type_def const& get, attributes::type_def const& set) const;
39};
40
41struct compare_get_and_set_value_type_overload
42{
43 template <typename T, typename U>
44 bool operator()(T const& /*left*/, U const& /*right*/) const
45 {
46 return false;
47 }
48 bool operator()(attributes::regular_type_def const& left, attributes::regular_type_def const& right) const
49 {
50 return left.base_type == right.base_type
51 && left.namespaces == right.namespaces;
52 }
53 bool operator()(attributes::complex_type_def const& left, attributes::complex_type_def const& right) const
54 {
55 return (*this)(left.outer, right.outer)
56 && std::equal (left.subtypes.begin(), left.subtypes.end(), right.subtypes.begin()
57 , compare_get_and_set_value_type{});
58 }
59 bool operator()(attributes::klass_name const& left, attributes::klass_name const& right) const
60 {
61 return left.namespaces == right.namespaces
62 && left.eolian_name == right.eolian_name;
63 }
64
65 typedef bool result_type;
66};
67
68inline bool compare_get_and_set_value_type::operator () (attributes::parameter_def const& get, attributes::parameter_def const& set) const
69{
70 return efl::eina::visit(compare_get_and_set_value_type_overload{}, get.type.original_type, set.type.original_type);
71}
72inline bool compare_get_and_set_value_type::operator () (attributes::type_def const& get, attributes::type_def const& set) const
73{
74 return efl::eina::visit(compare_get_and_set_value_type_overload{}, get.original_type, set.original_type);
75}
76
77template <typename Context>
78bool property_generate_wrapper_both_check(attributes::property_def const& property, Context const& context)
79{
80 if (blacklist::is_property_blacklisted(property, context))
81 return false;
82
83 bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
84 bool is_static = (property.getter.is_engaged() && property.getter->is_static)
85 || (property.setter.is_engaged() && property.setter->is_static);
86 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
87
88 if ((is_concrete || is_interface) && is_static)
89 return false;
90
91 if (!property.getter)
92 return false;
93
94 if (property.setter)
95 {
96 if (property.getter->values.size() == property.setter->values.size())
97 {
98 if (!std::equal (property.getter->values.begin(), property.getter->values.end(), property.setter->values.begin()
99 , compare_get_and_set_value_type{}))
100 return false;
101 }
102 else
103 return false;
104 }
105
106 return true;
107}
108
109template <typename Context>
110bool property_generate_wrapper_getter(attributes::property_def const& property, Context const& context)
111{
112 if (!property_generate_wrapper_both_check (property, context))
113 return false;
114
115 if (!property.getter->keys.empty())
116 return false;
117
118 if (property.getter->explicit_return_type != attributes::void_)
119 return false;
120
121 assert (!!property.getter.is_engaged());
122
123 bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
124 if (is_interface)
125 {
126 std::string get_scope = property.getter.is_engaged() ? eolian_mono::function_scope_get(*property.getter) : "";
127 bool is_get_public = get_scope == "public ";
128 if (!is_get_public)
129 return false;
130 }
131 return true;
132}
133
134template <typename Context>
135bool property_generate_wrapper_setter (attributes::property_def const& property, Context const& context)
136{
137 if (!property_generate_wrapper_both_check (property, context))
138 return false;
139 if (!property.setter)
140 return false;
141
142 if (property.setter->explicit_return_type != attributes::void_)
143 return false;
144
145 if (!property.setter->keys.empty())
146 return false;
147
148 bool is_interface = context_find_tag<class_context>(context).current_wrapper_kind == class_context::interface;
149 if (property.setter.is_engaged() && is_interface)
150 {
151 std::string set_scope = property.setter.is_engaged() ? eolian_mono::function_scope_get(*property.setter) : "";
152 bool is_set_public = set_scope == "public ";
153 if (!is_set_public)
154 return false;
155 }
156
157 return true;
158}
159
160struct native_property_function_definition_generator
161{
162 template <typename OutputIterator, typename Context>
163 bool generate(OutputIterator sink, attributes::property_def const& property, Context const& context) const
164 {
165 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "native_property_function_definition_generator: " << property.name << std::endl;
166
167 if(blacklist::is_property_blacklisted(property, context))
168 return true;
169
170 auto const& indent = current_indentation(context);
171
172 bool has_wrapper_getter = property_generate_wrapper_getter (property, context);
173 bool has_wrapper_setter = property_generate_wrapper_setter (property, context);
174
175 auto gen = [&] (attributes::function_def const& f, bool is_set)
176 {
177 // Delegate for the C# method we will export to EO as a method implementation.
178 if(!as_generator
179 (
180 indent << eolian_mono::marshall_annotation(true) << "\n"
181 << indent << "private delegate "
182 << eolian_mono::marshall_type(true)
183 << " "
184 << string
185 << "_delegate(" << (f.is_static ? "" : "System.IntPtr obj, System.IntPtr pd")
186 << ((!f.is_static && f.parameters.size() > 0) ? ", " : "")
187 << (grammar::attribute_reorder<-1, -1>
188 (
189 (marshall_annotation << " " << marshall_parameter)
190 ) % ", ")
191 << ");\n\n")
192 .generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context))
193 return false;
194
195 // API delegate is the wrapper for the Eo methods exported from C that we will use from C#.
196 if(!as_generator
197 (
198 indent << eolian_mono::marshall_annotation(true) << "\n"
199 << indent << "internal delegate "
200 << eolian_mono::marshall_type(true)
201 << " "
202 << string << "_api_delegate(" << (f.is_static ? "" : "System.IntPtr obj")
203 << ((!f.is_static && f.parameters.size() > 0) ? ", " : "")
204 << (grammar::attribute_reorder<-1, -1>
205 (
206 (marshall_annotation << " " << marshall_parameter)
207 ) % ", ")
208 << ");\n\n")
209 .generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context))
210 return false;
211
212 // Delegate holder (so it can't be collected).
213 if(!as_generator
214 (indent << "internal static readonly Efl.Eo.FunctionWrapper<" << string << "_api_delegate> " << string << "_ptr = new Efl.Eo.FunctionWrapper<"
215 << string << "_api_delegate>(Module, \"" << string << "\");\n\n")
216 .generate(sink, std::make_tuple(f.c_name, f.c_name, f.c_name, f.c_name), context))
217 return false;
218
219 // We do not generate the wrapper to be called from C for non public interface member directly.
220 if (blacklist::is_non_public_interface_member(f, *implementing_klass))
221 return true;
222
223 // Do not generate static method in interface
224 if (((implementing_klass->type == attributes::class_type::interface_) ||
225 (implementing_klass->type == attributes::class_type::mixin)) && f.is_static)
226 return true;
227
228 // Actual method implementation to be called from C.
229 std::string return_type;
230 if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
231 return false;
232
233 std::string klass_cast_name;
234 if ((implementing_klass->type == attributes::class_type::interface_) ||
235 ((implementing_klass->type == attributes::class_type::mixin) && !f.is_static))
236 klass_cast_name = name_helpers::klass_interface_name(*implementing_klass);
237 else
238 klass_cast_name = name_helpers::klass_inherit_name(*implementing_klass);
239
240 std::string self = "Efl.Eo.Globals.Super(obj, Efl.Eo.Globals.GetClass(obj))";
241
242 if (f.is_static)
243 self = "";
244
245 if(!as_generator
246 (indent << "[SuppressMessage(\"Microsoft.Reliability\", \"CA2000:DisposeObjectsBeforeLosingScope\", Justification = \"The instantiated objects can be stored in the called Managed API method.\")]\n"
247 << indent << "private static "
248 << eolian_mono::marshall_type(true) << " "
249 << string
250 << "(System.IntPtr obj, System.IntPtr pd"
251 << *(", " << marshall_parameter)
252 << ")\n"
253 << indent << "{\n"
254 << indent << scope_tab << "Eina.Log.Debug(\"function " << string << " was called\");\n"
255 << indent << scope_tab << "var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);\n"
256 << indent << scope_tab << "if (ws != null)\n"
257 << indent << scope_tab << "{\n"
258 << indent << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble() << "\n"
259 << indent << scope_tab << scope_tab << "try\n"
260 << indent << scope_tab << scope_tab << "{\n"
261 )
262 .generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters
263 , /***/f.c_name/***/
264 , f
265 ), context))
266 return false;
267 if (is_set/* && has_wrapper_setter*/)
268 {
269 if(!as_generator
270 (
271 indent << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "_ret_var = " : "")
272 << (f.is_static ? "" : "((") << klass_cast_name << (f.is_static ? "." : ")ws.Target).") << string
273 )
274 .generate(sink, std::make_tuple(name_helpers::property_managed_name(property), f.parameters), context))
275 return false;
276
277 if(!f.keys.empty() && !as_generator(lit("[(") << (native_argument_invocation % ", ") << ")]").generate (sink, f.keys, context))
278 return false;
279
280 if(!as_generator
281 (" = ("
282 << (native_tuple_argument_invocation % ", ") << ");\n"
283 )
284 .generate(sink, f.values, context))
285 return false;
286 }
287 else if (!is_set/* && has_wrapper_getter*/)
288 {
289 if(!as_generator
290 (
291 indent << scope_tab << scope_tab << scope_tab << "var ret = "
292 << (f.is_static ? "" : "((") << klass_cast_name << (f.is_static ? "." : ")ws.Target).")
293 << string
294
295 )
296 .generate(sink, std::make_tuple(name_helpers::property_managed_name(property)), context))
297 return false;
298
299 if(!f.keys.empty() && !as_generator(lit("[(") << (native_argument_invocation % ", ") << ")]").generate (sink, f.keys, context))
300 return false;
301
302 if (!as_generator(";\n").generate (sink, attributes::unused, context))
303 return false;
304
305 }
306 // else if (!as_generator
307 // (indent << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "_ret_var = " : "")
308 // << (f.is_static ? "" : "((") << klass_cast_name << (f.is_static ? "." : ")ws.Target).") << string
309 // << "(" << (native_argument_invocation % ", ") << ");\n"
310 // ).generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.parameters), context))
311 // return false;
312
313 if(!as_generator
314 (
315 indent << scope_tab << scope_tab << "}\n"
316 << indent << scope_tab << scope_tab << "catch (Exception e)\n"
317 << indent << scope_tab << scope_tab << "{\n"
318 << indent << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
319 << indent << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n"
320 << indent << scope_tab << scope_tab << "}\n\n"
321 << indent << eolian_mono::native_function_definition_epilogue(*implementing_klass) << "\n"
322 << indent << scope_tab << "}\n"
323 << indent << scope_tab << "else\n"
324 << indent << scope_tab << "{\n"
325 << indent << scope_tab << scope_tab << (return_type != "void" ? "return " : "") << string
326 << "_ptr.Value.Delegate(" << self << ((!f.is_static && f.parameters.size() > 0) ? ", " : "") << (argument % ", ") << ");\n"
327 << indent << scope_tab << "}\n"
328 << indent << "}\n\n"
329 )
330 .generate(sink, std::make_tuple(f, f.c_name, f.parameters), context))
331 return false;
332
333 // Static functions do not need to be called from C
334 if (f.is_static)
335 return true;
336
337 // This is the delegate that will be passed to Eo to be called from C.
338 if(!as_generator(
339 indent << "private static " << f.c_name << "_delegate " << f.c_name << "_static_delegate;\n\n"
340 ).generate(sink, attributes::unused, context))
341 return false;
342 return true;
343 };
344
345 bool r = true;
346 if(r && property.getter && has_wrapper_getter
347 && helpers::is_function_registerable (*property.getter, *implementing_klass))
348 r &= gen (*property.getter, false);
349 if(r && property.setter && has_wrapper_setter
350 && helpers::is_function_registerable (*property.setter, *implementing_klass))
351 r &= gen (*property.setter, true);
352 return r;
353 }
354
355 attributes::klass_def const* implementing_klass, *klass_from_property;
356};
357
358struct native_property_function_definition_parameterized
359{
360 native_property_function_definition_generator operator()(attributes::klass_def const& klass
361 , attributes::klass_def const& prop_from_klass) const
362 {
363 return {&klass, &prop_from_klass};
364 }
365} const native_property_function_definition;
366
367}
368
369namespace efl { namespace eolian { namespace grammar {
370
371template <>
372struct is_eager_generator< ::eolian_mono::native_property_function_definition_generator> : std::true_type {};
373template <>
374struct is_generator< ::eolian_mono::native_property_function_definition_generator> : std::true_type {};
375
376namespace type_traits {
377
378template <>
379struct attributes_needed< ::eolian_mono::native_property_function_definition_generator> : std::integral_constant<int, 1> {};
380
381} } } }
382
383#endif
diff --git a/src/bindings/cxx/eina_cxx/eina_variant.hh b/src/bindings/cxx/eina_cxx/eina_variant.hh
index a337f2e211..112549020f 100644
--- a/src/bindings/cxx/eina_cxx/eina_variant.hh
+++ b/src/bindings/cxx/eina_cxx/eina_variant.hh
@@ -24,9 +24,21 @@
24#include <iosfwd> 24#include <iosfwd>
25 25
26#include <eina_aligned_union.hh> 26#include <eina_aligned_union.hh>
27#include <eina_tuple.hh>
27 28
28namespace efl { namespace eina { 29namespace efl { namespace eina {
29 30
31template <typename... Args>
32struct variant;
33
34template <typename...Args>
35struct variant_size : std::tuple_size<std::tuple<Args...>>::type
36{
37};
38
39template <typename V>
40struct variant_as_tuple;
41
30namespace _impl { 42namespace _impl {
31 43
32template <typename T, typename U, typename...Others> 44template <typename T, typename U, typename...Others>
@@ -51,7 +63,57 @@ template <typename T, typename U, typename...Args>
51struct find : find_impl<0u, T, U, Args...> 63struct find : find_impl<0u, T, U, Args...>
52{}; 64{};
53 65
66template <std::size_t NT, std::size_t NV, typename TupleVariant, typename TypesFound>
67struct visit_impl_meta_args
68{
69 typedef std::integral_constant<std::size_t, NT> current_type_index;
70 typedef std::integral_constant<std::size_t, NV> current_variant_index;
71 typedef TupleVariant variants;
72 // typedef typename std::tuple_element<NV, variants>::type current_variant;
73 // typedef typename variant_as_tuple<current_variant>::type current_variant_types;
74 // typedef typename std::tuple_element<NT, current_variant_types>::type current_type;
75 typedef TypesFound types_found;
76};
77
78template <typename T> struct current_variant_types
79{
80 typedef typename std::tuple_element<T::current_variant_index::value, typename T::variants>::type current_variant;
81 typedef typename variant_as_tuple<current_variant>::type type;
82};
54} 83}
84
85// template <typename FoundTypes, std::size_t N, typename...Tuples>
86// struct call_n_visitor;
87
88// template <typename FoundTypes, std::size_t N, typename Tuple, typename...Tuples>
89// struct call_n_visitor<FoundTypes, N, Tuple, Tuples...>
90// {
91
92 /*
93 template <typename F>
94 static typename F::result_type call(int type, void* buffer, F f)
95 {
96 if(type == N)
97 {
98 using std::tuple_element;
99 typedef typename tuple_element<N, Tuple>::type type;
100 type* o = static_cast<type*>(buffer);
101 return f(*o);
102 }
103 else
104 return call_visitor<N+1, L, Tuple>::call(type, buffer, f);
105 }
106 */
107
108// template <typename FoundTypes, std::size_t L, typename Tuple>
109// struct call_n_visitor<FoundTypes, L, L, Tuple>
110// {
111// template <typename F, typename...Variants>
112// static typename F::result_type call(int, void const*, F, Variants&&... variants)
113// {
114// std::abort();
115// }
116// };
55 117
56template <std::size_t N, std::size_t L, typename Tuple> 118template <std::size_t N, std::size_t L, typename Tuple>
57struct call_visitor 119struct call_visitor
@@ -306,6 +368,11 @@ struct variant
306 { 368 {
307 return call_visitor<0u, sizeof...(Args), std::tuple<Args...>>::call(type, static_cast<void*>(&buffer), f); 369 return call_visitor<0u, sizeof...(Args), std::tuple<Args...>>::call(type, static_cast<void*>(&buffer), f);
308 } 370 }
371
372 constexpr std::size_t index() const
373 {
374 return type;
375 }
309 376
310private: 377private:
311 template <typename T> 378 template <typename T>
@@ -332,6 +399,103 @@ private:
332 * Member variable for holding the contained value. 399 * Member variable for holding the contained value.
333 */ 400 */
334 buffer_type buffer; 401 buffer_type buffer;
402
403 template <typename V>
404 friend struct variant_as_tuple;
405
406 // template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant, std::size_t...I>
407 // friend typename F::result_type visit_impl2
408 // (std::false_type, std::false_type
409 // , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&& f, TupleVariant&& variants, index_sequence<I...>);
410
411 // template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant, std::size_t...I>
412 // friend typename F::result_type visit_impl2
413 // (std::true_type, std::false_type
414 // , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&& f, TupleVariant&& variants, index_sequence<I...>);
415 // template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant, std::size_t...I>
416 // friend typename F::result_type visit_impl2
417 // (std::false_type, std::true_type
418 // , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&& f, TupleVariant&& variants, index_sequence<I...>);
419
420 // // template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant>
421 // // friend typename F::result_type visit_impl2
422 // // (std::true_type, std::false_type
423 // // , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&& f, TupleVariant&& variants)
424 // // {
425 // // }
426
427 // // template <typename F, typename...AllVariants, typename...Variants>
428 // // friend typename F::result_type call
429 // // (std::true_type, int, F &&, Variants&&... variants)
430 // // {
431 // // std::abort();
432 // // }
433
434 // // template <typename F, typename Variant, typename...Variants>
435 // // friend typename F::result_type call (F&&f, Variant&& variant, Variants&&... variants)
436 // // {
437 // // return call (std::integral_constant<bool, (N == variant_size<Variant>::value)>{}
438 // // , variant.type, std::forward<F>(f), std::forward<Variant>(variant), std::forward<Variants>(variants)...);
439 // // }
440
441 // // template <typename F, typename Variant, typename...Variants>
442 // // friend typename F::result_type call (F&&f, Variant&& variant, Variants&&... variants)
443 // // {
444 // // return call (std::integral_constant<bool, (N == variant_size<Variant>::value)>{}
445 // // , variant.type, std::forward<F>(f), std::forward<Variant>(variant), std::forward<Variants>(variants)...);
446 // // }
447
448 // template <typename F, typename...Variants>
449 // friend typename F::result_type visit_impl (F&& f, Variants&&... variants);
450};
451
452
453template <typename...VArgs>
454struct variant_as_tuple<variant<VArgs...>>
455{
456 typedef std::tuple<VArgs...> type;
457};
458
459template <typename...VArgs>
460struct variant_as_tuple<const variant<VArgs...>>
461{
462 typedef std::tuple<VArgs...> type;
463};
464
465template <typename...VArgs>
466struct variant_as_tuple<volatile variant<VArgs...>>
467{
468 typedef std::tuple<VArgs...> type;
469};
470
471template <typename...VArgs>
472struct variant_as_tuple<const volatile variant<VArgs...>>
473{
474 typedef std::tuple<VArgs...> type;
475};
476
477template <typename...VArgs>
478struct variant_as_tuple<variant<VArgs...>&>
479{
480 typedef std::tuple<VArgs...> type;
481};
482
483template <typename...VArgs>
484struct variant_as_tuple<const variant<VArgs...>&>
485{
486 typedef std::tuple<VArgs...> type;
487};
488
489template <typename...VArgs>
490struct variant_as_tuple<volatile variant<VArgs...>&>
491{
492 typedef std::tuple<VArgs...> type;
493};
494
495template <typename...VArgs>
496struct variant_as_tuple<const volatile variant<VArgs...>&>
497{
498 typedef std::tuple<VArgs...> type;
335}; 499};
336 500
337template <typename...Args> 501template <typename...Args>
@@ -372,7 +536,80 @@ T const& get(variant<Args...>const& variant, typename std::enable_if<_impl::is_o
372 else 536 else
373 throw std::logic_error(""); 537 throw std::logic_error("");
374} 538}
375 539
540template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant, std::size_t...I>
541 typename F::result_type visit_impl2
542 (std::false_type, std::true_type
543 , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&& f, TupleVariant&& variants
544 , eina::index_sequence<I...>)
545 {
546 return f (eina::get<typename std::tuple_element<I, Types>::type>(std::get<I>(variants))...);
547 }
548
549 template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant, std::size_t...I>
550 typename F::result_type visit_impl2
551 (std::true_type, std::false_type
552 , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&&, TupleVariant&&, eina::index_sequence<I...>)
553 {
554 std::abort();
555 }
556
557
558 template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant
559 , std::size_t...I>
560 typename F::result_type visit_impl2 (std::false_type, std::false_type
561 , _impl::visit_impl_meta_args<NT, NV, Tuple, Types>, F&& f, TupleVariant&& variants
562 , index_sequence<I...>)
563 {
564 using std::tuple_element;
565 typedef _impl::visit_impl_meta_args<NT, NV, Tuple, Types> meta_args;
566 if(std::get<NV>(variants).index() == NT)
567 {
568 typedef typename _impl::current_variant_types<meta_args>::type variant_types;
569 typedef typename tuple_element<NT, variant_types>::type type;
570 std::integral_constant<bool, (std::tuple_size<Tuple>::value == NV+1)> is_true {};
571 return visit_impl2( std::false_type{}
572 , is_true
573 , _impl::visit_impl_meta_args<0u, NV+1, Tuple, typename _mpl::push_back<Types, type>::type>{}
574 , std::forward<F>(f), std::forward<TupleVariant>(variants)
575 , make_index_sequence<std::tuple_size<TupleVariant>::value>{});
576 }
577 else
578 {
579 typedef typename _impl::current_variant_types<meta_args>::type variant_types;
580 return visit_impl2 (std::integral_constant<bool, (std::tuple_size<variant_types>::value == NT+1)>{}
581 , std::false_type{}
582 , _impl::visit_impl_meta_args<NT+1, NV, Tuple, Types>{}, std::forward<F>(f), std::forward<TupleVariant>(variants)
583 , make_index_sequence<std::tuple_size<TupleVariant>::value>{});
584 }
585 }
586
587 template <std::size_t NT, std::size_t NV, typename F, typename Tuple, typename Types, typename TupleVariant>
588 typename F::result_type visit_impl_aux (std::false_type fals, std::false_type
589 , _impl::visit_impl_meta_args<NT, NV, Tuple, Types> args, F&& f, TupleVariant&& variants)
590 {
591 return visit_impl2 (fals, fals, args, std::forward<F>(f), std::forward<TupleVariant>(variants)
592 , make_index_sequence<std::tuple_size<TupleVariant>::value>{});
593 }
594
595 template <typename F, typename...Variants>
596 typename F::result_type visit_impl (F&& f, Variants&&... variants)
597 {
598 return visit_impl_aux
599 (std::false_type{}
600 , std::false_type{}
601 , _impl::visit_impl_meta_args
602 <0u, 0u
603 , std::tuple<typename std::remove_cv<Variants>::type...>, std::tuple<>>{}, std::forward<F>(f), std::forward_as_tuple(std::forward<Variants>(variants)...));
604 }
605
606template <typename F, typename...Variants>
607auto visit (F&& function, Variants&& ... variants) -> typename F::result_type
608{
609 return visit_impl (std::forward<F>(function), std::forward<Variants>(variants)...);
610}
611
376} } 612} }
377 613
378#endif 614#endif
615
diff --git a/src/bindings/mono/efl_mono/GenericModel.cs b/src/bindings/mono/efl_mono/GenericModel.cs
index ae1b69cf3e..c23eeb64ab 100644
--- a/src/bindings/mono/efl_mono/GenericModel.cs
+++ b/src/bindings/mono/efl_mono/GenericModel.cs
@@ -33,20 +33,13 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
33 /// <summary>The list of properties available in the wrapped model.</summary> 33 /// <summary>The list of properties available in the wrapped model.</summary>
34 public IEnumerable<System.String> Properties 34 public IEnumerable<System.String> Properties
35 { 35 {
36 get { return GetProperties(); } 36 get { return model.Properties; }
37 } 37 }
38 38
39 /// <summary>The number of children in the wrapped model.</summary> 39 /// <summary>The number of children in the wrapped model.</summary>
40 public uint ChildrenCount 40 public uint ChildrenCount
41 { 41 {
42 get { return GetChildrenCount(); } 42 get { return model.ChildrenCount; }
43 }
44
45 /// <summary>The list of properties available in the wrapped model.</summary>
46 /// <returns>The list of properties in the model.</returns>
47 public IEnumerable<System.String> GetProperties()
48 {
49 return model.GetProperties();
50 } 43 }
51 44
52 /// <summary>Gets the value of the given property in the wrapped model.</summary> 45 /// <summary>Gets the value of the given property in the wrapped model.</summary>
@@ -67,13 +60,6 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
67 return model.SetProperty(property, value); 60 return model.SetProperty(property, value);
68 } 61 }
69 62
70 /// <summary>Returns the number of children in the wrapped model.</summary>
71 /// <returns>The number of children.</returns>
72 public uint GetChildrenCount()
73 {
74 return model.GetChildrenCount();
75 }
76
77 /// <summary>Returns an <see cref="Eina.Future" /> that will resolve when the property is ready to be read.</summary> 63 /// <summary>Returns an <see cref="Eina.Future" /> that will resolve when the property is ready to be read.</summary>
78 /// <param name="property">The property of the model.</param> 64 /// <param name="property">The property of the model.</param>
79 /// <returns>An <see cref="Eina.Future" /> that resolves when the property is ready.</returns> 65 /// <returns>An <see cref="Eina.Future" /> that resolves when the property is ready.</returns>
@@ -169,10 +155,10 @@ public class GenericModel<T> : Efl.Object, Efl.IModel
169 155
170 /// <summary>Get children as specified by iterator. 156 /// <summary>Get children as specified by iterator.
171 /// 157 ///
172 /// Provided index have to be between 0 and <see cref="Efl.IModel.GetChildrenCount"/>. 158 /// Provided index have to be between 0 and <see cref="Efl.IModel.ChildrenCount"/>.
173 /// 159 ///
174 /// This function might rely on <see cref="Efl.IModel.GetChildrenSlice"/> as a fallback.</summary> 160 /// This function might rely on <see cref="Efl.IModel.GetChildrenSlice"/> as a fallback.<br/>Since EFL 1.23.</summary>
175 /// <param name="indices">Indices of the requested children.</param> 161 /// <param name="indices">Indices of the requested children.</param>
176 /// <returns>Array of children</returns> 162 /// <returns>Array of children</returns>
177 public Eina.Future GetChildrenIndex(IEnumerable<uint> indices) 163 public Eina.Future GetChildrenIndex(IEnumerable<uint> indices)
178 { 164 {
diff --git a/src/bindings/mono/eo_mono/EoWrapper.cs b/src/bindings/mono/eo_mono/EoWrapper.cs
index db618232c4..e4ff8669e6 100644
--- a/src/bindings/mono/eo_mono/EoWrapper.cs
+++ b/src/bindings/mono/eo_mono/EoWrapper.cs
@@ -227,7 +227,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
227 public void Del() 227 public void Del()
228 { 228 {
229 // FIXME Implement this 229 // FIXME Implement this
230 ((Efl.Object)this).SetParent(null); 230 ((Efl.Object)this).Parent = null;
231 Dispose(); 231 Dispose();
232 } 232 }
233 233
diff --git a/src/lib/eolian_cxx/grammar/context.hpp b/src/lib/eolian_cxx/grammar/context.hpp
index 9e175a8ee5..e7bc014acb 100644
--- a/src/lib/eolian_cxx/grammar/context.hpp
+++ b/src/lib/eolian_cxx/grammar/context.hpp
@@ -40,28 +40,25 @@ context_add_tag(NewTag const& tag, context_null context)
40 return context_cons<NewTag, context_null>{tag, context}; 40 return context_cons<NewTag, context_null>{tag, context};
41} 41}
42 42
43template <typename Tag, typename SameTag, typename Tail> 43template <typename Tag, typename Tail>
44constexpr context_cons<SameTag, Tail> 44constexpr context_cons<Tag, Tail>
45context_replace_tag(Tag const& tag, context_cons<SameTag, Tail> const& context 45context_replace_tag(Tag const& tag, context_cons<Tag, Tail> const& context)
46 , typename std::enable_if<std::is_same<Tag, SameTag>::value>::type* = nullptr)
47{ 46{
48 return {tag, context.tail}; 47 return {tag, context.tail};
49} 48}
50 49
51template <typename Tag, typename OtherTag, typename Tail> 50template <typename Tag>
52constexpr context_cons<OtherTag, Tail> 51constexpr context_cons<Tag, context_null>
53context_replace_tag(Tag const& tag, context_cons<OtherTag, Tail> const& context 52context_replace_tag(Tag const& tag, context_null const&)
54 , typename std::enable_if<!std::is_same<Tag, OtherTag>::value>::type* = nullptr)
55{ 53{
56 return {context.tag, context_replace_tag(tag, context.tail)}; 54 return context_cons<Tag, context_null>{tag, context_null{}};
57} 55}
58 56
59template <typename Tag> 57template <typename Tag, typename OtherTag, typename Tail>
60constexpr context_null 58constexpr context_cons<OtherTag, decltype(context_replace_tag(std::declval<Tag>(), std::declval<Tail>()))>
61context_replace_tag(Tag const& tag, context_null const&) 59context_replace_tag(Tag const& tag, context_cons<OtherTag, Tail> const& context)
62{ 60{
63 static_assert(std::is_same<Tag, context_null>::value, "Tag type not available in this generation context"); 61 return {context.tag, context_replace_tag(tag, context.tail)};
64 return tag;
65} 62}
66 63
67template <typename Tag, typename Context> 64template <typename Tag, typename Context>
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index 162eac63ba..494dc8a62e 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -576,10 +576,10 @@ class TestEinaArray
576 var a = new Eina.Array<Dummy.Numberwrapper>(); 576 var a = new Eina.Array<Dummy.Numberwrapper>();
577 Test.Assert(a.Handle != IntPtr.Zero); 577 Test.Assert(a.Handle != IntPtr.Zero);
578 var o = new Dummy.Numberwrapper(); 578 var o = new Dummy.Numberwrapper();
579 o.SetNumber(88); 579 o.Number = 88;
580 Test.Assert(a.Push(o)); 580 Test.Assert(a.Push(o));
581 Test.Assert(a[0].NativeHandle == o.NativeHandle); 581 Test.Assert(a[0].NativeHandle == o.NativeHandle);
582 Test.Assert(a[0].GetNumber() == 88); 582 Test.Assert(a[0].Number == 88);
583 o.Dispose(); 583 o.Dispose();
584 a.Dispose(); 584 a.Dispose();
585 } 585 }
@@ -619,11 +619,11 @@ class TestEinaArray
619 var a = new Eina.Array<Dummy.Numberwrapper>(); 619 var a = new Eina.Array<Dummy.Numberwrapper>();
620 Test.Assert(a.Handle != IntPtr.Zero); 620 Test.Assert(a.Handle != IntPtr.Zero);
621 var o = new Dummy.Numberwrapper(); 621 var o = new Dummy.Numberwrapper();
622 o.SetNumber(88); 622 o.Number = 88;
623 Test.Assert(a.Push(o)); 623 Test.Assert(a.Push(o));
624 var p = a.Pop(); 624 var p = a.Pop();
625 Test.Assert(p.NativeHandle == o.NativeHandle); 625 Test.Assert(p.NativeHandle == o.NativeHandle);
626 Test.Assert(p.GetNumber() == 88); 626 Test.Assert(p.Number == 88);
627 Test.Assert(a.Count() == 0); 627 Test.Assert(a.Count() == 0);
628 o.Dispose(); 628 o.Dispose();
629 a.Dispose(); 629 a.Dispose();
@@ -674,25 +674,25 @@ class TestEinaArray
674 Test.Assert(a.Handle != IntPtr.Zero); 674 Test.Assert(a.Handle != IntPtr.Zero);
675 675
676 var o1 = new Dummy.Numberwrapper(); 676 var o1 = new Dummy.Numberwrapper();
677 o1.SetNumber(88); 677 o1.Number = 88;
678 678
679 Test.Assert(a.Push(o1)); 679 Test.Assert(a.Push(o1));
680 Test.Assert(a[0].NativeHandle == o1.NativeHandle); 680 Test.Assert(a[0].NativeHandle == o1.NativeHandle);
681 Test.Assert(a[0].GetNumber() == 88); 681 Test.Assert(a[0].Number == 88);
682 682
683 var o2 = new Dummy.Numberwrapper(); 683 var o2 = new Dummy.Numberwrapper();
684 o2.SetNumber(44); 684 o2.Number = 44;
685 685
686 a.DataSet(0, o2); 686 a.DataSet(0, o2);
687 Test.Assert(a[0].NativeHandle == o2.NativeHandle); 687 Test.Assert(a[0].NativeHandle == o2.NativeHandle);
688 Test.Assert(a[0].GetNumber() == 44); 688 Test.Assert(a[0].Number == 44);
689 689
690 var o3 = new Dummy.Numberwrapper(); 690 var o3 = new Dummy.Numberwrapper();
691 o3.SetNumber(22); 691 o3.Number = 22;
692 692
693 a[0] = o3; 693 a[0] = o3;
694 Test.Assert(a[0].NativeHandle == o3.NativeHandle); 694 Test.Assert(a[0].NativeHandle == o3.NativeHandle);
695 Test.Assert(a[0].GetNumber() == 22); 695 Test.Assert(a[0].Number == 22);
696 o3.Dispose(); 696 o3.Dispose();
697 o2.Dispose(); 697 o2.Dispose();
698 o1.Dispose(); 698 o1.Dispose();
@@ -758,24 +758,24 @@ class TestEinaArray
758 Test.Assert(a.Count() == 0); 758 Test.Assert(a.Count() == 0);
759 759
760 var o1 = new Dummy.Numberwrapper(); 760 var o1 = new Dummy.Numberwrapper();
761 o1.SetNumber(88); 761 o1.Number = 88;
762 Test.Assert(a.Push(o1)); 762 Test.Assert(a.Push(o1));
763 Test.Assert(a[0].NativeHandle == o1.NativeHandle); 763 Test.Assert(a[0].NativeHandle == o1.NativeHandle);
764 Test.Assert(a[0].GetNumber() == 88); 764 Test.Assert(a[0].Number == 88);
765 Test.Assert(a.Count() == 1); 765 Test.Assert(a.Count() == 1);
766 766
767 var o2 = new Dummy.Numberwrapper(); 767 var o2 = new Dummy.Numberwrapper();
768 o2.SetNumber(44); 768 o2.Number = 44;
769 Test.Assert(a.Push(o2)); 769 Test.Assert(a.Push(o2));
770 Test.Assert(a[1].NativeHandle == o2.NativeHandle); 770 Test.Assert(a[1].NativeHandle == o2.NativeHandle);
771 Test.Assert(a[1].GetNumber() == 44); 771 Test.Assert(a[1].Number == 44);
772 Test.Assert(a.Count() == 2); 772 Test.Assert(a.Count() == 2);
773 773
774 var o3 = new Dummy.Numberwrapper(); 774 var o3 = new Dummy.Numberwrapper();
775 o3.SetNumber(22); 775 o3.Number = 22;
776 Test.Assert(a.Push(o3)); 776 Test.Assert(a.Push(o3));
777 Test.Assert(a[2].NativeHandle == o3.NativeHandle); 777 Test.Assert(a[2].NativeHandle == o3.NativeHandle);
778 Test.Assert(a[2].GetNumber() == 22); 778 Test.Assert(a[2].Number == 22);
779 Test.Assert(a.Count() == 3); 779 Test.Assert(a.Count() == 3);
780 780
781 o3.Dispose(); 781 o3.Dispose();
@@ -891,9 +891,9 @@ class TestEinaArray
891 var a = new Dummy.Numberwrapper(); 891 var a = new Dummy.Numberwrapper();
892 var b = new Dummy.Numberwrapper(); 892 var b = new Dummy.Numberwrapper();
893 var c = new Dummy.Numberwrapper(); 893 var c = new Dummy.Numberwrapper();
894 a.SetNumber(88); 894 a.Number = 88;
895 b.SetNumber(44); 895 b.Number = 44;
896 c.SetNumber(22); 896 c.Number = 22;
897 var cmp = new Dummy.Numberwrapper[]{a, b, c}; 897 var cmp = new Dummy.Numberwrapper[]{a, b, c};
898 898
899 var arr = new Eina.Array<Dummy.Numberwrapper>(); 899 var arr = new Eina.Array<Dummy.Numberwrapper>();
@@ -905,7 +905,7 @@ class TestEinaArray
905 int i = 0; 905 int i = 0;
906 foreach (Dummy.Numberwrapper e in arr) 906 foreach (Dummy.Numberwrapper e in arr)
907 { 907 {
908 Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber()); 908 Test.AssertEquals(cmp[i].Number, e.Number);
909 Test.Assert(cmp[i].NativeHandle == e.NativeHandle); 909 Test.Assert(cmp[i].NativeHandle == e.NativeHandle);
910 ++i; 910 ++i;
911 } 911 }
@@ -1247,10 +1247,10 @@ class TestEinaInarray
1247 var a = new Eina.Inarray<Dummy.Numberwrapper>(); 1247 var a = new Eina.Inarray<Dummy.Numberwrapper>();
1248 Test.Assert(a.Handle != IntPtr.Zero); 1248 Test.Assert(a.Handle != IntPtr.Zero);
1249 var o = new Dummy.Numberwrapper(); 1249 var o = new Dummy.Numberwrapper();
1250 o.SetNumber(88); 1250 o.Number = 88;
1251 Test.Assert(a.Push(o) == 0); 1251 Test.Assert(a.Push(o) == 0);
1252 Test.Assert(a[0].NativeHandle == o.NativeHandle); 1252 Test.Assert(a[0].NativeHandle == o.NativeHandle);
1253 Test.Assert(a[0].GetNumber() == 88); 1253 Test.Assert(a[0].Number == 88);
1254 o.Dispose(); 1254 o.Dispose();
1255 a.Dispose(); 1255 a.Dispose();
1256 } 1256 }
@@ -1280,11 +1280,11 @@ class TestEinaInarray
1280 var a = new Eina.Inarray<Dummy.Numberwrapper>(); 1280 var a = new Eina.Inarray<Dummy.Numberwrapper>();
1281 Test.Assert(a.Handle != IntPtr.Zero); 1281 Test.Assert(a.Handle != IntPtr.Zero);
1282 var o = new Dummy.Numberwrapper(); 1282 var o = new Dummy.Numberwrapper();
1283 o.SetNumber(88); 1283 o.Number = 88;
1284 Test.Assert(a.Push(o) >= 0); 1284 Test.Assert(a.Push(o) >= 0);
1285 var p = a.Pop(); 1285 var p = a.Pop();
1286 Test.Assert(p.NativeHandle == o.NativeHandle); 1286 Test.Assert(p.NativeHandle == o.NativeHandle);
1287 Test.Assert(p.GetNumber() == 88); 1287 Test.Assert(p.Number == 88);
1288 Test.Assert(a.Count() == 0); 1288 Test.Assert(a.Count() == 0);
1289 o.Dispose(); 1289 o.Dispose();
1290 a.Dispose(); 1290 a.Dispose();
@@ -1326,26 +1326,26 @@ class TestEinaInarray
1326 Test.Assert(a.Handle != IntPtr.Zero); 1326 Test.Assert(a.Handle != IntPtr.Zero);
1327 1327
1328 var o1 = new Dummy.Numberwrapper(); 1328 var o1 = new Dummy.Numberwrapper();
1329 o1.SetNumber(88); 1329 o1.Number = 88;
1330 1330
1331 Test.Assert(a.Push(o1) >= 0); 1331 Test.Assert(a.Push(o1) >= 0);
1332 Test.Assert(a[0].NativeHandle == o1.NativeHandle); 1332 Test.Assert(a[0].NativeHandle == o1.NativeHandle);
1333 Test.Assert(a[0].GetNumber() == 88); 1333 Test.Assert(a[0].Number == 88);
1334 1334
1335 var o2 = new Dummy.Numberwrapper(); 1335 var o2 = new Dummy.Numberwrapper();
1336 o2.SetNumber(44); 1336 o2.Number = 44;
1337 1337
1338 a.ReplaceAt(0, o2); 1338 a.ReplaceAt(0, o2);
1339 Test.Assert(a[0].NativeHandle == o2.NativeHandle); 1339 Test.Assert(a[0].NativeHandle == o2.NativeHandle);
1340 Test.Assert(a[0].GetNumber() == 44); 1340 Test.Assert(a[0].Number == 44);
1341 Test.Assert(a.Count() == 1); 1341 Test.Assert(a.Count() == 1);
1342 1342
1343 var o3 = new Dummy.Numberwrapper(); 1343 var o3 = new Dummy.Numberwrapper();
1344 o3.SetNumber(22); 1344 o3.Number = 22;
1345 1345
1346 a[0] = o3; 1346 a[0] = o3;
1347 Test.Assert(a[0].NativeHandle == o3.NativeHandle); 1347 Test.Assert(a[0].NativeHandle == o3.NativeHandle);
1348 Test.Assert(a[0].GetNumber() == 22); 1348 Test.Assert(a[0].Number == 22);
1349 Test.Assert(a.Count() == 1); 1349 Test.Assert(a.Count() == 1);
1350 1350
1351 o3.Dispose(); 1351 o3.Dispose();
@@ -1396,24 +1396,24 @@ class TestEinaInarray
1396 Test.Assert(a.Count() == 0); 1396 Test.Assert(a.Count() == 0);
1397 1397
1398 var o1 = new Dummy.Numberwrapper(); 1398 var o1 = new Dummy.Numberwrapper();
1399 o1.SetNumber(88); 1399 o1.Number = 88;
1400 Test.Assert(a.Push(o1) == 0); 1400 Test.Assert(a.Push(o1) == 0);
1401 Test.Assert(a[0].NativeHandle == o1.NativeHandle); 1401 Test.Assert(a[0].NativeHandle == o1.NativeHandle);
1402 Test.Assert(a[0].GetNumber() == 88); 1402 Test.Assert(a[0].Number == 88);
1403 Test.Assert(a.Count() == 1); 1403 Test.Assert(a.Count() == 1);
1404 1404
1405 var o2 = new Dummy.Numberwrapper(); 1405 var o2 = new Dummy.Numberwrapper();
1406 o2.SetNumber(44); 1406 o2.Number = 44;
1407 Test.Assert(a.Push(o2) == 1); 1407 Test.Assert(a.Push(o2) == 1);
1408 Test.Assert(a[1].NativeHandle == o2.NativeHandle); 1408 Test.Assert(a[1].NativeHandle == o2.NativeHandle);
1409 Test.Assert(a[1].GetNumber() == 44); 1409 Test.Assert(a[1].Number == 44);
1410 Test.Assert(a.Count() == 2); 1410 Test.Assert(a.Count() == 2);
1411 1411
1412 var o3 = new Dummy.Numberwrapper(); 1412 var o3 = new Dummy.Numberwrapper();
1413 o3.SetNumber(22); 1413 o3.Number = 22;
1414 Test.Assert(a.Push(o3) == 2); 1414 Test.Assert(a.Push(o3) == 2);
1415 Test.Assert(a[2].NativeHandle == o3.NativeHandle); 1415 Test.Assert(a[2].NativeHandle == o3.NativeHandle);
1416 Test.Assert(a[2].GetNumber() == 22); 1416 Test.Assert(a[2].Number == 22);
1417 Test.Assert(a.Count() == 3); 1417 Test.Assert(a.Count() == 3);
1418 1418
1419 o3.Dispose(); 1419 o3.Dispose();
@@ -1495,9 +1495,9 @@ class TestEinaInarray
1495 var a = new Dummy.Numberwrapper(); 1495 var a = new Dummy.Numberwrapper();
1496 var b = new Dummy.Numberwrapper(); 1496 var b = new Dummy.Numberwrapper();
1497 var c = new Dummy.Numberwrapper(); 1497 var c = new Dummy.Numberwrapper();
1498 a.SetNumber(88); 1498 a.Number = 88;
1499 b.SetNumber(44); 1499 b.Number = 44;
1500 c.SetNumber(22); 1500 c.Number = 22;
1501 var cmp = new Dummy.Numberwrapper[]{a, b, c}; 1501 var cmp = new Dummy.Numberwrapper[]{a, b, c};
1502 1502
1503 var arr = new Eina.Inarray<Dummy.Numberwrapper>(); 1503 var arr = new Eina.Inarray<Dummy.Numberwrapper>();
@@ -1509,7 +1509,7 @@ class TestEinaInarray
1509 int i = 0; 1509 int i = 0;
1510 foreach (Dummy.Numberwrapper e in arr) 1510 foreach (Dummy.Numberwrapper e in arr)
1511 { 1511 {
1512 Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber()); 1512 Test.AssertEquals(cmp[i].Number, e.Number);
1513 Test.Assert(cmp[i].NativeHandle == e.NativeHandle); 1513 Test.Assert(cmp[i].NativeHandle == e.NativeHandle);
1514 ++i; 1514 ++i;
1515 } 1515 }
@@ -1571,25 +1571,25 @@ class TestEinaList
1571 var lst = new Eina.List<Dummy.Numberwrapper>(); 1571 var lst = new Eina.List<Dummy.Numberwrapper>();
1572 1572
1573 var o1 = new Dummy.Numberwrapper(); 1573 var o1 = new Dummy.Numberwrapper();
1574 o1.SetNumber(88); 1574 o1.Number = 88;
1575 1575
1576 lst.Append(o1); 1576 lst.Append(o1);
1577 Test.Assert(lst[0].NativeHandle == o1.NativeHandle); 1577 Test.Assert(lst[0].NativeHandle == o1.NativeHandle);
1578 Test.Assert(lst[0].GetNumber() == 88); 1578 Test.Assert(lst[0].Number == 88);
1579 1579
1580 var o2 = new Dummy.Numberwrapper(); 1580 var o2 = new Dummy.Numberwrapper();
1581 o2.SetNumber(44); 1581 o2.Number = 44;
1582 1582
1583 lst.DataSet(0, o2); 1583 lst.DataSet(0, o2);
1584 Test.Assert(lst[0].NativeHandle == o2.NativeHandle); 1584 Test.Assert(lst[0].NativeHandle == o2.NativeHandle);
1585 Test.Assert(lst[0].GetNumber() == 44); 1585 Test.Assert(lst[0].Number == 44);
1586 1586
1587 var o3 = new Dummy.Numberwrapper(); 1587 var o3 = new Dummy.Numberwrapper();
1588 o3.SetNumber(22); 1588 o3.Number = 22;
1589 1589
1590 lst[0] = o3; 1590 lst[0] = o3;
1591 Test.Assert(lst[0].NativeHandle == o3.NativeHandle); 1591 Test.Assert(lst[0].NativeHandle == o3.NativeHandle);
1592 Test.Assert(lst[0].GetNumber() == 22); 1592 Test.Assert(lst[0].Number == 22);
1593 o3.Dispose(); 1593 o3.Dispose();
1594 o2.Dispose(); 1594 o2.Dispose();
1595 o1.Dispose(); 1595 o1.Dispose();
@@ -1651,24 +1651,24 @@ class TestEinaList
1651 Test.Assert(lst.Count() == 0); 1651 Test.Assert(lst.Count() == 0);
1652 1652
1653 var o1 = new Dummy.Numberwrapper(); 1653 var o1 = new Dummy.Numberwrapper();
1654 o1.SetNumber(88); 1654 o1.Number = 88;
1655 lst.Append(o1); 1655 lst.Append(o1);
1656 Test.Assert(lst[0].NativeHandle == o1.NativeHandle); 1656 Test.Assert(lst[0].NativeHandle == o1.NativeHandle);
1657 Test.Assert(lst[0].GetNumber() == 88); 1657 Test.Assert(lst[0].Number == 88);
1658 Test.Assert(lst.Count() == 1); 1658 Test.Assert(lst.Count() == 1);
1659 1659
1660 var o2 = new Dummy.Numberwrapper(); 1660 var o2 = new Dummy.Numberwrapper();
1661 o2.SetNumber(44); 1661 o2.Number = 44;
1662 lst.Append(o2); 1662 lst.Append(o2);
1663 Test.Assert(lst[1].NativeHandle == o2.NativeHandle); 1663 Test.Assert(lst[1].NativeHandle == o2.NativeHandle);
1664 Test.Assert(lst[1].GetNumber() == 44); 1664 Test.Assert(lst[1].Number == 44);
1665 Test.Assert(lst.Count() == 2); 1665 Test.Assert(lst.Count() == 2);
1666 1666
1667 var o3 = new Dummy.Numberwrapper(); 1667 var o3 = new Dummy.Numberwrapper();
1668 o3.SetNumber(22); 1668 o3.Number = 22;
1669 lst.Append(o3); 1669 lst.Append(o3);
1670 Test.Assert(lst[2].NativeHandle == o3.NativeHandle); 1670 Test.Assert(lst[2].NativeHandle == o3.NativeHandle);
1671 Test.Assert(lst[2].GetNumber() == 22); 1671 Test.Assert(lst[2].Number == 22);
1672 Test.Assert(lst.Count() == 3); 1672 Test.Assert(lst.Count() == 3);
1673 o3.Dispose(); 1673 o3.Dispose();
1674 o2.Dispose(); 1674 o2.Dispose();
@@ -1779,24 +1779,24 @@ class TestEinaList
1779 Test.Assert(lst.Count() == 0); 1779 Test.Assert(lst.Count() == 0);
1780 1780
1781 var o1 = new Dummy.Numberwrapper(); 1781 var o1 = new Dummy.Numberwrapper();
1782 o1.SetNumber(88); 1782 o1.Number = 88;
1783 lst.Prepend(o1); 1783 lst.Prepend(o1);
1784 Test.Assert(lst[0].NativeHandle == o1.NativeHandle); 1784 Test.Assert(lst[0].NativeHandle == o1.NativeHandle);
1785 Test.Assert(lst[0].GetNumber() == 88); 1785 Test.Assert(lst[0].Number == 88);
1786 Test.Assert(lst.Count() == 1); 1786 Test.Assert(lst.Count() == 1);
1787 1787
1788 var o2 = new Dummy.Numberwrapper(); 1788 var o2 = new Dummy.Numberwrapper();
1789 o2.SetNumber(44); 1789 o2.Number = 44;
1790 lst.Prepend(o2); 1790 lst.Prepend(o2);
1791 Test.Assert(lst[0].NativeHandle == o2.NativeHandle); 1791 Test.Assert(lst[0].NativeHandle == o2.NativeHandle);
1792 Test.Assert(lst[0].GetNumber() == 44); 1792 Test.Assert(lst[0].Number == 44);
1793 Test.Assert(lst.Count() == 2); 1793 Test.Assert(lst.Count() == 2);
1794 1794
1795 var o3 = new Dummy.Numberwrapper(); 1795 var o3 = new Dummy.Numberwrapper();
1796 o3.SetNumber(22); 1796 o3.Number = 22;
1797 lst.Prepend(o3); 1797 lst.Prepend(o3);
1798 Test.Assert(lst[0].NativeHandle == o3.NativeHandle); 1798 Test.Assert(lst[0].NativeHandle == o3.NativeHandle);
1799 Test.Assert(lst[0].GetNumber() == 22); 1799 Test.Assert(lst[0].Number == 22);
1800 Test.Assert(lst.Count() == 3); 1800 Test.Assert(lst.Count() == 3);
1801 1801
1802 o3.Dispose(); 1802 o3.Dispose();
@@ -2025,9 +2025,9 @@ class TestEinaList
2025 var a = new Dummy.Numberwrapper(); 2025 var a = new Dummy.Numberwrapper();
2026 var b = new Dummy.Numberwrapper(); 2026 var b = new Dummy.Numberwrapper();
2027 var c = new Dummy.Numberwrapper(); 2027 var c = new Dummy.Numberwrapper();
2028 a.SetNumber(88); 2028 a.Number = 88;
2029 b.SetNumber(44); 2029 b.Number = 44;
2030 c.SetNumber(22); 2030 c.Number = 22;
2031 var cmp = new Dummy.Numberwrapper[]{a, b, c}; 2031 var cmp = new Dummy.Numberwrapper[]{a, b, c};
2032 2032
2033 var lst = new Eina.List<Dummy.Numberwrapper>(); 2033 var lst = new Eina.List<Dummy.Numberwrapper>();
@@ -2038,7 +2038,7 @@ class TestEinaList
2038 int i = 0; 2038 int i = 0;
2039 foreach (Dummy.Numberwrapper e in lst) 2039 foreach (Dummy.Numberwrapper e in lst)
2040 { 2040 {
2041 Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber()); 2041 Test.AssertEquals(cmp[i].Number, e.Number);
2042 Test.Assert(cmp[i].NativeHandle == e.NativeHandle); 2042 Test.Assert(cmp[i].NativeHandle == e.NativeHandle);
2043 ++i; 2043 ++i;
2044 } 2044 }
@@ -2366,25 +2366,25 @@ class TestEinaInlist
2366 var lst = new Eina.Inlist<Dummy.Numberwrapper>(); 2366 var lst = new Eina.Inlist<Dummy.Numberwrapper>();
2367 2367
2368 var o1 = new Dummy.Numberwrapper(); 2368 var o1 = new Dummy.Numberwrapper();
2369 o1.SetNumber(88); 2369 o1.Number = 88;
2370 2370
2371 lst.Append(o1); 2371 lst.Append(o1);
2372 Test.Assert(lst[0].NativeHandle == o1.NativeHandle); 2372 Test.Assert(lst[0].NativeHandle == o1.NativeHandle);
2373 Test.Assert(lst[0].GetNumber() == 88); 2373 Test.Assert(lst[0].Number == 88);
2374 2374
2375 var o2 = new Dummy.Numberwrapper(); 2375 var o2 = new Dummy.Numberwrapper();
2376 o2.SetNumber(44); 2376 o2.Number = 44;
2377 2377
2378 lst.DataSet(0, o2); 2378 lst.DataSet(0, o2);
2379 Test.Assert(lst[0].NativeHandle == o2.NativeHandle); 2379 Test.Assert(lst[0].NativeHandle == o2.NativeHandle);
2380 Test.Assert(lst[0].GetNumber() == 44); 2380 Test.Assert(lst[0].Number == 44);
2381 2381
2382 var o3 = new Dummy.Numberwrapper(); 2382 var o3 = new Dummy.Numberwrapper();
2383 o3.SetNumber(22); 2383 o3.Number = 22;
2384 2384
2385 lst[0] = o3; 2385 lst[0] = o3;
2386 Test.Assert(lst[0].NativeHandle == o3.NativeHandle); 2386 Test.Assert(lst[0].NativeHandle == o3.NativeHandle);
2387 Test.Assert(lst[0].GetNumber() == 22); 2387 Test.Assert(lst[0].Number == 22);
2388 2388
2389 Test.Assert(lst.Count() == 1); 2389 Test.Assert(lst.Count() == 1);
2390 o3.Dispose(); 2390 o3.Dispose();
@@ -2432,24 +2432,24 @@ class TestEinaInlist
2432 Test.Assert(lst.Count() == 0); 2432 Test.Assert(lst.Count() == 0);
2433 2433
2434 var o1 = new Dummy.Numberwrapper(); 2434 var o1 = new Dummy.Numberwrapper();
2435 o1.SetNumber(88); 2435 o1.Number = 88;
2436 lst.Append(o1); 2436 lst.Append(o1);
2437 Test.Assert(lst[0].NativeHandle == o1.NativeHandle); 2437 Test.Assert(lst[0].NativeHandle == o1.NativeHandle);
2438 Test.Assert(lst[0].GetNumber() == 88); 2438 Test.Assert(lst[0].Number == 88);
2439 Test.Assert(lst.Count() == 1); 2439 Test.Assert(lst.Count() == 1);
2440 2440
2441 var o2 = new Dummy.Numberwrapper(); 2441 var o2 = new Dummy.Numberwrapper();
2442 o2.SetNumber(44); 2442 o2.Number = 44;
2443 lst.Append(o2); 2443 lst.Append(o2);
2444 Test.Assert(lst[1].NativeHandle == o2.NativeHandle); 2444 Test.Assert(lst[1].NativeHandle == o2.NativeHandle);
2445 Test.Assert(lst[1].GetNumber() == 44); 2445 Test.Assert(lst[1].Number == 44);
2446 Test.Assert(lst.Count() == 2); 2446 Test.Assert(lst.Count() == 2);
2447 2447
2448 var o3 = new Dummy.Numberwrapper(); 2448 var o3 = new Dummy.Numberwrapper();
2449 o3.SetNumber(22); 2449 o3.Number = 22;
2450 lst.Append(o3); 2450 lst.Append(o3);
2451 Test.Assert(lst[2].NativeHandle == o3.NativeHandle); 2451 Test.Assert(lst[2].NativeHandle == o3.NativeHandle);
2452 Test.Assert(lst[2].GetNumber() == 22); 2452 Test.Assert(lst[2].Number == 22);
2453 Test.Assert(lst.Count() == 3); 2453 Test.Assert(lst.Count() == 3);
2454 o3.Dispose(); 2454 o3.Dispose();
2455 o2.Dispose(); 2455 o2.Dispose();
@@ -2528,24 +2528,24 @@ class TestEinaInlist
2528 Test.Assert(lst.Count() == 0); 2528 Test.Assert(lst.Count() == 0);
2529 2529
2530 var o1 = new Dummy.Numberwrapper(); 2530 var o1 = new Dummy.Numberwrapper();
2531 o1.SetNumber(88); 2531 o1.Number = 88;
2532 lst.Prepend(o1); 2532 lst.Prepend(o1);
2533 Test.Assert(lst[0].NativeHandle == o1.NativeHandle); 2533 Test.Assert(lst[0].NativeHandle == o1.NativeHandle);
2534 Test.Assert(lst[0].GetNumber() == 88); 2534 Test.Assert(lst[0].Number == 88);
2535 Test.Assert(lst.Count() == 1); 2535 Test.Assert(lst.Count() == 1);
2536 2536
2537 var o2 = new Dummy.Numberwrapper(); 2537 var o2 = new Dummy.Numberwrapper();
2538 o2.SetNumber(44); 2538 o2.Number = 44;
2539 lst.Prepend(o2); 2539 lst.Prepend(o2);
2540 Test.Assert(lst[0].NativeHandle == o2.NativeHandle); 2540 Test.Assert(lst[0].NativeHandle == o2.NativeHandle);
2541 Test.Assert(lst[0].GetNumber() == 44); 2541 Test.Assert(lst[0].Number == 44);
2542 Test.Assert(lst.Count() == 2); 2542 Test.Assert(lst.Count() == 2);
2543 2543
2544 var o3 = new Dummy.Numberwrapper(); 2544 var o3 = new Dummy.Numberwrapper();
2545 o3.SetNumber(22); 2545 o3.Number = 22;
2546 lst.Prepend(o3); 2546 lst.Prepend(o3);
2547 Test.Assert(lst[0].NativeHandle == o3.NativeHandle); 2547 Test.Assert(lst[0].NativeHandle == o3.NativeHandle);
2548 Test.Assert(lst[0].GetNumber() == 22); 2548 Test.Assert(lst[0].Number == 22);
2549 Test.Assert(lst.Count() == 3); 2549 Test.Assert(lst.Count() == 3);
2550 o3.Dispose(); 2550 o3.Dispose();
2551 o2.Dispose(); 2551 o2.Dispose();
@@ -2590,9 +2590,9 @@ class TestEinaInlist
2590 var a = new Dummy.Numberwrapper(); 2590 var a = new Dummy.Numberwrapper();
2591 var b = new Dummy.Numberwrapper(); 2591 var b = new Dummy.Numberwrapper();
2592 var c = new Dummy.Numberwrapper(); 2592 var c = new Dummy.Numberwrapper();
2593 a.SetNumber(88); 2593 a.Number = 88;
2594 b.SetNumber(44); 2594 b.Number = 44;
2595 c.SetNumber(22); 2595 c.Number = 22;
2596 var cmp = new Dummy.Numberwrapper[]{a, b, c}; 2596 var cmp = new Dummy.Numberwrapper[]{a, b, c};
2597 2597
2598 var lst = new Eina.Inlist<Dummy.Numberwrapper>(); 2598 var lst = new Eina.Inlist<Dummy.Numberwrapper>();
@@ -2603,7 +2603,7 @@ class TestEinaInlist
2603 int i = 0; 2603 int i = 0;
2604 foreach (Dummy.Numberwrapper e in lst) 2604 foreach (Dummy.Numberwrapper e in lst)
2605 { 2605 {
2606 Test.AssertEquals(cmp[i].GetNumber(), e.GetNumber()); 2606 Test.AssertEquals(cmp[i].Number, e.Number);
2607 Test.Assert(cmp[i].NativeHandle == e.NativeHandle); 2607 Test.Assert(cmp[i].NativeHandle == e.NativeHandle);
2608 ++i; 2608 ++i;
2609 } 2609 }
@@ -2690,17 +2690,17 @@ class TestEinaHash
2690 2690
2691 hsh[a] = aa; 2691 hsh[a] = aa;
2692 Test.Assert(hsh[a].NativeHandle == aa.NativeHandle); 2692 Test.Assert(hsh[a].NativeHandle == aa.NativeHandle);
2693 Test.Assert(hsh[a].GetNumber() == aa.GetNumber()); 2693 Test.Assert(hsh[a].Number == aa.Number);
2694 Test.Assert(hsh.Count == 1); 2694 Test.Assert(hsh.Count == 1);
2695 2695
2696 hsh[b] = bb; 2696 hsh[b] = bb;
2697 Test.Assert(hsh[b].NativeHandle == bb.NativeHandle); 2697 Test.Assert(hsh[b].NativeHandle == bb.NativeHandle);
2698 Test.Assert(hsh[b].GetNumber() == bb.GetNumber()); 2698 Test.Assert(hsh[b].Number == bb.Number);
2699 Test.Assert(hsh.Count == 2); 2699 Test.Assert(hsh.Count == 2);
2700 2700
2701 hsh[c] = cc; 2701 hsh[c] = cc;
2702 Test.Assert(hsh[c].NativeHandle == cc.NativeHandle); 2702 Test.Assert(hsh[c].NativeHandle == cc.NativeHandle);
2703 Test.Assert(hsh[c].GetNumber() == cc.GetNumber()); 2703 Test.Assert(hsh[c].Number == cc.Number);
2704 2704
2705 Test.Assert(hsh.Count == 3); 2705 Test.Assert(hsh.Count == 3);
2706 2706
@@ -2810,17 +2810,17 @@ class TestEinaHash
2810 hsh[b] = bb; 2810 hsh[b] = bb;
2811 hsh[c] = cc; 2811 hsh[c] = cc;
2812 2812
2813 dct[a.GetNumber()] = aa; 2813 dct[a.Number] = aa;
2814 dct[b.GetNumber()] = bb; 2814 dct[b.Number] = bb;
2815 dct[c.GetNumber()] = cc; 2815 dct[c.Number] = cc;
2816 2816
2817 int count = 0; 2817 int count = 0;
2818 2818
2819 foreach (KeyValuePair<Dummy.Numberwrapper, Dummy.Numberwrapper> kvp in hsh) 2819 foreach (KeyValuePair<Dummy.Numberwrapper, Dummy.Numberwrapper> kvp in hsh)
2820 { 2820 {
2821 Test.Assert(dct[kvp.Key.GetNumber()].NativeHandle == kvp.Value.NativeHandle); 2821 Test.Assert(dct[kvp.Key.Number].NativeHandle == kvp.Value.NativeHandle);
2822 Test.Assert(dct[kvp.Key.GetNumber()].GetNumber() == kvp.Value.GetNumber()); 2822 Test.Assert(dct[kvp.Key.Number].Number == kvp.Value.Number);
2823 dct.Remove(kvp.Key.GetNumber()); 2823 dct.Remove(kvp.Key.Number);
2824 ++count; 2824 ++count;
2825 } 2825 }
2826 2826
@@ -3121,11 +3121,11 @@ class TestEinaHash
3121 Test.Assert(t.EinaHashObjIn(hsh, nwk1, nwv1, out nwk2, out nwv2)); 3121 Test.Assert(t.EinaHashObjIn(hsh, nwk1, nwv1, out nwk2, out nwv2));
3122 Test.Assert(hsh.Own); 3122 Test.Assert(hsh.Own);
3123 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle); 3123 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle);
3124 Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber()); 3124 Test.Assert(hsh[nwk1].Number == nwv1.Number);
3125 Test.Assert(hsh[nwk1].GetNumber() == 222); 3125 Test.Assert(hsh[nwk1].Number == 222);
3126 Test.Assert(hsh[nwk2].NativeHandle == nwv2.NativeHandle); 3126 Test.Assert(hsh[nwk2].NativeHandle == nwv2.NativeHandle);
3127 Test.Assert(hsh[nwk2].GetNumber() == nwv2.GetNumber()); 3127 Test.Assert(hsh[nwk2].Number == nwv2.Number);
3128 Test.Assert(hsh[nwk2].GetNumber() == 444); 3128 Test.Assert(hsh[nwk2].Number == 444);
3129 nwk1.Dispose(); 3129 nwk1.Dispose();
3130 nwk2.Dispose(); 3130 nwk2.Dispose();
3131 nwv1.Dispose(); 3131 nwv1.Dispose();
@@ -3147,11 +3147,11 @@ class TestEinaHash
3147 Test.Assert(t.EinaHashObjInOwn(hsh, nwk1, nwv1, out nwk2, out nwv2)); 3147 Test.Assert(t.EinaHashObjInOwn(hsh, nwk1, nwv1, out nwk2, out nwv2));
3148 Test.Assert(!hsh.Own); 3148 Test.Assert(!hsh.Own);
3149 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle); 3149 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle);
3150 Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber()); 3150 Test.Assert(hsh[nwk1].Number == nwv1.Number);
3151 Test.Assert(hsh[nwk1].GetNumber() == 222); 3151 Test.Assert(hsh[nwk1].Number == 222);
3152 Test.Assert(hsh[nwk2].NativeHandle == nwv2.NativeHandle); 3152 Test.Assert(hsh[nwk2].NativeHandle == nwv2.NativeHandle);
3153 Test.Assert(hsh[nwk2].GetNumber() == nwv2.GetNumber()); 3153 Test.Assert(hsh[nwk2].Number == nwv2.Number);
3154 Test.Assert(hsh[nwk2].GetNumber() == 444); 3154 Test.Assert(hsh[nwk2].Number == 444);
3155 hsh.Dispose(); 3155 hsh.Dispose();
3156 Test.Assert(hsh.Handle == IntPtr.Zero); 3156 Test.Assert(hsh.Handle == IntPtr.Zero);
3157 Test.Assert(t.CheckEinaHashObjInOwn(nwk1, nwv1, nwk2, nwv2)); 3157 Test.Assert(t.CheckEinaHashObjInOwn(nwk1, nwv1, nwk2, nwv2));
@@ -3171,8 +3171,8 @@ class TestEinaHash
3171 Test.Assert(t.EinaHashObjOut(out hsh, out nwk1, out nwv1)); 3171 Test.Assert(t.EinaHashObjOut(out hsh, out nwk1, out nwv1));
3172 Test.Assert(!hsh.Own); 3172 Test.Assert(!hsh.Own);
3173 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle); 3173 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle);
3174 Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber()); 3174 Test.Assert(hsh[nwk1].Number == nwv1.Number);
3175 Test.Assert(hsh[nwk1].GetNumber() == 222); 3175 Test.Assert(hsh[nwk1].Number == 222);
3176 Dummy.Numberwrapper nwk2 = NW(44); 3176 Dummy.Numberwrapper nwk2 = NW(44);
3177 Dummy.Numberwrapper nwv2 = NW(444); 3177 Dummy.Numberwrapper nwv2 = NW(444);
3178 hsh[nwk2] = nwv2; 3178 hsh[nwk2] = nwv2;
@@ -3195,8 +3195,8 @@ class TestEinaHash
3195 Test.Assert(t.EinaHashObjOutOwn(out hsh, out nwk1, out nwv1)); 3195 Test.Assert(t.EinaHashObjOutOwn(out hsh, out nwk1, out nwv1));
3196 Test.Assert(hsh.Own); 3196 Test.Assert(hsh.Own);
3197 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle); 3197 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle);
3198 Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber()); 3198 Test.Assert(hsh[nwk1].Number == nwv1.Number);
3199 Test.Assert(hsh[nwk1].GetNumber() == 222); 3199 Test.Assert(hsh[nwk1].Number == 222);
3200 Dummy.Numberwrapper nwk2 = NW(44); 3200 Dummy.Numberwrapper nwk2 = NW(44);
3201 Dummy.Numberwrapper nwv2 = NW(444); 3201 Dummy.Numberwrapper nwv2 = NW(444);
3202 hsh[nwk2] = nwv2; 3202 hsh[nwk2] = nwv2;
@@ -3218,8 +3218,8 @@ class TestEinaHash
3218 var hsh = t.EinaHashObjReturn(out nwk1, out nwv1); 3218 var hsh = t.EinaHashObjReturn(out nwk1, out nwv1);
3219 Test.Assert(!hsh.Own); 3219 Test.Assert(!hsh.Own);
3220 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle); 3220 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle);
3221 Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber()); 3221 Test.Assert(hsh[nwk1].Number == nwv1.Number);
3222 Test.Assert(hsh[nwk1].GetNumber() == 222); 3222 Test.Assert(hsh[nwk1].Number == 222);
3223 Dummy.Numberwrapper nwk2 = NW(44); 3223 Dummy.Numberwrapper nwk2 = NW(44);
3224 Dummy.Numberwrapper nwv2 = NW(444); 3224 Dummy.Numberwrapper nwv2 = NW(444);
3225 hsh[nwk2] = nwv2; 3225 hsh[nwk2] = nwv2;
@@ -3241,8 +3241,8 @@ class TestEinaHash
3241 var hsh = t.EinaHashObjReturnOwn(out nwk1, out nwv1); 3241 var hsh = t.EinaHashObjReturnOwn(out nwk1, out nwv1);
3242 Test.Assert(hsh.Own); 3242 Test.Assert(hsh.Own);
3243 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle); 3243 Test.Assert(hsh[nwk1].NativeHandle == nwv1.NativeHandle);
3244 Test.Assert(hsh[nwk1].GetNumber() == nwv1.GetNumber()); 3244 Test.Assert(hsh[nwk1].Number == nwv1.Number);
3245 Test.Assert(hsh[nwk1].GetNumber() == 222); 3245 Test.Assert(hsh[nwk1].Number == 222);
3246 Dummy.Numberwrapper nwk2 = NW(44); 3246 Dummy.Numberwrapper nwk2 = NW(44);
3247 Dummy.Numberwrapper nwv2 = NW(444); 3247 Dummy.Numberwrapper nwv2 = NW(444);
3248 hsh[nwk2] = nwv2; 3248 hsh[nwk2] = nwv2;
@@ -3395,7 +3395,7 @@ class TestEinaIterator
3395 foreach (Dummy.Numberwrapper e in itr) 3395 foreach (Dummy.Numberwrapper e in itr)
3396 { 3396 {
3397 Test.Assert(e.NativeHandle == base_objs[idx].NativeHandle); 3397 Test.Assert(e.NativeHandle == base_objs[idx].NativeHandle);
3398 Test.Assert(e.GetNumber() == base_objs[idx].GetNumber()); 3398 Test.Assert(e.Number == base_objs[idx].Number);
3399 ++idx; 3399 ++idx;
3400 } 3400 }
3401 Test.AssertEquals(idx, base_objs.Length); 3401 Test.AssertEquals(idx, base_objs.Length);
@@ -3561,7 +3561,7 @@ class TestEinaIterator
3561 foreach (Dummy.Numberwrapper e in itr) 3561 foreach (Dummy.Numberwrapper e in itr)
3562 { 3562 {
3563 Test.Assert(e.NativeHandle == base_objs[idx].NativeHandle); 3563 Test.Assert(e.NativeHandle == base_objs[idx].NativeHandle);
3564 Test.Assert(e.GetNumber() == base_objs[idx].GetNumber()); 3564 Test.Assert(e.Number == base_objs[idx].Number);
3565 ++idx; 3565 ++idx;
3566 } 3566 }
3567 Test.AssertEquals(idx, base_objs.Length); 3567 Test.AssertEquals(idx, base_objs.Length);
@@ -3903,19 +3903,19 @@ class TestEinaIterator
3903 hsh[a] = aa; 3903 hsh[a] = aa;
3904 hsh[b] = bb; 3904 hsh[b] = bb;
3905 hsh[c] = cc; 3905 hsh[c] = cc;
3906 dct[a.GetNumber()] = a; 3906 dct[a.Number] = a;
3907 dct[b.GetNumber()] = b; 3907 dct[b.Number] = b;
3908 dct[c.GetNumber()] = c; 3908 dct[c.Number] = c;
3909 3909
3910 var itr = hsh.Keys(); 3910 var itr = hsh.Keys();
3911 3911
3912 int idx = 0; 3912 int idx = 0;
3913 foreach (Dummy.Numberwrapper e in itr) 3913 foreach (Dummy.Numberwrapper e in itr)
3914 { 3914 {
3915 Test.Assert(dct[e.GetNumber()] != null); 3915 Test.Assert(dct[e.Number] != null);
3916 Test.Assert(dct[e.GetNumber()].NativeHandle == e.NativeHandle); 3916 Test.Assert(dct[e.Number].NativeHandle == e.NativeHandle);
3917 Test.Assert(dct[e.GetNumber()].GetNumber() == e.GetNumber()); 3917 Test.Assert(dct[e.Number].Number == e.Number);
3918 dct.Remove(e.GetNumber()); 3918 dct.Remove(e.Number);
3919 ++idx; 3919 ++idx;
3920 } 3920 }
3921 Test.AssertEquals(dct.Count, 0); 3921 Test.AssertEquals(dct.Count, 0);
@@ -3939,19 +3939,19 @@ class TestEinaIterator
3939 hsh[a] = aa; 3939 hsh[a] = aa;
3940 hsh[b] = bb; 3940 hsh[b] = bb;
3941 hsh[c] = cc; 3941 hsh[c] = cc;
3942 dct[aa.GetNumber()] = aa; 3942 dct[aa.Number] = aa;
3943 dct[bb.GetNumber()] = bb; 3943 dct[bb.Number] = bb;
3944 dct[cc.GetNumber()] = cc; 3944 dct[cc.Number] = cc;
3945 3945
3946 var itr = hsh.Values(); 3946 var itr = hsh.Values();
3947 3947
3948 int idx = 0; 3948 int idx = 0;
3949 foreach (Dummy.Numberwrapper e in itr) 3949 foreach (Dummy.Numberwrapper e in itr)
3950 { 3950 {
3951 Test.Assert(dct[e.GetNumber()] != null); 3951 Test.Assert(dct[e.Number] != null);
3952 Test.Assert(dct[e.GetNumber()].NativeHandle == e.NativeHandle); 3952 Test.Assert(dct[e.Number].NativeHandle == e.NativeHandle);
3953 Test.Assert(dct[e.GetNumber()].GetNumber() == e.GetNumber()); 3953 Test.Assert(dct[e.Number].Number == e.Number);
3954 dct.Remove(e.GetNumber()); 3954 dct.Remove(e.Number);
3955 ++idx; 3955 ++idx;
3956 } 3956 }
3957 Test.AssertEquals(dct.Count, 0); 3957 Test.AssertEquals(dct.Count, 0);
@@ -4392,7 +4392,7 @@ class TestEinaIterator
4392 int idx = 0; 4392 int idx = 0;
4393 foreach (Dummy.Numberwrapper e in itr) 4393 foreach (Dummy.Numberwrapper e in itr)
4394 { 4394 {
4395 Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber()); 4395 Test.AssertEquals(e.Number, base_seq_obj[idx].Number);
4396 ++idx; 4396 ++idx;
4397 } 4397 }
4398 Test.AssertEquals(idx, base_seq_obj.Length); 4398 Test.AssertEquals(idx, base_seq_obj.Length);
@@ -4413,7 +4413,7 @@ class TestEinaIterator
4413 int idx = 0; 4413 int idx = 0;
4414 foreach (Dummy.Numberwrapper e in itr) 4414 foreach (Dummy.Numberwrapper e in itr)
4415 { 4415 {
4416 Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber()); 4416 Test.AssertEquals(e.Number, base_seq_obj[idx].Number);
4417 ++idx; 4417 ++idx;
4418 } 4418 }
4419 Test.AssertEquals(idx, base_seq_obj.Length); 4419 Test.AssertEquals(idx, base_seq_obj.Length);
@@ -4432,7 +4432,7 @@ class TestEinaIterator
4432 int idx = 0; 4432 int idx = 0;
4433 foreach (Dummy.Numberwrapper e in itr) 4433 foreach (Dummy.Numberwrapper e in itr)
4434 { 4434 {
4435 Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber()); 4435 Test.AssertEquals(e.Number, base_seq_obj[idx].Number);
4436 ++idx; 4436 ++idx;
4437 } 4437 }
4438 Test.AssertEquals(idx, base_seq_obj.Length); 4438 Test.AssertEquals(idx, base_seq_obj.Length);
@@ -4452,7 +4452,7 @@ class TestEinaIterator
4452 int idx = 0; 4452 int idx = 0;
4453 foreach (Dummy.Numberwrapper e in itr) 4453 foreach (Dummy.Numberwrapper e in itr)
4454 { 4454 {
4455 Test.AssertEquals(e.GetNumber(), base_seq_obj[idx].GetNumber()); 4455 Test.AssertEquals(e.Number, base_seq_obj[idx].Number);
4456 ++idx; 4456 ++idx;
4457 } 4457 }
4458 Test.AssertEquals(idx, base_seq_obj.Length); 4458 Test.AssertEquals(idx, base_seq_obj.Length);
diff --git a/src/tests/efl_mono/EinaTestData.cs b/src/tests/efl_mono/EinaTestData.cs
index 411e38d576..2fd46f214b 100644
--- a/src/tests/efl_mono/EinaTestData.cs
+++ b/src/tests/efl_mono/EinaTestData.cs
@@ -49,7 +49,7 @@ public static class BaseData
49 public static Dummy.Numberwrapper NW(int n) 49 public static Dummy.Numberwrapper NW(int n)
50 { 50 {
51 var nw = new Dummy.Numberwrapper(); 51 var nw = new Dummy.Numberwrapper();
52 nw.SetNumber(n); 52 nw.Number = n;
53 return nw; 53 return nw;
54 } 54 }
55 55
@@ -58,9 +58,9 @@ public static class BaseData
58 var a = new Dummy.Numberwrapper(); 58 var a = new Dummy.Numberwrapper();
59 var b = new Dummy.Numberwrapper(); 59 var b = new Dummy.Numberwrapper();
60 var c = new Dummy.Numberwrapper(); 60 var c = new Dummy.Numberwrapper();
61 a.SetNumber(0x0); 61 a.Number = 0x0;
62 b.SetNumber(0x2A); 62 b.Number = 0x2A;
63 c.SetNumber(0x42); 63 c.Number = 0x42;
64 return new Dummy.Numberwrapper[]{a, b, c}; 64 return new Dummy.Numberwrapper[]{a, b, c};
65 } 65 }
66 66
@@ -69,9 +69,9 @@ public static class BaseData
69 var a = new Dummy.Numberwrapper(); 69 var a = new Dummy.Numberwrapper();
70 var b = new Dummy.Numberwrapper(); 70 var b = new Dummy.Numberwrapper();
71 var c = new Dummy.Numberwrapper(); 71 var c = new Dummy.Numberwrapper();
72 a.SetNumber(42); 72 a.Number = 42;
73 b.SetNumber(43); 73 b.Number = 43;
74 c.SetNumber(33); 74 c.Number = 33;
75 return new Dummy.Numberwrapper[]{a, b, c}; 75 return new Dummy.Numberwrapper[]{a, b, c};
76 } 76 }
77 77
@@ -83,12 +83,12 @@ public static class BaseData
83 var d = new Dummy.Numberwrapper(); 83 var d = new Dummy.Numberwrapper();
84 var e = new Dummy.Numberwrapper(); 84 var e = new Dummy.Numberwrapper();
85 var f = new Dummy.Numberwrapper(); 85 var f = new Dummy.Numberwrapper();
86 a.SetNumber(0x0); 86 a.Number = 0x0;
87 b.SetNumber(0x2A); 87 b.Number = 0x2A;
88 c.SetNumber(0x42); 88 c.Number = 0x42;
89 d.SetNumber(42); 89 d.Number = 42;
90 e.SetNumber(43); 90 e.Number = 43;
91 f.SetNumber(33); 91 f.Number = 33;
92 return new Dummy.Numberwrapper[]{a, b, c, d, e, f}; 92 return new Dummy.Numberwrapper[]{a, b, c, d, e, f};
93 } 93 }
94 94
@@ -102,8 +102,8 @@ public static class BaseData
102 Test.Assert(a.Length == b.Length, "Different lenght", line, file, member); 102 Test.Assert(a.Length == b.Length, "Different lenght", line, file, member);
103 for (int i = 0; i < a.Length; ++i) 103 for (int i = 0; i < a.Length; ++i)
104 { 104 {
105 int av = a[i].GetNumber(); 105 int av = a[i].Number;
106 int bv = b[i].GetNumber(); 106 int bv = b[i].Number;
107 Test.Assert(av == bv, $"Different values for element [{i}]: {av} == {bv}", line, file, member); 107 Test.Assert(av == bv, $"Different values for element [{i}]: {av} == {bv}", line, file, member);
108 } 108 }
109 } 109 }
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index 8d00155e10..8c0c9ab994 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -149,8 +149,8 @@ class TestEoNames
149 var obj = new Dummy.TestObject(); 149 var obj = new Dummy.TestObject();
150 150
151 string name = "Dummy"; 151 string name = "Dummy";
152 obj.SetName(name); 152 obj.Name = name;
153 Test.AssertEquals(name, obj.GetName()); 153 Test.AssertEquals(name, obj.Name);
154 obj.Dispose(); 154 obj.Dispose();
155 } 155 }
156} 156}
@@ -162,9 +162,9 @@ class TestEoParent
162 var parent = new Dummy.TestObject(null); 162 var parent = new Dummy.TestObject(null);
163 var child = new Dummy.TestObject(parent); 163 var child = new Dummy.TestObject(parent);
164 164
165 Test.AssertEquals(parent, child.GetParent()); 165 Test.AssertEquals(parent, child.Parent);
166 166
167 var parent_retrieved = child.GetParent() as Dummy.TestObject; 167 var parent_retrieved = child.Parent as Dummy.TestObject;
168 Test.AssertEquals(parent, parent_retrieved); 168 Test.AssertEquals(parent, parent_retrieved);
169 child.Dispose(); 169 child.Dispose();
170 parent.Dispose(); 170 parent.Dispose();
@@ -175,9 +175,9 @@ class TestEoParent
175 Dummy.Numberwrapper parent = new Dummy.Numberwrapper(null); 175 Dummy.Numberwrapper parent = new Dummy.Numberwrapper(null);
176 var child = new Dummy.TestObject(parent); 176 var child = new Dummy.TestObject(parent);
177 177
178 Test.AssertEquals(parent, child.GetParent()); 178 Test.AssertEquals(parent, child.Parent);
179 179
180 Dummy.Numberwrapper parent_retrieved = child.GetParent() as Dummy.Numberwrapper; 180 Dummy.Numberwrapper parent_retrieved = child.Parent as Dummy.Numberwrapper;
181 Test.AssertEquals(parent, parent_retrieved); 181 Test.AssertEquals(parent, parent_retrieved);
182 child.Dispose(); 182 child.Dispose();
183 parent.Dispose(); 183 parent.Dispose();
@@ -195,9 +195,9 @@ class TestEoParent
195 var parent = new Derived(null); 195 var parent = new Derived(null);
196 var child = new Derived(parent); 196 var child = new Derived(parent);
197 197
198 Test.AssertEquals(parent, child.GetParent()); 198 Test.AssertEquals(parent, child.Parent);
199 199
200 var parent_from_cast = child.GetParent() as Derived; 200 var parent_from_cast = child.Parent as Derived;
201 Test.AssertEquals(parent, parent_from_cast); 201 Test.AssertEquals(parent, parent_from_cast);
202 child.Dispose(); 202 child.Dispose();
203 parent.Dispose(); 203 parent.Dispose();
@@ -209,15 +209,15 @@ class TestKlassMethods
209 public static void basic_class_method() 209 public static void basic_class_method()
210 { 210 {
211 int reference = 0xbeef; 211 int reference = 0xbeef;
212 Dummy.TestObject.SetKlassProp(reference); 212 Dummy.TestObject.KlassProp = reference;
213 Test.AssertEquals(reference, Dummy.TestObject.GetKlassProp()); 213 Test.AssertEquals(reference, Dummy.TestObject.KlassProp);
214 } 214 }
215 215
216 public static void inherited_class_method() 216 public static void inherited_class_method()
217 { 217 {
218 int reference = 0xdead; 218 int reference = 0xdead;
219 Dummy.Child.SetKlassProp(reference); 219 Dummy.Child.KlassProp = reference;
220 Test.AssertEquals(reference, Dummy.Child.GetKlassProp()); 220 Test.AssertEquals(reference, Dummy.Child.KlassProp);
221 } 221 }
222} 222}
223 223
@@ -559,7 +559,7 @@ class TestConstructors
559#else 559#else
560 var obj = new Dummy.Child(null, a, b); 560 var obj = new Dummy.Child(null, a, b);
561#endif 561#endif
562 Test.Assert(!obj.GetIfaceWasSet()); 562 Test.Assert(!obj.IfaceWasSet);
563 obj.Dispose(); 563 obj.Dispose();
564 } 564 }
565} 565}
@@ -586,7 +586,7 @@ class TestProvider
586 var obj = new Dummy.TestObject(); 586 var obj = new Dummy.TestObject();
587 Dummy.Numberwrapper provider = obj.FindProvider(typeof(Dummy.Numberwrapper)) as Dummy.Numberwrapper; 587 Dummy.Numberwrapper provider = obj.FindProvider(typeof(Dummy.Numberwrapper)) as Dummy.Numberwrapper;
588 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper)); 588 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
589 Test.AssertEquals(provider.GetNumber(), 1999); 589 Test.AssertEquals(provider.Number, 1999);
590 obj.Dispose(); 590 obj.Dispose();
591 } 591 }
592 592
@@ -685,16 +685,16 @@ class TestProtectedInterfaceMembers
685 { 685 {
686 var type = typeof(Dummy.ITestIface); 686 var type = typeof(Dummy.ITestIface);
687 var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); 687 var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance);
688 var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
688 689
689 // Fully protected property 690 // Fully protected property
690 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "GetProtectedProp")); 691 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "GetProtectedProp"));
691 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetProtectedProp")); 692 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetProtectedProp"));
692 693
693 // Partially protected property 694 // Partially protected property
694 Test.AssertNotNull(methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter")); 695 Test.AssertNotNull(properties.SingleOrDefault(m => m.Name == "PublicGetterPrivateSetter"));
695 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter")); 696 Test.AssertNull(methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter"));
696 697
697 var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
698 Test.AssertNull(properties.SingleOrDefault(m => m.Name == "ProtectedProp")); 698 Test.AssertNull(properties.SingleOrDefault(m => m.Name == "ProtectedProp"));
699 Test.AssertNotNull(properties.SingleOrDefault(m => m.Name == "PublicGetterPrivateSetter")); 699 Test.AssertNotNull(properties.SingleOrDefault(m => m.Name == "PublicGetterPrivateSetter"));
700 } 700 }
@@ -703,15 +703,16 @@ class TestProtectedInterfaceMembers
703 { 703 {
704 var type = typeof(Dummy.TestObject); 704 var type = typeof(Dummy.TestObject);
705 705
706 // Fully protected property 706 // Fully internal property
707 var protected_methods = type.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Where(m => m.IsFamily); 707 var internal_methods = type.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Where(m => m.IsAssembly);
708 Test.AssertNotNull(protected_methods.SingleOrDefault(m => m.Name == "GetProtectedProp")); 708 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "GetProtectedProp"));
709 Test.AssertNotNull(protected_methods.SingleOrDefault(m => m.Name == "SetProtectedProp")); 709 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "SetProtectedProp"));
710 710
711 // Partially protected property 711 // Partially protected property
712 var public_methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance); 712 var public_methods = type.GetMethods(BindingFlags.Public | BindingFlags.Instance);
713 Test.AssertNotNull(public_methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter")); 713 Test.AssertNull(public_methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter"));
714 Test.AssertNotNull(protected_methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter")); 714 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "GetPublicGetterPrivateSetter"));
715 Test.AssertNotNull(internal_methods.SingleOrDefault(m => m.Name == "SetPublicGetterPrivateSetter"));
715 716
716 var protected_properties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance); 717 var protected_properties = type.GetProperties(BindingFlags.NonPublic | BindingFlags.Instance);
717 var prop = protected_properties.SingleOrDefault(m => m.Name == "ProtectedProp"); 718 var prop = protected_properties.SingleOrDefault(m => m.Name == "ProtectedProp");
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs
index 20c4b4491d..635e005c12 100644
--- a/src/tests/efl_mono/Events.cs
+++ b/src/tests/efl_mono/Events.cs
@@ -30,7 +30,7 @@ class TestEoEvents
30 Efl.Object obj = sender as Efl.Object; 30 Efl.Object obj = sender as Efl.Object;
31 if (obj != null) 31 if (obj != null)
32 { 32 {
33 obj.SetName("loop_called"); 33 obj.Name = "loop_called";
34 correct_sender = true; 34 correct_sender = true;
35 } 35 }
36 36
@@ -44,18 +44,18 @@ class TestEoEvents
44 public static void idle_event() 44 public static void idle_event()
45 { 45 {
46 Efl.Loop loop = Efl.App.AppMain; 46 Efl.Loop loop = Efl.App.AppMain;
47 loop.SetName("loop"); 47 loop.Name = "loop";
48 TestEoEvents listener = new TestEoEvents(); 48 TestEoEvents listener = new TestEoEvents();
49 listener.loop = loop; 49 listener.loop = loop;
50 loop.IdleEvent += listener.callback; 50 loop.IdleEvent += listener.callback;
51 51
52 Test.Assert(!listener.called); 52 Test.Assert(!listener.called);
53 Test.Assert(!listener.correct_sender); 53 Test.Assert(!listener.correct_sender);
54 Test.AssertEquals("loop", loop.GetName()); 54 Test.AssertEquals("loop", loop.Name);
55 loop.Begin(); 55 loop.Begin();
56 Test.Assert(listener.called); 56 Test.Assert(listener.called);
57 Test.Assert(listener.correct_sender); 57 Test.Assert(listener.correct_sender);
58 Test.AssertEquals("loop_called", loop.GetName()); 58 Test.AssertEquals("loop_called", loop.Name);
59 59
60 loop.IdleEvent -= listener.callback; 60 loop.IdleEvent -= listener.callback;
61 } 61 }
diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs
index 008f79291b..f566b91d04 100644
--- a/src/tests/efl_mono/Model.cs
+++ b/src/tests/efl_mono/Model.cs
@@ -42,7 +42,7 @@ public static class TestModel {
42 var veggies = CreateModel(loop); 42 var veggies = CreateModel(loop);
43 43
44 var model = new Efl.GenericModel<VeggieViewModel>(veggies, loop); 44 var model = new Efl.GenericModel<VeggieViewModel>(veggies, loop);
45 Test.AssertEquals(3, (int)model.GetChildrenCount()); 45 Test.AssertEquals(3, (int)model.ChildrenCount);
46 46
47 VeggieViewModel r2 = await model.GetAtAsync(1).ConfigureAwait(false); 47 VeggieViewModel r2 = await model.GetAtAsync(1).ConfigureAwait(false);
48 Test.AssertEquals(r2.Name, "Romaine Lettuce"); 48 Test.AssertEquals(r2.Name, "Romaine Lettuce");
diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs
index e206681e1a..c5de896053 100644
--- a/src/tests/efl_mono/Parts.cs
+++ b/src/tests/efl_mono/Parts.cs
@@ -51,9 +51,9 @@ public static class TestParts
51 var p1 = t.OnePart; 51 var p1 = t.OnePart;
52 var p2 = t.TwoPart; 52 var p2 = t.TwoPart;
53 Test.Assert(p1 is Dummy.TestObject); 53 Test.Assert(p1 is Dummy.TestObject);
54 Test.AssertEquals("part_one", p1.GetName()); 54 Test.AssertEquals("part_one", p1.Name);
55 Test.Assert(p2 is Dummy.TestObject); 55 Test.Assert(p2 is Dummy.TestObject);
56 Test.AssertEquals("part_two", p2.GetName()); 56 Test.AssertEquals("part_two", p2.Name);
57 } 57 }
58} 58}
59 59
@@ -97,9 +97,9 @@ public static class TestNamedParts
97 var p1 = obj.GetPart("one"); 97 var p1 = obj.GetPart("one");
98 var p2 = obj.GetPart("two"); 98 var p2 = obj.GetPart("two");
99 Test.Assert(p1 is Dummy.TestObject); 99 Test.Assert(p1 is Dummy.TestObject);
100 Test.AssertEquals("part_one", p1.GetName()); 100 Test.AssertEquals("part_one", p1.Name);
101 Test.Assert(p2 is Dummy.TestObject); 101 Test.Assert(p2 is Dummy.TestObject);
102 Test.AssertEquals("part_two", p2.GetName()); 102 Test.AssertEquals("part_two", p2.Name);
103 obj.Dispose(); 103 obj.Dispose();
104 } 104 }
105} 105}
diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs
index 495638458a..0ce836a332 100644
--- a/src/tests/efl_mono/StructHelpers.cs
+++ b/src/tests/efl_mono/StructHelpers.cs
@@ -165,7 +165,7 @@ internal class StructHelpers
165 Marshal.WriteByte(Fslice.Mem, 125); 165 Marshal.WriteByte(Fslice.Mem, 125);
166 166
167 var Fobj = new Dummy.Numberwrapper(); 167 var Fobj = new Dummy.Numberwrapper();
168 Fobj.SetNumber(42); 168 Fobj.Number = 42;
169 169
170 return new Dummy.StructComplex(farray: Farray, flist: Flist, fhash: Fhash, 170 return new Dummy.StructComplex(farray: Farray, flist: Flist, fhash: Fhash,
171 fiterator: Fiterator, fanyValue:Fany_value, fanyValueRef: Fany_value_ref, 171 fiterator: Fiterator, fanyValue:Fany_value, fanyValueRef: Fany_value_ref,
@@ -205,7 +205,7 @@ internal class StructHelpers
205 Test.Assert(complex.Fslice.GetBytes()[0] == 125); 205 Test.Assert(complex.Fslice.GetBytes()[0] == 125);
206 206
207 Test.Assert(complex.Fobj != null); 207 Test.Assert(complex.Fobj != null);
208 Test.Assert(complex.Fobj.GetNumber() == 42); 208 Test.Assert(complex.Fobj.Number == 42);
209 } 209 }
210 210
211 211