summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh
diff options
context:
space:
mode:
authorJoão Paulo Taylor Ienczak Zanette <joao.tiz@expertisesolutions.com.br>2020-02-18 19:17:56 +0000
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2020-02-18 16:52:59 -0300
commiteba07471a0cb9baed2204856078f44cc2d31f7d9 (patch)
tree345b85d0e62a8e079592a76df14b9a6554e0c35e /src/bin/eolian_mono/eolian/mono/struct_definition.hh
parent595cb754b3aa280cdbebcb5fa0c51f287099b713 (diff)
csharp: Add IntPtr to/from IEnumerable conversion for "accessor" types
Adds a special case for "accessor" complex types in `implicit operator` for structs and `IntPtr`s, in which an IEnumerator must be converted to/from an IntPtr. Reviewed-by: YeongJong Lee <cleanlyj@naver.com> Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D11210
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/struct_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 6f19088d52..038ab1d0fd 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -90,6 +90,13 @@ struct to_internal_field_convert_generator
90 .generate(sink, std::make_tuple(field_name, field_name), context)) 90 .generate(sink, std::make_tuple(field_name, field_name), context))
91 return false; 91 return false;
92 } 92 }
93 else if ((complex && (complex->outer.base_type == "accessor")))
94 {
95 if (!as_generator(
96 indent << scope_tab << scope_tab << "_internal_struct." << string << " = Efl.Eo.Globals.IEnumerableToAccessor(_external_struct." << string << ", " << (field.type.has_own ? "true" : "false") << ");\n")
97 .generate(sink, std::make_tuple(field_name, field_name), context))
98 return false;
99 }
93 else if ((complex && (complex->outer.base_type == "hash")) 100 else if ((complex && (complex->outer.base_type == "hash"))
94 || field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *") 101 || field.type.c_type == "Eina_Binbuf *" || field.type.c_type == "const Eina_Binbuf *")
95 { 102 {
@@ -172,6 +179,7 @@ struct to_internal_field_convert_generator
172 .generate(sink, std::make_tuple(field_name, field_name), context)) 179 .generate(sink, std::make_tuple(field_name, field_name), context))
173 return false; 180 return false;
174 } 181 }
182
175 return true; 183 return true;
176 } 184 }
177} const to_internal_field_convert {}; 185} const to_internal_field_convert {};
@@ -231,6 +239,13 @@ struct to_external_field_convert_generator
231 .generate(sink, std::make_tuple(field.type, field_name), context)) 239 .generate(sink, std::make_tuple(field.type, field_name), context))
232 return false; 240 return false;
233 } 241 }
242 else if (complex && complex->outer.base_type == "accessor")
243 {
244 if (!as_generator(
245 "Efl.Eo.Globals.AccessorTo" << type << "(" << string << ");")
246 .generate(sink, std::make_tuple(field.type, field_name), context))
247 return false;
248 }
234 else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular)) 249 else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
235 { 250 {
236 if (!as_generator( 251 if (!as_generator(