summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-04-10 22:50:05 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-04-12 21:23:42 -0300
commit87c58a460a0f39477461ef93e6ce8b63f994c873 (patch)
treed1619cdee19ab7f0ad43ae45be8857809671e4d9 /src/bin/eolian_mono
parent65f868786a59533a1cbf9d58b886cdc4f49ceb94 (diff)
efl_mono: Add namespace on helpers.
Make it easier on finding where those functions are coming from.
Diffstat (limited to 'src/bin/eolian_mono')
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/helpers.hh6
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh4
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh4
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh48
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh18
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_fields.hh4
8 files changed, 47 insertions, 41 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index e030434687..4431ddc86e 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -165,7 +165,7 @@ struct function_definition_generator
165 << ") {\n " 165 << ") {\n "
166 << eolian_mono::function_definition_preamble() << string << "(" 166 << eolian_mono::function_definition_preamble() << string << "("
167 << (do_super ? "efl.eo.Globals.efl_super(" : "") 167 << (do_super ? "efl.eo.Globals.efl_super(" : "")
168 << (f.is_static ? klass_get_name(f.klass) + "()": "this.raw_handle") 168 << (f.is_static ? helpers::klass_get_name(f.klass) + "()": "this.raw_handle")
169 << (do_super ? ", this.raw_klass)" : "") 169 << (do_super ? ", this.raw_klass)" : "")
170 << *(", " << argument_invocation ) << ");\n" 170 << *(", " << argument_invocation ) << ");\n"
171 << eolian_mono::function_definition_epilogue() 171 << eolian_mono::function_definition_epilogue()
diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh
index 420efc6984..e0ec6945fa 100644
--- a/src/bin/eolian_mono/eolian/mono/helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/helpers.hh
@@ -12,6 +12,8 @@
12 12
13namespace eolian_mono { 13namespace eolian_mono {
14 14
15namespace helpers {
16
15namespace attributes = efl::eolian::grammar::attributes; 17namespace attributes = efl::eolian::grammar::attributes;
16 18
17inline std::string type_full_name(attributes::regular_type_def const& type) 19inline std::string type_full_name(attributes::regular_type_def const& type)
@@ -140,6 +142,8 @@ inline std::string klass_get_name(attributes::klass_name const &clsname)
140 return output.str(); 142 return output.str();
141} 143}
142 144
143} 145} // namespace helpers
146
147} // namespace eolian_mono
144 148
145#endif 149#endif
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index bf3f27cdd5..a5f380932c 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -241,7 +241,9 @@ struct klass
241 } 241 }
242 242
243 for (auto &&p : cls.parts) 243 for (auto &&p : cls.parts)
244 if (!as_generator( klass_name_to_csharp(p.klass) << " " << utils::capitalize(p.name) << "{ get;}\n").generate(sink, attributes::unused, iface_cxt)) 244 if (!as_generator(
245 helpers::klass_name_to_csharp(p.klass) << " " << utils::capitalize(p.name) << "{ get;}\n"
246 ).generate(sink, attributes::unused, iface_cxt))
245 return false; 247 return false;
246 248
247 // End of interface declaration 249 // End of interface declaration
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 18359471bc..1d9368e1f5 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
@@ -155,7 +155,7 @@ struct marshall_type_visitor_generate
155 }} 155 }}
156 }; 156 };
157 157
158 if (regular.is_struct() && !is_struct_blacklisted(regular) && !(bool)(regular.base_qualifier & qualifier_info::is_own)) 158 if (regular.is_struct() && !helpers::is_struct_blacklisted(regular) && !(bool)(regular.base_qualifier & qualifier_info::is_own))
159 { 159 {
160 if ((is_out || is_return) && is_ptr) 160 if ((is_out || is_return) && is_ptr)
161 return as_generator(" System.IntPtr").generate(sink, attributes::unused, *context); 161 return as_generator(" System.IntPtr").generate(sink, attributes::unused, *context);
@@ -177,7 +177,7 @@ struct marshall_type_visitor_generate
177 { 177 {
178 return *b; 178 return *b;
179 } 179 }
180 else if (is_ptr && need_pointer_conversion(&regular)) 180 else if (is_ptr && helpers::need_pointer_conversion(&regular))
181 { 181 {
182 regular_type_def r = regular; 182 regular_type_def r = regular;
183 r.base_type = " System.IntPtr"; 183 r.base_type = " System.IntPtr";
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index 615b06fb35..8ee330ee00 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -288,10 +288,10 @@ inline bool param_should_use_out_var(attributes::parameter_def const& param, boo
288 return true; 288 return true;
289 289
290 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 290 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
291 if (need_struct_conversion(regular)) 291 if (helpers::need_struct_conversion(regular))
292 return true; 292 return true;
293 293
294 if (param.type.is_ptr && need_pointer_conversion(regular)) 294 if (param.type.is_ptr && helpers::need_pointer_conversion(regular))
295 return true; 295 return true;
296 296
297 return false; 297 return false;
@@ -336,10 +336,10 @@ inline bool param_should_use_in_var(attributes::parameter_def const& param, bool
336 return true; 336 return true;
337 337
338 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 338 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
339 if (need_struct_conversion(regular)) 339 if (helpers::need_struct_conversion(regular))
340 return true; 340 return true;
341 341
342 if (param.type.is_ptr && need_pointer_conversion(regular)) 342 if (param.type.is_ptr && helpers::need_pointer_conversion(regular))
343 return true; 343 return true;
344 344
345 return false; 345 return false;
@@ -371,7 +371,7 @@ inline std::string direction_modifier(attributes::parameter_def const& param)
371 else if (param.direction == attributes::parameter_direction::in && param.type.is_ptr) 371 else if (param.direction == attributes::parameter_direction::in && param.type.is_ptr)
372 { 372 {
373 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 373 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
374 if (need_struct_conversion(regular)) 374 if (helpers::need_struct_conversion(regular))
375 return " ref "; // Don't add ref on Marshal if it is ptr 375 return " ref "; // Don't add ref on Marshal if it is ptr
376 } 376 }
377 return " "; 377 return " ";
@@ -382,7 +382,7 @@ std::string marshall_direction_modifier(attributes::parameter_def const& param)
382 if (param.direction == attributes::parameter_direction::in && param.type.is_ptr) 382 if (param.direction == attributes::parameter_direction::in && param.type.is_ptr)
383 { 383 {
384 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 384 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
385 if (need_struct_conversion(regular) && param.type.has_own) 385 if (helpers::need_struct_conversion(regular) && param.type.has_own)
386 return " "; // Don't add ref on Marshal if it is ptr 386 return " "; // Don't add ref on Marshal if it is ptr
387 } 387 }
388 return direction_modifier(param); 388 return direction_modifier(param);
@@ -545,13 +545,13 @@ struct native_convert_in_variable_generator
545 return true; 545 return true;
546 546
547 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 547 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
548 if (param.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion(param, regular)) 548 if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(param, regular))
549 { 549 {
550 return as_generator( 550 return as_generator(
551 "var " << string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(" << escape_keyword(param.param_name) << ");\n" 551 "var " << string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(" << escape_keyword(param.param_name) << ");\n"
552 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context); 552 ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context);
553 } 553 }
554 else if (need_struct_conversion(regular)) 554 else if (helpers::need_struct_conversion(regular))
555 { 555 {
556 return as_generator( 556 return as_generator(
557 "var " << string << " = " << type << "_StructConversion.ToExternal(" << escape_keyword(param.param_name) << ");\n" 557 "var " << string << " = " << type << "_StructConversion.ToExternal(" << escape_keyword(param.param_name) << ");\n"
@@ -613,13 +613,13 @@ struct convert_in_variable_generator
613 return true; 613 return true;
614 614
615 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 615 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
616 if (param.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion(param, regular)) 616 if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(param, regular))
617 { 617 {
618 return as_generator( 618 return as_generator(
619 "var " << string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(" << escape_keyword(param.param_name) << ");\n" 619 "var " << string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(" << escape_keyword(param.param_name) << ");\n"
620 ).generate(sink, in_variable_name(param.param_name), context); 620 ).generate(sink, in_variable_name(param.param_name), context);
621 } 621 }
622 else if (need_struct_conversion(regular)) 622 else if (helpers::need_struct_conversion(regular))
623 { 623 {
624 return as_generator( 624 return as_generator(
625 "var " << string << " = " << type << "_StructConversion.ToInternal(" << escape_keyword(param.param_name) << ");\n" 625 "var " << string << " = " << type << "_StructConversion.ToInternal(" << escape_keyword(param.param_name) << ");\n"
@@ -708,13 +708,13 @@ struct convert_out_variable_generator
708 return true; 708 return true;
709 709
710 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 710 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
711 if (param.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion(regular)) 711 if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
712 { 712 {
713 return as_generator( 713 return as_generator(
714 "System.IntPtr " << string << " = System.IntPtr.Zero;\n" 714 "System.IntPtr " << string << " = System.IntPtr.Zero;\n"
715 ).generate(sink, out_variable_name(param.param_name), context); 715 ).generate(sink, out_variable_name(param.param_name), context);
716 } 716 }
717 else if (need_struct_conversion(regular)) 717 else if (helpers::need_struct_conversion(regular))
718 { 718 {
719 return as_generator( 719 return as_generator(
720 "var " << string << " = new " << marshall_type << "();\n" 720 "var " << string << " = new " << marshall_type << "();\n"
@@ -781,13 +781,13 @@ struct native_convert_out_variable_generator
781 return true; 781 return true;
782 782
783 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 783 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
784 if (param.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion(regular)) 784 if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
785 { 785 {
786 return as_generator( 786 return as_generator(
787 type << " " << string << " = default(" << type << ");\n" 787 type << " " << string << " = default(" << type << ");\n"
788 ).generate(sink, std::make_tuple(param, out_variable_name(param.param_name), param), context); 788 ).generate(sink, std::make_tuple(param, out_variable_name(param.param_name), param), context);
789 } 789 }
790 else if (need_struct_conversion(regular) 790 else if (helpers::need_struct_conversion(regular)
791 || param_is_acceptable(param, "const char *", !WANT_OWN, WANT_OUT) 791 || param_is_acceptable(param, "const char *", !WANT_OWN, WANT_OUT)
792 || param_is_acceptable(param, "Eina_Stringshare *", !WANT_OWN, WANT_OUT)) 792 || param_is_acceptable(param, "Eina_Stringshare *", !WANT_OWN, WANT_OUT))
793 { 793 {
@@ -868,7 +868,7 @@ struct convert_out_assign_generator
868 return true; 868 return true;
869 869
870 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 870 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
871 if (param.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion_in_return(param.type, param.direction)) 871 if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(param.type, param.direction))
872 { 872 {
873 bool ret = as_generator( 873 bool ret = as_generator(
874 string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(" << out_variable_name(param.param_name) << ");\n" 874 string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(" << out_variable_name(param.param_name) << ");\n"
@@ -880,7 +880,7 @@ struct convert_out_assign_generator
880 880
881 return ret; 881 return ret;
882 } 882 }
883 else if (need_struct_conversion(regular)) 883 else if (helpers::need_struct_conversion(regular))
884 { 884 {
885 return as_generator( 885 return as_generator(
886 string << " = " << type << "_StructConversion.ToExternal(" << out_variable_name(param.param_name) << ");\n" 886 string << " = " << type << "_StructConversion.ToExternal(" << out_variable_name(param.param_name) << ");\n"
@@ -963,7 +963,7 @@ struct native_convert_in_ptr_assign_generator
963 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const 963 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
964 { 964 {
965 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 965 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
966 if (param_should_use_in_var(param, true) && param.type.is_ptr && !param.type.has_own && need_struct_conversion(regular)) 966 if (param_should_use_in_var(param, true) && param.type.is_ptr && !param.type.has_own && helpers::need_struct_conversion(regular))
967 { 967 {
968 return as_generator( 968 return as_generator(
969 string << " = " << type << "_StructConversion.ToInternal(" << in_variable_name(param.param_name) << ");\n" 969 string << " = " << type << "_StructConversion.ToInternal(" << in_variable_name(param.param_name) << ");\n"
@@ -980,7 +980,7 @@ struct convert_in_ptr_assign_generator
980 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const 980 bool generate(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
981 { 981 {
982 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 982 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
983 if (param_should_use_in_var(param, true) && param.type.is_ptr && !param.type.has_own && need_struct_conversion(regular)) 983 if (param_should_use_in_var(param, true) && param.type.is_ptr && !param.type.has_own && helpers::need_struct_conversion(regular))
984 { 984 {
985 return as_generator( 985 return as_generator(
986 string << " = " << type << "_StructConversion.ToExternal(" << in_variable_name(param.param_name) << ");\n" 986 string << " = " << type << "_StructConversion.ToExternal(" << in_variable_name(param.param_name) << ");\n"
@@ -1010,7 +1010,7 @@ struct convert_return_generator
1010 bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const 1010 bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const
1011 { 1011 {
1012 auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type); 1012 auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type);
1013 if (ret_type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion_in_return(ret_type, attributes::parameter_direction::unknown)) 1013 if (ret_type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(ret_type, attributes::parameter_direction::unknown))
1014 { 1014 {
1015 return as_generator( 1015 return as_generator(
1016 "var __ret_tmp = eina.PrimitiveConversion.PointerToManaged<" << type << ">(_ret_var);\n" 1016 "var __ret_tmp = eina.PrimitiveConversion.PointerToManaged<" << type << ">(_ret_var);\n"
@@ -1018,7 +1018,7 @@ struct convert_return_generator
1018 << scope_tab << scope_tab << "return __ret_tmp;\n" 1018 << scope_tab << scope_tab << "return __ret_tmp;\n"
1019 ).generate(sink, ret_type, context); 1019 ).generate(sink, ret_type, context);
1020 } 1020 }
1021 else if (need_struct_conversion(regular)) 1021 else if (helpers::need_struct_conversion(regular))
1022 { 1022 {
1023 return as_generator( 1023 return as_generator(
1024 "return " << type << "_StructConversion.ToExternal(_ret_var);\n" 1024 "return " << type << "_StructConversion.ToExternal(_ret_var);\n"
@@ -1080,13 +1080,13 @@ struct native_convert_out_assign_generator
1080 return true; 1080 return true;
1081 1081
1082 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type); 1082 auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
1083 if (param.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion_in_return(param.type, param.direction)) 1083 if (param.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(param.type, param.direction))
1084 { 1084 {
1085 return as_generator( 1085 return as_generator(
1086 string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(" << string << ");\n" 1086 string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(" << string << ");\n"
1087 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), out_variable_name(param.param_name)), context); 1087 ).generate(sink, std::make_tuple(escape_keyword(param.param_name), out_variable_name(param.param_name)), context);
1088 } 1088 }
1089 else if (need_struct_conversion(regular)) 1089 else if (helpers::need_struct_conversion(regular))
1090 { 1090 {
1091 return as_generator( 1091 return as_generator(
1092 string << " = " << type << "_StructConversion.ToInternal(" << string << ");\n" 1092 string << " = " << type << "_StructConversion.ToInternal(" << string << ");\n"
@@ -1213,13 +1213,13 @@ struct native_convert_return_generator
1213 bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const 1213 bool generate(OutputIterator sink, attributes::type_def const& ret_type, Context const& context) const
1214 { 1214 {
1215 auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type); 1215 auto regular = efl::eina::get<attributes::regular_type_def>(&ret_type.original_type);
1216 if (ret_type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion_in_return(ret_type, attributes::parameter_direction::unknown) ) 1216 if (ret_type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion_in_return(ret_type, attributes::parameter_direction::unknown) )
1217 { 1217 {
1218 return as_generator( 1218 return as_generator(
1219 "return eina.PrimitiveConversion.ManagedToPointerAlloc(_ret_var);\n" 1219 "return eina.PrimitiveConversion.ManagedToPointerAlloc(_ret_var);\n"
1220 ).generate(sink, attributes::unused, context); 1220 ).generate(sink, attributes::unused, context);
1221 } 1221 }
1222 else if (need_struct_conversion(regular)) 1222 else if (helpers::need_struct_conversion(regular))
1223 { 1223 {
1224 return as_generator( 1224 return as_generator(
1225 "return " << type << "_StructConversion.ToInternal(_ret_var);\n" 1225 "return " << type << "_StructConversion.ToInternal(_ret_var);\n"
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
index 83222c9ed4..3341f1e894 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -17,7 +17,7 @@ struct part_definition_generator
17 template <typename OutputIterator, typename Context> 17 template <typename OutputIterator, typename Context>
18 bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const 18 bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const
19 { 19 {
20 std::string part_klass_name = klass_name_to_csharp(part.klass); 20 std::string part_klass_name = helpers::klass_name_to_csharp(part.klass);
21 return as_generator(scope_tab << documentation 21 return as_generator(scope_tab << documentation
22 << scope_tab << "public " << part_klass_name << " " << utils::capitalize(part.name) << "\n" 22 << scope_tab << "public " << part_klass_name << " " << utils::capitalize(part.name) << "\n"
23 << scope_tab << "{\n" 23 << scope_tab << "{\n"
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index f772564440..bc3b730857 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -51,7 +51,7 @@ struct struct_definition_generator
51 documentation(1) 51 documentation(1)
52 << scope_tab(1) << "public " << type << " " << string << ";\n" 52 << scope_tab(1) << "public " << type << " " << string << ";\n"
53 ) 53 )
54 .generate(sink, std::make_tuple(field, field.type, to_field_name(field.name)), context)) 54 .generate(sink, std::make_tuple(field, field.type, helpers::to_field_name(field.name)), context))
55 return false; 55 return false;
56 } 56 }
57 57
@@ -104,7 +104,7 @@ struct struct_internal_definition_generator
104 // iterate struct fields 104 // iterate struct fields
105 for (auto const& field : struct_.fields) 105 for (auto const& field : struct_.fields)
106 { 106 {
107 auto field_name = to_field_name(field.name); 107 auto field_name = helpers::to_field_name(field.name);
108 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 108 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
109 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 109 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
110 110
@@ -165,7 +165,7 @@ struct to_internal_field_convert_generator
165 template <typename OutputIterator, typename Context> 165 template <typename OutputIterator, typename Context>
166 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 166 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
167 { 167 {
168 auto field_name = to_field_name(field.name); 168 auto field_name = helpers::to_field_name(field.name);
169 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 169 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
170 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 170 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
171 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type); 171 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
@@ -191,14 +191,14 @@ struct to_internal_field_convert_generator
191 .generate(sink, std::make_tuple(field_name, field_name), context)) 191 .generate(sink, std::make_tuple(field_name, field_name), context))
192 return false; 192 return false;
193 } 193 }
194 else if (field.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion(regular)) 194 else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
195 { 195 {
196 if (!as_generator( 196 if (!as_generator(
197 scope_tab << scope_tab << "_internal_struct." << string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(_external_struct." << string << ");\n") 197 scope_tab << scope_tab << "_internal_struct." << string << " = eina.PrimitiveConversion.ManagedToPointerAlloc(_external_struct." << string << ");\n")
198 .generate(sink, std::make_tuple(field_name, field_name), context)) 198 .generate(sink, std::make_tuple(field_name, field_name), context))
199 return false; 199 return false;
200 } 200 }
201 else if (need_struct_conversion(regular)) 201 else if (helpers::need_struct_conversion(regular))
202 { 202 {
203 if (!as_generator( 203 if (!as_generator(
204 scope_tab << scope_tab << "_internal_struct." << string << " = " << type << "_StructConversion.ToInternal(_external_struct." << string << ");\n") 204 scope_tab << scope_tab << "_internal_struct." << string << " = " << type << "_StructConversion.ToInternal(_external_struct." << string << ");\n")
@@ -259,7 +259,7 @@ struct to_external_field_convert_generator
259 template <typename OutputIterator, typename Context> 259 template <typename OutputIterator, typename Context>
260 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 260 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
261 { 261 {
262 auto field_name = to_field_name(field.name); 262 auto field_name = helpers::to_field_name(field.name);
263 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type); 263 auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
264 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type); 264 auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
265 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type); 265 auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
@@ -301,14 +301,14 @@ struct to_external_field_convert_generator
301 .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) 301 .generate(sink, std::make_tuple(field_name, field.type, field_name), context))
302 return false; 302 return false;
303 } 303 }
304 else if (field.type.is_ptr && need_pointer_conversion(regular) && !need_struct_conversion(regular)) 304 else if (field.type.is_ptr && helpers::need_pointer_conversion(regular) && !helpers::need_struct_conversion(regular))
305 { 305 {
306 if (!as_generator( 306 if (!as_generator(
307 scope_tab << scope_tab << "_external_struct." << string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(_internal_struct." << string << ");\n") 307 scope_tab << scope_tab << "_external_struct." << string << " = eina.PrimitiveConversion.PointerToManaged<" << type << ">(_internal_struct." << string << ");\n")
308 .generate(sink, std::make_tuple(field_name, field.type, field_name), context)) 308 .generate(sink, std::make_tuple(field_name, field.type, field_name), context))
309 return false; 309 return false;
310 } 310 }
311 else if (need_struct_conversion(regular)) 311 else if (helpers::need_struct_conversion(regular))
312 { 312 {
313 if (!as_generator( 313 if (!as_generator(
314 scope_tab << scope_tab << "_external_struct." << string << " = " << type << "_StructConversion.ToExternal(_internal_struct." << string << ");\n") 314 scope_tab << scope_tab << "_external_struct." << string << " = " << type << "_StructConversion.ToExternal(_internal_struct." << string << ");\n")
@@ -439,7 +439,7 @@ struct struct_entities_generator
439 template <typename OutputIterator, typename Context> 439 template <typename OutputIterator, typename Context>
440 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 440 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
441 { 441 {
442 if (is_struct_blacklisted(struct_)) 442 if (helpers::is_struct_blacklisted(struct_))
443 return true; 443 return true;
444 444
445 std::vector<std::string> cpp_namespaces = escape_namespace(attributes::cpp_namespaces(struct_.namespaces)); 445 std::vector<std::string> cpp_namespaces = escape_namespace(attributes::cpp_namespaces(struct_.namespaces));
diff --git a/src/bin/eolian_mono/eolian/mono/struct_fields.hh b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
index 0cd018b06f..c6d460d11a 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_fields.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
@@ -20,7 +20,7 @@ struct field_argument_default_generator
20 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 20 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
21 { 21 {
22 if (!as_generator(type << " " << string << "=default(" << type << ")") 22 if (!as_generator(type << " " << string << "=default(" << type << ")")
23 .generate(sink, std::make_tuple(field.type, to_field_name(field.name), field.type), context)) 23 .generate(sink, std::make_tuple(field.type, helpers::to_field_name(field.name), field.type), context))
24 return false; 24 return false;
25 return true; 25 return true;
26 } 26 }
@@ -32,7 +32,7 @@ struct field_argument_assignment_generator
32 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const 32 bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
33 { 33 {
34 if (!as_generator("this." << string << " = " << string) 34 if (!as_generator("this." << string << " = " << string)
35 .generate(sink, std::make_tuple(to_field_name(field.name), to_field_name(field.name)), context)) 35 .generate(sink, std::make_tuple(helpers::to_field_name(field.name), helpers::to_field_name(field.name)), context))
36 return false; 36 return false;
37 return true; 37 return true;
38 } 38 }