summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-01-26 17:01:03 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-04-03 17:29:41 -0300
commite2fafe5b0c1a8902136d7872b9e424347c7ce717 (patch)
treeb307c3d999638ee51a6f0c0b6d5d0b6a6c4b6d8a /src/bin/eolian_mono
parent92f5383e3c983756e05bd11c7e7ad9d53a332b14 (diff)
efl_mono: Initial version of Strbuf support.
Also moved the ValueOwnership enum from eina value to eina.Ownership. It can be shared among the eina structures if needed.
Diffstat (limited to 'src/bin/eolian_mono')
-rw-r--r--src/bin/eolian_mono/eolian/mono/helpers.hh1
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_annotation.hh24
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh6
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/type_impl.hh4
5 files changed, 36 insertions, 1 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh
index bdfdbb182c..a281f524d5 100644
--- a/src/bin/eolian_mono/eolian/mono/helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/helpers.hh
@@ -41,6 +41,7 @@ inline bool is_struct_blacklisted(std::string const& full_name)
41{ 41{
42 return full_name == "Efl.Event.Description" 42 return full_name == "Efl.Event.Description"
43 || full_name == "Eina.Binbuf" 43 || full_name == "Eina.Binbuf"
44 || full_name == "Eina.Strbuf"
44 || full_name == "Eina.Slice" 45 || full_name == "Eina.Slice"
45 || full_name == "Eina.Rw_Slice"; 46 || full_name == "Eina.Rw_Slice";
46} 47}
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
index 8774cd855c..f521a79840 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
@@ -76,6 +76,12 @@ struct marshall_annotation_visitor_generate
76 {"any_value_ptr", false, [&] { 76 {"any_value_ptr", false, [&] {
77 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.ValueMarshaler))]"; 77 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.ValueMarshaler))]";
78 }}, 78 }},
79 {"strbuf", true, [&] {
80 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
81 }},
82 {"strbuf", false, [&] {
83 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
84 }},
79 }; 85 };
80 match const return_match_table[] = 86 match const return_match_table[] =
81 { 87 {
@@ -105,6 +111,12 @@ struct marshall_annotation_visitor_generate
105 {"any_value_ptr", false, [&] { 111 {"any_value_ptr", false, [&] {
106 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.ValueMarshaler))]"; 112 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(eina.ValueMarshaler))]";
107 }}, 113 }},
114 {"strbuf", true, [&] {
115 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
116 }},
117 {"strbuf", false, [&] {
118 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
119 }},
108 }; 120 };
109 121
110 if(eina::optional<bool> b = call_annotation_match 122 if(eina::optional<bool> b = call_annotation_match
@@ -187,6 +199,12 @@ struct marshall_native_annotation_visitor_generate
187 return ""; 199 return "";
188 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StringshareKeepOwnershipMarshaler))]"; 200 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StringshareKeepOwnershipMarshaler))]";
189 }}, 201 }},
202 {"strbuf", true, [&] {
203 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
204 }},
205 {"strbuf", false, [&] {
206 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
207 }},
190 }; 208 };
191 match const return_match_table[] = 209 match const return_match_table[] =
192 { 210 {
@@ -200,6 +218,12 @@ struct marshall_native_annotation_visitor_generate
200 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StringsharePassOwnershipMarshaler))]"; 218 return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StringsharePassOwnershipMarshaler))]";
201 }}, 219 }},
202 {"stringshare", false, [&] { return ""; }}, 220 {"stringshare", false, [&] { return ""; }},
221 {"strbuf", true, [&] {
222 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufPassOwnershipMarshaler))]";
223 }},
224 {"strbuf", false, [&] {
225 return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(efl.eo.StrbufKeepOwnershipMarshaler))]";
226 }},
203 }; 227 };
204 228
205 if(eina::optional<bool> b = call_annotation_match 229 if(eina::optional<bool> b = call_annotation_match
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 61a53745ca..18359471bc 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
@@ -89,6 +89,12 @@ struct marshall_type_visitor_generate
89 else 89 else
90 return replace_base_type(r, " System.String"); 90 return replace_base_type(r, " System.String");
91 }} 91 }}
92 , {"strbuf", nullptr, [&]
93 {
94 regular_type_def r = regular;
95 r.base_qualifier.qualifier ^= qualifier_info::is_ref;
96 return replace_base_type(r, " eina.Strbuf");
97 }}
92 , {"Binbuf", true, [&] 98 , {"Binbuf", true, [&]
93 { 99 {
94 regular_type_def r = regular; 100 regular_type_def r = regular;
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 0b45da95b2..2382368bcd 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -342,7 +342,7 @@ struct to_external_field_convert_generator
342 else if (field.type.c_type == "Eina_Value *" || field.type.c_type == "const Eina_Value *") 342 else if (field.type.c_type == "Eina_Value *" || field.type.c_type == "const Eina_Value *")
343 { 343 {
344 if (!as_generator( 344 if (!as_generator(
345 scope_tab << scope_tab << "_external_struct." << string << " = new eina.Value(_internal_struct." << string << ", eina.ValueOwnership.Unmanaged);\n" 345 scope_tab << scope_tab << "_external_struct." << string << " = new eina.Value(_internal_struct." << string << ", eina.Ownership.Unmanaged);\n"
346 ).generate(sink, std::make_tuple(field_name, field_name), context)) 346 ).generate(sink, std::make_tuple(field_name, field_name), context))
347 return false; 347 return false;
348 } 348 }
diff --git a/src/bin/eolian_mono/eolian/mono/type_impl.hh b/src/bin/eolian_mono/eolian/mono/type_impl.hh
index dac1ea152e..ffd2de0a14 100644
--- a/src/bin/eolian_mono/eolian/mono/type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/type_impl.hh
@@ -137,6 +137,10 @@ struct visitor_generate
137 r.base_qualifier.qualifier ^= qualifier_info::is_ref; 137 r.base_qualifier.qualifier ^= qualifier_info::is_ref;
138 return replace_base_type(r, " System.String"); 138 return replace_base_type(r, " System.String");
139 }} 139 }}
140 , {"strbuf", nullptr, [&]
141 {
142 return regular_type_def{" eina.Strbuf", regular.base_qualifier, {}};
143 }}
140 , {"any_value", true, [&] 144 , {"any_value", true, [&]
141 { return regular_type_def{" eina.Value", regular.base_qualifier, {}}; 145 { return regular_type_def{" eina.Value", regular.base_qualifier, {}};
142 }} 146 }}