summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2020-01-14 17:17:04 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2020-01-14 17:17:05 +0900
commitae30d3c57bc28bddd9e3a6c18163719fd8958f06 (patch)
tree094665590e1f799fecf6418b472739c09da8fd6a /src/bin
parente894c9bff8b1a0a7c2e6b18a9e0b0f707400eee4 (diff)
eina_mono: replace eina_list and eina_array with IList
Summary: Eina.List<T> => System.Collections.Generic.IList<T> Eina.Array<T> => System.Collections.Generic.IList<T> ref T8486 Depends On D10785 Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: felipealmeida, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486, T8488 Differential Revision: https://phab.enlightenment.org/D10902
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh29
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh138
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh31
-rw-r--r--src/bin/eolian_mono/eolian/mono/type_impl.hh4
4 files changed, 133 insertions, 69 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
index 2acfcbb..7405f8c 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -139,6 +139,10 @@ struct unpack_event_args_visitor
139 return as_generator("Efl.Eo.Globals.IteratorTo" << eolian_mono::type << "(info)").generate(sink, type, *context); 139 return as_generator("Efl.Eo.Globals.IteratorTo" << eolian_mono::type << "(info)").generate(sink, type, *context);
140 else if (types.outer.base_type == "accessor") 140 else if (types.outer.base_type == "accessor")
141 return as_generator("Efl.Eo.Globals.AccessorTo" << eolian_mono::type << "(info)").generate(sink, type, *context); 141 return as_generator("Efl.Eo.Globals.AccessorTo" << eolian_mono::type << "(info)").generate(sink, type, *context);
142 else if (types.outer.base_type == "array")
143 return as_generator("Efl.Eo.Globals.NativeArrayTo" << eolian_mono::type << "(info)").generate(sink, type, *context);
144 else if (types.outer.base_type == "list")
145 return as_generator("Efl.Eo.Globals.NativeListTo" << eolian_mono::type << "(info)").generate(sink, type, *context);
142 else 146 else
143 return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context); 147 return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context);
144 } 148 }
@@ -229,19 +233,28 @@ struct pack_event_info_and_call_visitor
229 return as_generator( 233 return as_generator(
230 indent.inc() << "Contract.Requires(e != null, nameof(e));\n" 234 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
231 << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n" 235 << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n"
232 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" 236 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
233 ).generate(sink, attributes::unused, *context); 237 ).generate(sink, attributes::unused, *context);
234 } 238 }
235 bool operator()(attributes::complex_type_def const& type) const 239 bool operator()(attributes::complex_type_def const& type) const
236 { 240 {
237 auto const& indent = current_indentation(*context); 241 auto const& indent = current_indentation(*context);
238 if ((type.outer.base_type == "iterator") || (type.outer.base_type == "accessor")) 242 bool is_own = type.outer.base_qualifier & attributes::qualifier_info::is_own;
239 return true; 243 std::string info_variable;
240 244
241 return as_generator( 245 if (type.outer.base_type == "iterator")
242 indent.inc() << "Contract.Requires(e != null, nameof(e));\n" 246 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.arg, ") + (is_own ? "true" : "false") + ");\n";
243 << indent.inc() << "IntPtr info = e.arg.Handle;\n" 247 else if (type.outer.base_type == "accessor")
244 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" 248 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.arg, ") + (is_own ? "true" : "false") + ");\n";
249 else if (type.outer.base_type == "array")
250 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeArray(e.arg, ") + (is_own ? "true" : "false") + ");\n";
251 else if (type.outer.base_type == "list")
252 info_variable = std::string("IntPtr info = Efl.Eo.Globals.IListToNativeList(e.arg, ") + (is_own ? "true" : "false") + ");\n";
253 else
254 info_variable = "IntPtr info = e.arg.Handle;\n";
255 return as_generator(indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
256 << indent.inc() << info_variable
257 << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n"
245 ).generate(sink, attributes::unused, *context); 258 ).generate(sink, attributes::unused, *context);
246 } 259 }
247}; 260};
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index 91b29af..824dc0c 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -625,20 +625,27 @@ struct native_convert_in_variable_generator
625 << ");\n" 625 << ");\n"
626 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context); 626 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
627 } 627 }
628 else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *" 628 else if (param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *")
629 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
630 )
631 { 629 {
632 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 630 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
633 if (!complex) 631 if (!complex)
634 return false; 632 return false;
635 return as_generator( 633 return as_generator(
636 "var " << string << " = new " << type << "(" << escape_keyword(param.param_name) 634 "var " << string << " = Efl.Eo.Globals.NativeListTo" << type << "(" << escape_keyword(param.param_name)
637 << ", " << (param.type.has_own ? "true" : "false")
638 << ", " << (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own ? "true" : "false")
639 << ");\n" 635 << ");\n"
640 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context); 636 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
641 } 637 }
638 else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *")
639 {
640 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
641 if (!complex)
642 return false;
643 return as_generator(
644 "var " << string << " = Efl.Eo.Globals.NativeArrayTo" << type << "(" << escape_keyword(param.param_name)
645 << ");\n"
646 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
647 }
648
642 else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *") 649 else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *")
643 { 650 {
644 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 651 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
@@ -729,29 +736,25 @@ struct convert_in_variable_generator
729 ).generate(sink, attributes::unused, context)) 736 ).generate(sink, attributes::unused, context))
730 return false; 737 return false;
731 } 738 }
732 else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *" 739 else if (param.type.c_type == "Eina_Array *" || param.type.c_type == "const Eina_Array *")
733 || param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *"
734 )
735 { 740 {
736 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 741 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
737 if (!complex) 742 if (!complex)
738 return false; 743 return false;
739 if (!as_generator( 744 if (!as_generator(
740 "Contract.Requires(" << string << " != null, nameof(" << string << "));\n" 745 "var " << string << " = " << "Efl.Eo.Globals.IListToNativeArray(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false") << ");\n"
741 << "var " << string << " = " << string << ".Handle;\n" 746 ).generate(sink, in_variable_name(param.param_name), context))
742 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), escape_keyword(param.param_name),
743 in_variable_name(param.param_name), escape_keyword(param.param_name))
744 , context))
745 return false; 747 return false;
746 if (param.type.has_own && !as_generator( 748 }
747 escape_keyword(param.param_name) << ".Own = false;\n" 749 else if (param.type.c_type == "Eina_List *" || param.type.c_type == "const Eina_List *")
748 ).generate(sink, attributes::unused, context)) 750 {
751 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
752 if (!complex)
749 return false; 753 return false;
750 754 auto var_name = in_variable_name(param.param_name);
751 if ((param.type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own)) 755 if (!as_generator(
752 && !as_generator( 756 "var " << string << " = " << "Efl.Eo.Globals.IListToNativeList(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false") << ");\n"
753 escape_keyword(param.param_name) << ".OwnContent = false;\n" 757 ).generate(sink, var_name, context))
754 ).generate(sink, attributes::unused, context))
755 return false; 758 return false;
756 } 759 }
757 else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *") 760 else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *")
@@ -999,7 +1002,17 @@ struct convert_out_assign_generator
999 || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT) 1002 || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT)
1000 || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) 1003 || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT)
1001 || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) 1004 || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT)
1002 || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT) 1005 )
1006 {
1007 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
1008 if (!complex)
1009 return false;
1010 return as_generator(
1011 string << " = Efl.Eo.Globals.NativeArrayTo" << type << "(" << string
1012 << ");\n"
1013 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
1014 }
1015 else if (param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT)
1003 || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT) 1016 || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT)
1004 || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT) 1017 || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT)
1005 || param_is_acceptable(param, "const Eina_List *", !WANT_OWN, WANT_OUT) 1018 || param_is_acceptable(param, "const Eina_List *", !WANT_OWN, WANT_OUT)
@@ -1009,9 +1022,7 @@ struct convert_out_assign_generator
1009 if (!complex) 1022 if (!complex)
1010 return false; 1023 return false;
1011 return as_generator( 1024 return as_generator(
1012 string << " = new " << type << "(" << string 1025 string << " = Efl.Eo.Globals.NativeListTo" << type << "(" << string
1013 << ", " << (param.type.has_own ? "true" : "false")
1014 << ", " << (param.type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own) ? "true" : "false")
1015 << ");\n" 1026 << ");\n"
1016 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context); 1027 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), param.type, out_variable_name(param.param_name)), context);
1017 } 1028 }
@@ -1084,6 +1095,17 @@ struct convert_in_ptr_assign_generator
1084 string << " = " << in_variable_name(param.param_name) << ";\n" 1095 string << " = " << in_variable_name(param.param_name) << ";\n"
1085 ).generate(sink, escape_keyword(param.param_name), context); 1096 ).generate(sink, escape_keyword(param.param_name), context);
1086 } 1097 }
1098 else if (param_is_acceptable(param, "Eina_Array *", WANT_OWN, !WANT_OUT)
1099 || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, !WANT_OUT)
1100 || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, !WANT_OUT)
1101 || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, !WANT_OUT)
1102 )
1103 {
1104 return as_generator(
1105 scope_tab(2) << lit("Efl.Eo.Globals.UpdateListFromNativeArray(") << escape_keyword(param.param_name) << ", " << in_variable_name(param.param_name) << ");\n"
1106 ).generate(sink, attributes::unused, context);
1107 }
1108
1087 1109
1088 return true; 1110 return true;
1089 } 1111 }
@@ -1141,17 +1163,23 @@ struct convert_return_generator
1141 .generate(sink, ret_type, context)) 1163 .generate(sink, ret_type, context))
1142 return false; 1164 return false;
1143 } 1165 }
1144 else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *" 1166 else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *")
1145 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
1146 )
1147 { 1167 {
1148 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type); 1168 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
1149 if (!complex) 1169 if (!complex)
1150 return false; 1170 return false;
1151 if (!as_generator("return new " << type << "(_ret_var, " << std::string{ret_type.has_own ? "true" : "false"} 1171
1152 << ", " << (ret_type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own) ? "true" : "false") 1172 if (!as_generator("return Efl.Eo.Globals.NativeArrayTo" << type << "(_ret_var);")
1153 << ");\n") 1173 .generate(sink, ret_type, context))
1154 .generate(sink, ret_type, context)) 1174 return false;
1175 }
1176 else if (ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *")
1177 {
1178 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
1179 if (!complex)
1180 return false;
1181 if (!as_generator("return Efl.Eo.Globals.NativeListTo" << type << "(_ret_var);")
1182 .generate(sink, ret_type, context))
1155 return false; 1183 return false;
1156 } 1184 }
1157 else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *") 1185 else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *")
@@ -1274,30 +1302,30 @@ struct native_convert_out_assign_generator
1274 else if (param_is_acceptable(param, "Eina_Array *", WANT_OWN, WANT_OUT) 1302 else if (param_is_acceptable(param, "Eina_Array *", WANT_OWN, WANT_OUT)
1275 || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT) 1303 || param_is_acceptable(param, "Eina_Array *", !WANT_OWN, WANT_OUT)
1276 || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT) 1304 || param_is_acceptable(param, "const Eina_Array *", WANT_OWN, WANT_OUT)
1277 || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT) 1305 || param_is_acceptable(param, "const Eina_Array *", !WANT_OWN, WANT_OUT))
1278 || param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT)
1279 || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT)
1280 || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT)
1281 || param_is_acceptable(param, "const Eina_List *", !WANT_OWN, WANT_OUT)
1282 )
1283 { 1306 {
1284 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type); 1307 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
1285 if (!complex) 1308 if (!complex)
1286 return false; 1309 return false;
1287 auto outvar = out_variable_name(param.param_name); 1310 auto outvar = out_variable_name(param.param_name);
1288 if (!as_generator( 1311 if (!as_generator(
1289 string << " = " << string << ".Handle;\n" 1312 string << " = Efl.Eo.Globals.IListToNativeArray(" << string << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
1290 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context)) 1313 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context))
1291 return false; 1314 return false;
1292 if (param.type.has_own && !as_generator( 1315 }
1293 string << ".Own = false;\n" 1316 else if (param_is_acceptable(param, "Eina_List *", WANT_OWN, WANT_OUT)
1294 ).generate(sink, outvar, context)) 1317 || param_is_acceptable(param, "Eina_List *", !WANT_OWN, WANT_OUT)
1318 || param_is_acceptable(param, "const Eina_List *", WANT_OWN, WANT_OUT)
1319 || param_is_acceptable(param, "const Eina_List *", !WANT_OWN, WANT_OUT))
1320 {
1321 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&param.type.original_type);
1322 if (!complex)
1295 return false; 1323 return false;
1296 1324
1297 if ((param.type.has_own && (complex->subtypes.front().is_value_type && complex->subtypes.front().has_own)) 1325 auto outvar = out_variable_name(param.param_name);
1298 && !as_generator( 1326 if (!as_generator(
1299 string << ".OwnContent = false;\n" 1327 string << " = Efl.Eo.Globals.IListToNativeList(" << string << ", " << (param.type.has_own ? "true" : "false")<<");\n"
1300 ).generate(sink, outvar, context)) 1328 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context))
1301 return false; 1329 return false;
1302 } 1330 }
1303 else if (param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT) 1331 else if (param_is_acceptable(param, "Eina_Accessor *", WANT_OWN, WANT_OUT)
@@ -1439,18 +1467,22 @@ struct native_convert_return_generator
1439 return as_generator("return _ret_var.Handle;") 1467 return as_generator("return _ret_var.Handle;")
1440 .generate(sink, attributes::unused, context); 1468 .generate(sink, attributes::unused, context);
1441 } 1469 }
1442 else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *" 1470 else if (ret_type.c_type == "Eina_Array *" || ret_type.c_type == "const Eina_Array *")
1443 || ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *"
1444 )
1445 { 1471 {
1446 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type); 1472 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
1447 if (!complex) 1473 if (!complex)
1448 return false; 1474 return false;
1449 if (ret_type.has_own && !as_generator("_ret_var.Own = false; ") 1475
1450 .generate(sink, attributes::unused, context)) 1476 return as_generator(lit("return Efl.Eo.Globals.IListToNativeArray(_ret_var, ") << (ret_type.has_own ? "true" : "false") << ");")
1477 .generate(sink, attributes::unused, context);
1478 }
1479 else if (ret_type.c_type == "Eina_List *" || ret_type.c_type == "const Eina_List *")
1480 {
1481 attributes::complex_type_def const* complex = efl::eina::get<attributes::complex_type_def>(&ret_type.original_type);
1482 if (!complex)
1451 return false; 1483 return false;
1452 1484
1453 return as_generator("return _ret_var.Handle;") 1485 return as_generator(lit("return Efl.Eo.Globals.IListToNativeList(_ret_var, ") << (ret_type.has_own ? "true" : "false") << ");")
1454 .generate(sink, attributes::unused, context); 1486 .generate(sink, attributes::unused, context);
1455 } 1487 }
1456 else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *") 1488 else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *")
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 24d0ff3..176b551 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -69,6 +69,20 @@ struct to_internal_field_convert_generator
69 .generate(sink, std::make_tuple(field_name, field_name), context)) 69 .generate(sink, std::make_tuple(field_name, field_name), context))
70 return false; 70 return false;
71 } 71 }
72 else if ((complex && (complex->outer.base_type == "array")))
73 {
74 if (!as_generator(
75 indent << scope_tab << scope_tab << "_internal_struct." << string << " = Efl.Eo.Globals.IListToNativeArray(_external_struct." << string << ", " << (field.type.has_own ? "true" : "false") << ");\n")
76 .generate(sink, std::make_tuple(field_name, field_name), context))
77 return false;
78 }
79 else if ((complex && (complex->outer.base_type == "list")))
80 {
81 if (!as_generator(
82 indent << scope_tab << scope_tab << "_internal_struct." << string << " = Efl.Eo.Globals.IListToNativeList(_external_struct." << string << ", " << (field.type.has_own ? "true" : "false") << ");\n")
83 .generate(sink, std::make_tuple(field_name, field_name), context))
84 return false;
85 }
72 else if ((complex && (complex->outer.base_type == "iterator"))) 86 else if ((complex && (complex->outer.base_type == "iterator")))
73 { 87 {
74 if (!as_generator( 88 if (!as_generator(
@@ -76,9 +90,7 @@ struct to_internal_field_convert_generator
76 .generate(sink, std::make_tuple(field_name, field_name), context)) 90 .generate(sink, std::make_tuple(field_name, field_name), context))
77 return false; 91 return false;
78 } 92 }
79 else if ((complex && (complex->outer.base_type == "array" 93 else if ((complex && (complex->outer.base_type == "hash"))
80 || complex->outer.base_type == "list"
81 || complex->outer.base_type == "hash"))
82 || field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *") 94 || field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *")
83 { 95 {
84 // Always assumes pointer 96 // Always assumes pointer
@@ -193,12 +205,19 @@ struct to_external_field_convert_generator
193 .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) 205 .generate(sink, std::make_tuple(field_name, field.type, field_name), context))
194 return false; 206 return false;
195 } 207 }
196 else if (complex && (complex->outer.base_type == "array" 208 else if (complex && (complex->outer.base_type == "array"))
197 || complex->outer.base_type == "list")) 209 {
210 // Always assumes pointer
211 if (!as_generator(
212 indent << scope_tab << scope_tab << "_external_struct." << string << " = Efl.Eo.Globals.NativeArrayTo" << type << "(_internal_struct." << string << ");\n")
213 .generate(sink, std::make_tuple(field_name, field.type, field_name), context))
214 return false;
215 }
216 else if (complex && (complex->outer.base_type == "list"))
198 { 217 {
199 // Always assumes pointer 218 // Always assumes pointer
200 if (!as_generator( 219 if (!as_generator(
201 indent << scope_tab << scope_tab << "_external_struct." << string << " = new " << type << "(_internal_struct." << string << ", false, false);\n") 220 indent << scope_tab << scope_tab << "_external_struct." << string << " = Efl.Eo.Globals.NativeListTo" << type << "(_internal_struct." << string << ");\n")
202 .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) 221 .generate(sink, std::make_tuple(field_name, field.type, field_name), context))
203 return false; 222 return false;
204 } 223 }
diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh
index f365a0d..4475844 100644
--- a/src/bin/eolian_mono/eolian/mono/type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh
@@ -368,13 +368,13 @@ struct visitor_generate
368 {"list", nullptr, nullptr, [&] 368 {"list", nullptr, nullptr, [&]
369 { 369 {
370 complex_type_def c = complex; 370 complex_type_def c = complex;
371 c.outer.base_type = "Eina.List"; 371 c.outer.base_type = "IList";
372 return c; 372 return c;
373 }} 373 }}
374 , {"array", nullptr, nullptr, [&] 374 , {"array", nullptr, nullptr, [&]
375 { 375 {
376 complex_type_def c = complex; 376 complex_type_def c = complex;
377 c.outer.base_type = "Eina.Array"; 377 c.outer.base_type = "IList";
378 return c; 378 return c;
379 }} 379 }}
380 , {"hash", nullptr, nullptr 380 , {"hash", nullptr, nullptr