summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2017-06-26 17:59:18 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2017-06-26 17:59:18 -0300
commit6bf0b6e668358afa44fb08bc6c4f5badaa215d24 (patch)
tree6cc2e2f752701d29c5611a60ef9960aa66107c31
parent72a1ab32fb031cdf76b281e18d90de1cff83c04b (diff)
downloadefl-6bf0b6e668358afa44fb08bc6c4f5badaa215d24.tar.gz
eina_mono eolian_mono: Generation for eina.Iterator (missing tests)
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh5
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh28
-rw-r--r--src/bin/eolian_mono/eolian/mono/type_impl.hh7
3 files changed, 36 insertions, 4 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
index 5f2ba17932..dba320e40c 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
@@ -152,6 +152,11 @@ struct marshall_type_visitor_generate
return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
}
}
+ ,{"iterator", nullptr, nullptr, [&]
+ {
+ return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
+ }
+ }
};
auto default_match = [&] (attributes::complex_type_def const& complex)
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index 9912e0a957..8c2f5a075a 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -252,6 +252,10 @@ inline bool param_should_use_out_var(attributes::parameter_def const& param)
|| param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
)
return true;
@@ -284,6 +288,10 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param)
|| param_is_acceptable(param, "Eina_Hash *", WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, !WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, !WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, !WANT_OUT)
)
return true;
@@ -461,6 +469,7 @@ struct native_convert_in_variable_generator
|| param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *"
|| param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
|| param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
+ || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -528,6 +537,7 @@ struct convert_in_variable_generator
|| param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *"
|| param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
|| param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
+ || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -599,6 +609,10 @@ struct convert_out_variable_generator
|| param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
)
{
return as_generator(
@@ -652,6 +666,10 @@ struct native_convert_out_variable_generator
|| param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -743,6 +761,10 @@ struct convert_out_assign_generator
|| param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -821,6 +843,7 @@ struct convert_return_generator
|| ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *"
|| ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
|| ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
+ || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
@@ -920,6 +943,10 @@ struct native_convert_out_assign_generator
|| param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
|| param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
+ || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -1023,6 +1050,7 @@ struct native_convert_return_generator
|| ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *"
|| ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
|| ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
+ || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
)
{
attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh
index 4bcd71d4ee..eb62404356 100644
--- a/src/bin/eolian_mono/eolian/mono/type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh
@@ -307,10 +307,9 @@ struct visitor_generate
}
, {"iterator", nullptr, nullptr, [&]
{
- (*this)(regular_type_def{" int", complex.outer.base_qualifier, {}});
- return attributes::type_def::variant_type();
- // return replace_outer
- // (complex, regular_type_def{" ::efl::eina::iterator", complex.outer.base_qualifier, {}});
+ complex_type_def c = complex;
+ c.outer.base_type = "eina.Iterator";
+ return c;
}
}
, {"accessor", nullptr, nullptr, [&]