summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-05-18 23:43:09 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-05-23 18:59:26 -0300
commit54f1e56b34e5b8b67161b70b582e54be1fbf5c74 (patch)
treee2873270d4ef751bb5bd07932fcb6f898ef4c121 /src/bin/eolian_mono
parentcfafd01bbe27bab90117e1a8d97fdace55b47944 (diff)
efl_mono: Generate support for accessors in .eos
Summary: Depends on D6190 Reviewers: felipealmeida, vitor.sousa Reviewed By: vitor.sousa Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6191
Diffstat (limited to 'src/bin/eolian_mono')
-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.hh9
3 files changed, 36 insertions, 6 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 38dbbcb48c..95970dedd6 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
@@ -237,6 +237,11 @@ struct marshall_type_visitor_generate
237 return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}}; 237 return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
238 } 238 }
239 } 239 }
240 ,{"accessor", nullptr, nullptr, [&]
241 {
242 return regular_type_def{" System.IntPtr", complex.outer.base_qualifier, {}};
243 }
244 }
240 }; 245 };
241 246
242 auto default_match = [&] (attributes::complex_type_def const& complex) 247 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 f7c97b723f..55ea6f4115 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -275,6 +275,10 @@ inline bool param_should_use_out_var(attributes::parameter_def const& param, boo
275 || param_is_acceptable(param, "Eina_Inlist *", WANT_OWN, WANT_OUT) 275 || param_is_acceptable(param, "Eina_Inlist *", WANT_OWN, WANT_OUT)
276 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT) 276 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
277 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT) 277 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
278 || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
279 || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
280 || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
281 || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
278 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT) 282 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
279 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT) 283 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
280 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT) 284 || param_is_acceptable(param, "const Eina_Hash *", !WANT_OWN, WANT_OUT)
@@ -321,6 +325,10 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param, bool
321 || param_is_acceptable(param, "const Eina_List *", WANT_OWN, !WANT_OUT) 325 || param_is_acceptable(param, "const Eina_List *", WANT_OWN, !WANT_OUT)
322 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, !WANT_OUT) 326 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, !WANT_OUT)
323 || param_is_acceptable(param, "Eina_Inlist *", WANT_OWN, !WANT_OUT) 327 || param_is_acceptable(param, "Eina_Inlist *", WANT_OWN, !WANT_OUT)
328 || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, !WANT_OUT)
329 || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, !WANT_OUT)
330 || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, !WANT_OUT)
331 || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, !WANT_OUT)
324 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, !WANT_OUT) 332 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, !WANT_OUT)
325 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, !WANT_OUT) 333 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, !WANT_OUT)
326 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, !WANT_OUT) 334 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, !WANT_OUT)
@@ -578,6 +586,7 @@ struct native_convert_in_variable_generator
578 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *" 586 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
579 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *" 587 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
580 || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *" 588 || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
589 || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
581 ) 590 )
582 { 591 {
583 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 592 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -665,6 +674,7 @@ struct convert_in_variable_generator
665 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *" 674 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
666 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *" 675 || param.type.c_type == "Eina_Inlist *" || param.type.c_type == "const Eina_Inlist *"
667 || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *" 676 || param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
677 || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
668 ) 678 )
669 { 679 {
670 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 680 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -743,6 +753,10 @@ struct convert_out_variable_generator
743 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT) 753 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
744 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT) 754 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
745 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT) 755 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
756 || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
757 || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
758 || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
759 || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
746 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT) 760 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
747 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT) 761 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
748 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT) 762 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
@@ -818,6 +832,10 @@ struct native_convert_out_variable_generator
818 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT) 832 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
819 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT) 833 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
820 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT) 834 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
835 || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
836 || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
837 || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
838 || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
821 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT) 839 || param_is_acceptable(param, "Eina_Hash *", WANT_OWN, WANT_OUT)
822 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT) 840 || param_is_acceptable(param, "Eina_Hash *", !WANT_OWN, WANT_OUT)
823 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT) 841 || param_is_acceptable(param, "const Eina_Hash *", WANT_OWN, WANT_OUT)
@@ -926,6 +944,10 @@ struct convert_out_assign_generator
926 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT) 944 || param_is_acceptable(param, "Eina_Inlist *", !WANT_OWN, WANT_OUT)
927 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT) 945 || param_is_acceptable(param, "const Eina_Inlist *", WANT_OWN, WANT_OUT)
928 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT) 946 || param_is_acceptable(param, "const Eina_Inlist *", !WANT_OWN, WANT_OUT)
947 || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
948 || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
949 || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
950 || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
929 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT) 951 || param_is_acceptable(param, "Eina_Iterator *", WANT_OWN, WANT_OUT)
930 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT) 952 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
931 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT) 953 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
@@ -1045,6 +1067,7 @@ struct convert_return_generator
1045 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *" 1067 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
1046 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *" 1068 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
1047 || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *" 1069 || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
1070 || ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *"
1048 ) 1071 )
1049 { 1072 {
1050 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type); 1073 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
@@ -1175,6 +1198,10 @@ struct native_convert_out_assign_generator
1175 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT) 1198 || param_is_acceptable(param, "Eina_Iterator *", !WANT_OWN, WANT_OUT)
1176 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT) 1199 || param_is_acceptable(param, "const Eina_Iterator *", WANT_OWN, WANT_OUT)
1177 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT) 1200 || param_is_acceptable(param, "const Eina_Iterator *", !WANT_OWN, WANT_OUT)
1201 || param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
1202 || param_is_acceptable(param, "Eina_Accessor *", !WANT_OWN, WANT_OUT)
1203 || param_is_acceptable(param, "const Eina_Accessor *", WANT_OWN, WANT_OUT)
1204 || param_is_acceptable(param, "const Eina_Accessor *", !WANT_OWN, WANT_OUT)
1178 ) 1205 )
1179 { 1206 {
1180 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 1207 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -1302,6 +1329,7 @@ struct native_convert_return_generator
1302 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *" 1329 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
1303 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *" 1330 || ret_type.c_type == "Eina_Inlist *" || ret_type.c_type == "const Eina_Inlist *"
1304 || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *" 1331 || ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *"
1332 || ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *"
1305 ) 1333 )
1306 { 1334 {
1307 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type); 1335 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 1028a76ad9..09c4bc198d 100644
--- a/src/bin/eolian_mono/eolian/mono/type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh
@@ -287,8 +287,6 @@ struct visitor_generate
287 { 287 {
288 (*this)(regular_type_def{" eina.Future", complex.outer.base_qualifier, {}}); 288 (*this)(regular_type_def{" eina.Future", complex.outer.base_qualifier, {}});
289 return attributes::type_def::variant_type(); 289 return attributes::type_def::variant_type();
290 // return replace_outer
291 // (complex, regular_type_def{" ::efl::shared_future", complex.outer.base_qualifier, {}});
292 } 290 }
293 } 291 }
294 , {"iterator", nullptr, nullptr, [&] 292 , {"iterator", nullptr, nullptr, [&]
@@ -300,10 +298,9 @@ struct visitor_generate
300 } 298 }
301 , {"accessor", nullptr, nullptr, [&] 299 , {"accessor", nullptr, nullptr, [&]
302 { 300 {
303 (*this)(regular_type_def{" int", complex.outer.base_qualifier, {}}); 301 complex_type_def c = complex;
304 return attributes::type_def::variant_type(); 302 c.outer.base_type = "eina.Accessor";
305 // return replace_outer 303 return c;
306 // (complex, regular_type_def{" ::efl::eina::accessor", complex.outer.base_qualifier, {}});
307 } 304 }
308 } 305 }
309 }; 306 };