summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-07-30 11:05:26 -0300
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-07-30 11:47:07 -0300
commit29d24aa409371bd0252b34eb54b1adcb256ca2a1 (patch)
tree4c822a2c82f67e85980ced2ce1707729732fb1f2 /src/bin
parent1530d0386cff30b20da85e06b2688ea203b17cc7 (diff)
csharp: Add marshal support for Eina.ValueType
Summary: It uses a custom marshaler and a helper boxing class to convert between the managed enum values and the native Eina_Value_Type pointers. To be used by future MVVM machinery. Reviewers: vitor.sousa, felipealmeida Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9443
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_annotation.hh6
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh7
2 files changed, 13 insertions, 0 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
index 632696d6a7..6d56b2493c 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
@@ -82,6 +82,9 @@ struct marshall_annotation_visitor_generate
82 {"strbuf", false, [&] { 82 {"strbuf", false, [&] {
83 return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]"; 83 return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
84 }}, 84 }},
85 {"Value_Type", false, [&] {
86 return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueTypeMarshaler))]";
87 }},
85 }; 88 };
86 match const return_match_table[] = 89 match const return_match_table[] =
87 { 90 {
@@ -117,6 +120,9 @@ struct marshall_annotation_visitor_generate
117 {"strbuf", false, [&] { 120 {"strbuf", false, [&] {
118 return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]"; 121 return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
119 }}, 122 }},
123 {"Value_Type", false, [&] {
124 return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueTypeMarshaler))]";
125 }},
120 }; 126 };
121 127
122 if(eina::optional<bool> b = call_annotation_match 128 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 8de109e88b..588e8c2465 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh
@@ -161,6 +161,13 @@ struct marshall_type_visitor_generate
161 r.base_type = "void"; 161 r.base_type = "void";
162 return r; 162 return r;
163 }} 163 }}
164 , {"Value_Type", nullptr, [&]
165 {
166 regular_type_def r = regular;
167 r.namespaces.clear();
168 r.base_type = "Eina.ValueTypeBox";
169 return r;
170 }}
164 }; 171 };
165 172
166 if (regular.is_struct() && !blacklist::is_struct_blacklisted(regular) && !(bool)(regular.base_qualifier & qualifier_info::is_own)) 173 if (regular.is_struct() && !blacklist::is_struct_blacklisted(regular) && !(bool)(regular.base_qualifier & qualifier_info::is_own))