summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/struct_definition.hh
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/eolian_mono/eolian/mono/struct_definition.hh
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/eolian_mono/eolian/mono/struct_definition.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh31
1 files changed, 25 insertions, 6 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 24d0ff34ca..176b5518d7 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 }