summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Sousa <vitorsousasilva@gmail.com>2017-06-26 17:59:18 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-07-13 18:34:55 -0300
commit3857187f541124a2f7129c616ae7b5ea5141e3e2 (patch)
tree1b6f0bf28f4d91de2fc8143fde9dc255f4aade04
parent7b397ae2861158adb2d65e25dd9115e709538ca0 (diff)
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
152 return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; 152 return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
153 } 153 }
154 } 154 }
155 ,{"iterator", nullptr, nullptr, [&]
156 {
157 return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
158 }
159 }
155 }; 160 };
156 161
157 auto default_match = [&] (attributes::complex_type_def const& complex) 162 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 2338a44280..55745e285a 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)
252 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT) 252 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
253 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT) 253 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
254 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT) 254 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
255 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
256 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
257 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
258 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
255 ) 259 )
256 return true; 260 return true;
257 261
@@ -284,6 +288,10 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param)
284 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, !WANT_OUT) 288 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, !WANT_OUT)
285 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, !WANT_OUT) 289 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, !WANT_OUT)
286 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, !WANT_OUT) 290 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, !WANT_OUT)
291 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, !WANT_OUT)
292 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, !WANT_OUT)
293 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, !WANT_OUT)
294 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, !WANT_OUT)
287 ) 295 )
288 return true; 296 return true;
289 297
@@ -461,6 +469,7 @@ struct native_convert_in_variable_generator
461 || param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *" 469 || param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *"
462 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *" 470 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
463 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *" 471 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
472 || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
464 ) 473 )
465 { 474 {
466 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 475 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
528 || param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *" 537 || param.type.c_type == "Eina_Inarray *" || param.type.c_type == "const Eina_Inarray *"
529 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *" 538 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
530 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *" 539 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
540 || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
531 ) 541 )
532 { 542 {
533 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 543 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
599 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT) 609 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
600 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT) 610 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
601 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT) 611 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
612 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
613 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
614 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
615 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
602 ) 616 )
603 { 617 {
604 return as_generator( 618 return as_generator(
@@ -652,6 +666,10 @@ struct native_convert_out_variable_generator
652 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT) 666 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
653 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT) 667 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
654 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT) 668 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
669 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
670 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
671 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
672 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
655 ) 673 )
656 { 674 {
657 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 675 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
743 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT) 761 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
744 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT) 762 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
745 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT) 763 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
764 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
765 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
766 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
767 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
746 ) 768 )
747 { 769 {
748 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 770 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
821 || ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *" 843 || ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *"
822 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *" 844 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
823 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *" 845 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
846 || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
824 ) 847 )
825 { 848 {
826 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type); 849 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
920 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT) 943 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
921 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT) 944 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
922 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT) 945 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
946 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
947 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
948 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
949 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
923 ) 950 )
924 { 951 {
925 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 952 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
1023 || ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *" 1050 || ret_type.c_type == "Eina_Inarray *" || ret_type.c_type == "const Eina_Inarray *"
1024 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *" 1051 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
1025 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *" 1052 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
1053 || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
1026 ) 1054 )
1027 { 1055 {
1028 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type); 1056 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
307 } 307 }
308 , {"iterator", nullptr, nullptr, [&] 308 , {"iterator", nullptr, nullptr, [&]
309 { 309 {
310 (*this)(regular_type_def{" int", complex.outer.base_qualifier, {}}); 310 complex_type_def c = complex;
311 return attributes::type_def::variant_type(); 311 c.outer.base_type = "eina.Iterator";
312 // return replace_outer 312 return c;
313 // (complex, regular_type_def{" ::efl::eina::iterator", complex.outer.base_qualifier, {}});
314 } 313 }
315 } 314 }
316 , {"accessor", nullptr, nullptr, [&] 315 , {"accessor", nullptr, nullptr, [&]