summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2019-12-17 11:34:41 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-12-17 11:34:42 -0300
commit8e951504f584f124ba88471fc46f1e7b6d2d3639 (patch)
tree3839fc7a7e31b744cf6ed9b9b1d5acfda0ab6d55 /src/bin
parentf90a97470d54edb20116e55739025e71cdfbbd92 (diff)
csharp : add move tag info to EinaAccessor, EinaIterator converter
Summary: Included commits in devs/lauromoura/remove_eina_mono-rebased ``` commit ed6679db1901c710cc6ddb50e7001cfd20caa77a Author: Lauro Moura <lauromoura@expertisesolutions.com.br> Date: Mon Dec 2 13:58:04 2019 -0300 csharp: add move information to EnumerableToAccessor Still need to fix the converted accessor ownership, maybe by creating a custom accessor class that released the pinned memory when is freed. ``` ref T8486 Depends On D10878 Co-authored-by: Lauro Moura <lauromoura@expertisesolutions.com.br> Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486 Differential Revision: https://phab.enlightenment.org/D10879
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh29
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh2
2 files changed, 7 insertions, 24 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index a5a70f2..210e5f2 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -759,7 +759,7 @@ struct convert_in_variable_generator
759 return false; 759 return false;
760 auto var_name = in_variable_name(param.param_name); 760 auto var_name = in_variable_name(param.param_name);
761 if (!as_generator( 761 if (!as_generator(
762 "var " << string << " = " << "Efl.Eo.Globals.IEnumerableToIterator(" << escape_keyword(param.param_name) << ");\n" 762 "var " << string << " = Efl.Eo.Globals.IEnumerableToIterator(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
763 ).generate(sink, var_name, context)) 763 ).generate(sink, var_name, context))
764 return false; 764 return false;
765 } 765 }
@@ -770,7 +770,7 @@ struct convert_in_variable_generator
770 return false; 770 return false;
771 auto var_name = in_variable_name(param.param_name); 771 auto var_name = in_variable_name(param.param_name);
772 if (!as_generator( 772 if (!as_generator(
773 "var " << string << " = " << "Efl.Eo.Globals.IEnumerableToAccessor(" << escape_keyword(param.param_name) << ");\n" 773 "var " << string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
774 ).generate(sink, var_name, context)) 774 ).generate(sink, var_name, context))
775 return false; 775 return false;
776 } 776 }
@@ -1291,12 +1291,6 @@ struct native_convert_out_assign_generator
1291 ).generate(sink, outvar, context)) 1291 ).generate(sink, outvar, context))
1292 return false; 1292 return false;
1293 1293
1294 // Iterators and Accessors can't own their content.
1295 if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *"
1296 || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *"
1297 )
1298 return true;
1299
1300 if ((param.type.has_own && (complex->subtypes.front().is_value_type && complex->subtypes.front().has_own)) 1294 if ((param.type.has_own && (complex->subtypes.front().is_value_type && complex->subtypes.front().has_own))
1301 && !as_generator( 1295 && !as_generator(
1302 string << ".OwnContent = false;\n" 1296 string << ".OwnContent = false;\n"
@@ -1314,7 +1308,7 @@ struct native_convert_out_assign_generator
1314 return false; 1308 return false;
1315 auto outvar = out_variable_name(param.param_name); 1309 auto outvar = out_variable_name(param.param_name);
1316 if (!as_generator( 1310 if (!as_generator(
1317 string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << string << ");\n" 1311 string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << string << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
1318 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context)) 1312 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context))
1319 return false; 1313 return false;
1320 } 1314 }
@@ -1329,7 +1323,7 @@ struct native_convert_out_assign_generator
1329 return false; 1323 return false;
1330 auto outvar = out_variable_name(param.param_name); 1324 auto outvar = out_variable_name(param.param_name);
1331 if (!as_generator( 1325 if (!as_generator(
1332 string << " = Efl.Eo.Globals.IEnumerableToIterator(" << string << ");\n" 1326 string << " = Efl.Eo.Globals.IEnumerableToIterator(" << string << ", " << (param.type.has_own ? "true" : "false")<< ");\n"
1333 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context)) 1327 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context))
1334 return false; 1328 return false;
1335 } 1329 }
@@ -1453,28 +1447,17 @@ struct native_convert_return_generator
1453 .generate(sink, attributes::unused, context)) 1447 .generate(sink, attributes::unused, context))
1454 return false; 1448 return false;
1455 1449
1456 // Iterators and Accessors can't own their content.
1457 if (ret_type.c_type != "Eina_Iterator *" && ret_type.c_type != "const Eina_Iterator *"
1458 && ret_type.c_type != "Eina_Accessor *" && ret_type.c_type != "const Eina_Accessor *"
1459 )
1460 {
1461 if ((ret_type.has_own && (complex->subtypes.front().is_value_type || complex->subtypes.front().has_own))
1462 && !as_generator("_ret_var.OwnContent = false; ")
1463 .generate(sink, attributes::unused, context))
1464 return false;
1465 }
1466
1467 return as_generator("return _ret_var.Handle;") 1450 return as_generator("return _ret_var.Handle;")
1468 .generate(sink, attributes::unused, context); 1451 .generate(sink, attributes::unused, context);
1469 } 1452 }
1470 else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *") 1453 else if (ret_type.c_type == "Eina_Accessor *" || ret_type.c_type == "const Eina_Accessor *")
1471 { 1454 {
1472 return as_generator("return Efl.Eo.Globals.IEnumerableToAccessor(_ret_var);") 1455 return as_generator(lit("return Efl.Eo.Globals.IEnumerableToAccessor(_ret_var, ") << (ret_type.has_own ? "true" : "false") << ");")
1473 .generate(sink, attributes::unused, context); 1456 .generate(sink, attributes::unused, context);
1474 } 1457 }
1475 else if (ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *") 1458 else if (ret_type.c_type == "Eina_Iterator *" || ret_type.c_type == "const Eina_Iterator *")
1476 { 1459 {
1477 return as_generator("return Efl.Eo.Globals.IEnumerableToIterator(_ret_var);") 1460 return as_generator(lit("return Efl.Eo.Globals.IEnumerableToIterator(_ret_var, ") << (ret_type.has_own ? "true" : "false") << ");")
1478 .generate(sink, attributes::unused, context); 1461 .generate(sink, attributes::unused, context);
1479 } 1462 }
1480 else if (ret_type.c_type != "void") 1463 else if (ret_type.c_type != "void")
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 1267a8d..7a3019e 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -72,7 +72,7 @@ struct to_internal_field_convert_generator
72 else if ((complex && (complex->outer.base_type == "iterator"))) 72 else if ((complex && (complex->outer.base_type == "iterator")))
73 { 73 {
74 if (!as_generator( 74 if (!as_generator(
75 indent << scope_tab << scope_tab << "_internal_struct." << string << " = Efl.Eo.Globals.IEnumerableToIterator(_external_struct." << string << ");\n") 75 indent << scope_tab << scope_tab << "_internal_struct." << string << " = Efl.Eo.Globals.IEnumerableToIterator(_external_struct." << string << ", " << (field.type.has_own ? "true" : "false") << ");\n")
76 .generate(sink, std::make_tuple(field_name, field_name), context)) 76 .generate(sink, std::make_tuple(field_name, field_name), context))
77 return false; 77 return false;
78 } 78 }