summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2020-01-13 09:45:16 +0900
committerYeongjong Lee <yj34.lee@samsung.com>2020-01-13 10:16:24 +0900
commit3fc78f69eb095e65c2be0bd172dd49d49b5b837f (patch)
treec968a761995b3ec745484c08a9e7f88cc9fd790b /src/bin
parenta7d5b089da67c4a30731ef876efe7530b6707db0 (diff)
eolian_mono: add 1 tab inside the namespace
Summary: Also, this patch will fix indentation of enum, struct. ### Before ``` namespace Efl.Ui { /// <summary>Define the move or resize mode of a window. /// /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed. ... [Efl.Eo.BindingEntity] public enum WinMoveResizeMode { /// <summary>Start moving window<br/>Since EFL 1.22.</summary> Move = 1, /// <summary>Start resizing window to the top<br/>Since EFL 1.22.</summary> Top = 2, ... } } ``` ### After ``` namespace Efl.Ui { /// <summary>Define the move or resize mode of a window. /// /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed. ... [Efl.Eo.BindingEntity] public enum WinMoveResizeMode { /// <summary>Start moving window<br/>Since EFL 1.22.</summary> Move = 1, /// <summary>Start resizing window to the top<br/>Since EFL 1.22.</summary> Top = 2, ... } } ``` Reviewers: Jaehyun_Cho, felipealmeida Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11032
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian_mono/eolian/mono/async_function_definition.hh34
-rw-r--r--src/bin/eolian_mono/eolian/mono/enum_definition.hh14
-rw-r--r--src/bin/eolian_mono/eolian/mono/events.hh104
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_declaration.hh4
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh88
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_helpers.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh208
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh8
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh24
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh14
10 files changed, 251 insertions, 249 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
index bf00dda..bc0bb68 100644
--- a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
@@ -72,30 +72,30 @@ struct async_function_declaration_generator
72 return true; 72 return true;
73 73
74 if (!as_generator( 74 if (!as_generator(
75 scope_tab << "/// <summary>Async wrapper for <see cref=\"" << name_helpers::managed_method_name(f) << "\" />.\n" 75 scope_tab(2) << "/// <summary>Async wrapper for <see cref=\"" << name_helpers::managed_method_name(f) << "\" />.\n"
76 ).generate(sink, attributes::unused, context)) 76 ).generate(sink, attributes::unused, context))
77 return false; 77 return false;
78 78
79 if (!f.documentation.since.empty()) 79 if (!f.documentation.since.empty())
80 if (!as_generator 80 if (!as_generator
81 (scope_tab << "/// <para>Since EFL " + f.documentation.since + ".</para>\n") 81 (scope_tab(2) << "/// <para>Since EFL " + f.documentation.since + ".</para>\n")
82 .generate (sink, attributes::unused, context)) 82 .generate (sink, attributes::unused, context))
83 return false; 83 return false;
84 84
85 if (!as_generator( 85 if (!as_generator(
86 scope_tab << "/// </summary>\n" 86 scope_tab(2) << "/// </summary>\n"
87 ).generate(sink, attributes::unused, context)) 87 ).generate(sink, attributes::unused, context))
88 return false; 88 return false;
89 89
90 // generate_parameter is not a proper as_generator-compatible generator, so we had to do an old fashioned loop 90 // generate_parameter is not a proper as_generator-compatible generator, so we had to do an old fashioned loop
91 for (auto&& param : f.parameters) 91 for (auto&& param : f.parameters)
92 if (!documentation(1).generate_parameter(sink, param, context)) 92 if (!documentation(2).generate_parameter(sink, param, context))
93 return false; 93 return false;
94 94
95 if (!as_generator( 95 if (!as_generator(
96 scope_tab << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n" 96 scope_tab(2) << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n"
97 << scope_tab << "/// <returns>An async task wrapping the result of the operation.</returns>\n" 97 << scope_tab(2) << "/// <returns>An async task wrapping the result of the operation.</returns>\n"
98 << scope_tab << "System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") << 98 << scope_tab(2) << "System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") <<
99 " System.Threading.CancellationToken token = default(System.Threading.CancellationToken));\n\n" 99 " System.Threading.CancellationToken token = default(System.Threading.CancellationToken));\n\n"
100 ).generate(sink, f.parameters, context)) 100 ).generate(sink, f.parameters, context))
101 return false; 101 return false;
@@ -130,18 +130,18 @@ struct async_function_definition_generator
130 std::transform(f.parameters.begin(), f.parameters.end(), std::back_inserter(param_forwarding), parameter_forwarding); 130 std::transform(f.parameters.begin(), f.parameters.end(), std::back_inserter(param_forwarding), parameter_forwarding);
131 131
132 if (!as_generator( 132 if (!as_generator(
133 scope_tab << "/// <summary>Async wrapper for <see cref=\"" << name_helpers::managed_method_name(f) << "\" />.\n" 133 scope_tab(2) << "/// <summary>Async wrapper for <see cref=\"" << name_helpers::managed_method_name(f) << "\" />.\n"
134 ).generate(sink, attributes::unused, context)) 134 ).generate(sink, attributes::unused, context))
135 return false; 135 return false;
136 136
137 if (!f.documentation.since.empty()) 137 if (!f.documentation.since.empty())
138 if (!as_generator 138 if (!as_generator
139 (scope_tab << "/// <para>Since EFL " + f.documentation.since + ".</para>\n") 139 (scope_tab(2) << "/// <para>Since EFL " + f.documentation.since + ".</para>\n")
140 .generate (sink, attributes::unused, context)) 140 .generate (sink, attributes::unused, context))
141 return false; 141 return false;
142 142
143 if (!as_generator( 143 if (!as_generator(
144 scope_tab << "/// </summary>\n" 144 scope_tab(2) << "/// </summary>\n"
145 ).generate(sink, attributes::unused, context)) 145 ).generate(sink, attributes::unused, context))
146 return false; 146 return false;
147 147
@@ -151,13 +151,13 @@ struct async_function_definition_generator
151 return false; 151 return false;
152 152
153 if(!as_generator( 153 if(!as_generator(
154 scope_tab << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n" 154 scope_tab(2) << "/// <param name=\"token\">Token to notify the async operation of external request to cancel.</param>\n"
155 << scope_tab << "/// <returns>An async task wrapping the result of the operation.</returns>\n" 155 << scope_tab(2) << "/// <returns>An async task wrapping the result of the operation.</returns>\n"
156 << scope_tab << "public System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") << " System.Threading.CancellationToken token = default(System.Threading.CancellationToken))\n" 156 << scope_tab(2) << "public System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") << " System.Threading.CancellationToken token = default(System.Threading.CancellationToken))\n"
157 << scope_tab << "{\n" 157 << scope_tab(2) << "{\n"
158 << scope_tab << scope_tab << "Eina.Future future = " << name_helpers::managed_method_name(f) << "(" << (string % ", ") << ");\n" 158 << scope_tab(2) << scope_tab << "Eina.Future future = " << name_helpers::managed_method_name(f) << "(" << (string % ", ") << ");\n"
159 << scope_tab << scope_tab << "return Efl.Eo.Globals.WrapAsync(future, token);\n" 159 << scope_tab(2) << scope_tab << "return Efl.Eo.Globals.WrapAsync(future, token);\n"
160 << scope_tab << "}\n\n" 160 << scope_tab(2) << "}\n\n"
161 ).generate(sink, std::make_tuple(f.parameters, param_forwarding), context)) 161 ).generate(sink, std::make_tuple(f.parameters, param_forwarding), context))
162 return false; 162 return false;
163 return true; 163 return true;
diff --git a/src/bin/eolian_mono/eolian/mono/enum_definition.hh b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
index 2c304fc..4b07652 100644
--- a/src/bin/eolian_mono/eolian/mono/enum_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
@@ -49,10 +49,11 @@ struct enum_definition_generator
49 49
50 if(!as_generator 50 if(!as_generator
51 ( 51 (
52 documentation 52 documentation(1)
53 << flags_attribute 53 << scope_tab << flags_attribute << "\n"
54 << "[Efl.Eo.BindingEntity]\n" 54 << scope_tab << "[Efl.Eo.BindingEntity]\n"
55 "public enum " << enum_name << "\n{\n" 55 << scope_tab << "public enum " << enum_name << "\n"
56 << scope_tab << "{\n"
56 ) 57 )
57 .generate(sink, enum_, context)) 58 .generate(sink, enum_, context))
58 return false; 59 return false;
@@ -65,13 +66,14 @@ struct enum_definition_generator
65 auto literal = (*first).value.literal; 66 auto literal = (*first).value.literal;
66 if (!as_generator 67 if (!as_generator
67 ( 68 (
68 documentation << string << " = " << string << ",\n" 69 documentation(2)
70 << scope_tab(2) << string << " = " << string << ",\n"
69 ) 71 )
70 .generate(sink, std::make_tuple(*first, name, literal), context)) 72 .generate(sink, std::make_tuple(*first, name, literal), context))
71 return false; 73 return false;
72 } 74 }
73 75
74 if(!as_generator("}\n").generate(sink, attributes::unused, context)) return false; 76 if(!as_generator(scope_tab << "}\n").generate(sink, attributes::unused, context)) return false;
75 77
76 if(!name_helpers::close_namespaces(sink, enum_.namespaces, context)) 78 if(!name_helpers::close_namespaces(sink, enum_.namespaces, context))
77 return false; 79 return false;
diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh
index 8bb1799..2b85c7e 100644
--- a/src/bin/eolian_mono/eolian/mono/events.hh
+++ b/src/bin/eolian_mono/eolian/mono/events.hh
@@ -165,9 +165,9 @@ struct pack_event_info_and_call_visitor
165 if (regular.is_struct()) 165 if (regular.is_struct())
166 { 166 {
167 return as_generator( 167 return as_generator(
168 indent << "Contract.Requires(e != null, nameof(e));\n" 168 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
169 << indent << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n" 169 << indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n"
170 << indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n" 170 << indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
171 ).generate(sink, attributes::unused, *context); 171 ).generate(sink, attributes::unused, *context);
172 } 172 }
173 173
@@ -193,9 +193,9 @@ struct pack_event_info_and_call_visitor
193 auto str_accept_func = [&](std::string const& conversion) 193 auto str_accept_func = [&](std::string const& conversion)
194 { 194 {
195 return as_generator( 195 return as_generator(
196 indent << "Contract.Requires(e != null, nameof(e));\n" 196 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
197 << indent << "IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(" << conversion << ");\n" 197 << indent.inc() << "IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(" << conversion << ");\n"
198 << indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Eina.MemoryNative.Free(p));\n" 198 << indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Eina.MemoryNative.Free(p));\n"
199 ).generate(sink, attributes::unused, *context); 199 ).generate(sink, attributes::unused, *context);
200 }; 200 };
201 201
@@ -212,9 +212,9 @@ struct pack_event_info_and_call_visitor
212 auto value_accept_func = [&](std::string const& conversion) 212 auto value_accept_func = [&](std::string const& conversion)
213 { 213 {
214 return as_generator( 214 return as_generator(
215 indent << "Contract.Requires(e != null, nameof(e));\n" 215 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
216 << indent << "IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(" << conversion << ");\n" 216 << indent.inc() << "IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(" << conversion << ");\n"
217 << indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n" 217 << indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n"
218 ).generate(sink, attributes::unused, *context); 218 ).generate(sink, attributes::unused, *context);
219 }; 219 };
220 220
@@ -227,8 +227,8 @@ struct pack_event_info_and_call_visitor
227 { 227 {
228 auto const& indent = current_indentation(*context); 228 auto const& indent = current_indentation(*context);
229 return as_generator( 229 return as_generator(
230 indent << "Contract.Requires(e != null, nameof(e));\n" 230 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
231 << indent << "IntPtr info = e.arg.NativeHandle;\n" 231 << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n"
232 << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" 232 << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n"
233 ).generate(sink, attributes::unused, *context); 233 ).generate(sink, attributes::unused, *context);
234 } 234 }
@@ -239,8 +239,8 @@ struct pack_event_info_and_call_visitor
239 return true; 239 return true;
240 240
241 return as_generator( 241 return as_generator(
242 indent << "Contract.Requires(e != null, nameof(e));\n" 242 indent.inc() << "Contract.Requires(e != null, nameof(e));\n"
243 << indent << "IntPtr info = e.arg.Handle;\n" 243 << indent.inc() << "IntPtr info = e.arg.Handle;\n"
244 << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" 244 << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n"
245 ).generate(sink, attributes::unused, *context); 245 ).generate(sink, attributes::unused, *context);
246 } 246 }
@@ -263,7 +263,7 @@ struct event_argument_wrapper_generator
263 263
264 std::string evt_name = name_helpers::managed_event_name(evt.name); 264 std::string evt_name = name_helpers::managed_event_name(evt.name);
265 265
266 if (!as_generator("/// <summary>Event argument wrapper for event <see cref=\"" 266 if (!as_generator(scope_tab << "/// <summary>Event argument wrapper for event <see cref=\""
267 << join_namespaces(evt.klass.namespaces, '.', managed_namespace) 267 << join_namespaces(evt.klass.namespaces, '.', managed_namespace)
268 << klass_interface_name(evt.klass) << "." << evt_name << "\"/>.\n" 268 << klass_interface_name(evt.klass) << "." << evt_name << "\"/>.\n"
269 ).generate(sink, nullptr, context)) 269 ).generate(sink, nullptr, context))
@@ -286,7 +286,7 @@ struct event_argument_wrapper_generator
286 { 286 {
287 287
288 if (!as_generator( 288 if (!as_generator(
289 lit("/// <para>Since EFL ") << evt.documentation.since << ".</para>\n" 289 scope_tab << lit("/// <para>Since EFL ") << evt.documentation.since << ".</para>\n"
290 ).generate(sink, nullptr, context)) 290 ).generate(sink, nullptr, context))
291 return false; 291 return false;
292 } 292 }
@@ -298,23 +298,23 @@ struct event_argument_wrapper_generator
298 } 298 }
299 } 299 }
300 300
301 if (!as_generator(lit("/// </summary>\n") 301 if (!as_generator(scope_tab << lit("/// </summary>\n")
302 << "[Efl.Eo.BindingEntity]\n" 302 << scope_tab << "[Efl.Eo.BindingEntity]\n"
303 << "public class " << name_helpers::managed_event_args_short_name(evt) << " : EventArgs {\n" 303 << scope_tab << "public class " << name_helpers::managed_event_args_short_name(evt) << " : EventArgs {\n"
304 << scope_tab << "/// <summary>Actual event payload.\n" 304 << scope_tab(2) << "/// <summary>Actual event payload.\n"
305 ).generate(sink, nullptr, context)) 305 ).generate(sink, nullptr, context))
306 return false; 306 return false;
307 307
308 if (since != "") 308 if (since != "")
309 { 309 {
310 if (!as_generator(scope_tab << "/// <para>Since EFL " << since << ".</para>\n").generate(sink, nullptr, context)) 310 if (!as_generator(scope_tab(2) << "/// <para>Since EFL " << since << ".</para>\n").generate(sink, nullptr, context))
311 return false; 311 return false;
312 } 312 }
313 313
314 if (!as_generator(scope_tab << "/// </summary>\n" 314 if (!as_generator(scope_tab(2) << "/// </summary>\n"
315 << scope_tab << "/// <value>" << documentation_string << "</value>\n" 315 << scope_tab(2) << "/// <value>" << documentation_string << "</value>\n"
316 << scope_tab << "public " << type << " arg { get; set; }\n" 316 << scope_tab(2) << "public " << type << " arg { get; set; }\n"
317 << "}\n\n" 317 << scope_tab << "}\n\n"
318 ).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context)) 318 ).generate(sink, std::make_tuple(evt.documentation.summary, *etype), context))
319 return false; 319 return false;
320 320
@@ -341,14 +341,14 @@ struct event_declaration_generator
341 if (evt.type.is_engaged()) 341 if (evt.type.is_engaged())
342 wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">"; 342 wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">";
343 343
344 if (!as_generator(documentation(1)) 344 if (!as_generator(documentation(2))
345 .generate(sink, evt, context)) return false; 345 .generate(sink, evt, context)) return false;
346 if (evt.type.is_engaged()) 346 if (evt.type.is_engaged())
347 if (!as_generator( 347 if (!as_generator(
348 scope_tab << "/// <value><see cref=\"" << name_helpers::managed_event_args_name(evt) << "\"/></value>\n" 348 scope_tab(2) << "/// <value><see cref=\"" << name_helpers::managed_event_args_name(evt) << "\"/></value>\n"
349 ).generate(sink, evt, context)) return false; 349 ).generate(sink, evt, context)) return false;
350 if (!as_generator( 350 if (!as_generator(
351 scope_tab << "event EventHandler" << wrapper_args_type << " " << evt_name << ";\n" 351 scope_tab(2) << "event EventHandler" << wrapper_args_type << " " << evt_name << ";\n"
352 ).generate(sink, evt, context)) 352 ).generate(sink, evt, context))
353 return false; 353 return false;
354 354
@@ -398,7 +398,7 @@ struct event_definition_generator
398 if (!etype.is_engaged()) 398 if (!etype.is_engaged())
399 { 399 {
400 auto event_call_site_sink = std::back_inserter(event_native_call); 400 auto event_call_site_sink = std::back_inserter(event_native_call);
401 if (!as_generator(indent.inc().inc() << "CallNativeEventCallback(" << library_name << ", \"_" << utils::to_uppercase(evt.c_name) << "\", IntPtr.Zero, null);\n") 401 if (!as_generator(indent.inc().inc().inc() << "CallNativeEventCallback(" << library_name << ", \"_" << utils::to_uppercase(evt.c_name) << "\", IntPtr.Zero, null);\n")
402 .generate(event_call_site_sink, attributes::unused, context)) 402 .generate(event_call_site_sink, attributes::unused, context))
403 return false; 403 return false;
404 } 404 }
@@ -427,11 +427,11 @@ struct event_definition_generator
427 event_args = arg_initializer; 427 event_args = arg_initializer;
428 } 428 }
429 429
430 if(!as_generator(documentation(1)).generate(sink, evt, context)) 430 if(!as_generator(documentation(2)).generate(sink, evt, context))
431 return false; 431 return false;
432 if (etype.is_engaged()) 432 if (etype.is_engaged())
433 if (!as_generator( 433 if (!as_generator(
434 scope_tab << "/// <value><see cref=\"" << wrapper_args_type << "\"/></value>\n" 434 scope_tab(2) << "/// <value><see cref=\"" << wrapper_args_type << "\"/></value>\n"
435 ).generate(sink, evt, context)) return false; 435 ).generate(sink, evt, context)) return false;
436 436
437 // Visible event declaration. Either a regular class member or an explicit interface implementation. 437 // Visible event declaration. Either a regular class member or an explicit interface implementation.
@@ -439,7 +439,7 @@ struct event_definition_generator
439 { 439 {
440 // Public event implementation. 440 // Public event implementation.
441 if (!as_generator( 441 if (!as_generator(
442 scope_tab << (!use_explicit_impl ? "public " : " ") << "event EventHandler" << wrapper_args_template << " " << (use_explicit_impl ? (klass_name + ".") : "") << managed_evt_name << "\n" 442 scope_tab(2) << (!use_explicit_impl ? "public " : " ") << "event EventHandler" << wrapper_args_template << " " << (use_explicit_impl ? (klass_name + ".") : "") << managed_evt_name << "\n"
443 ).generate(sink, attributes::unused, context)) 443 ).generate(sink, attributes::unused, context))
444 return false; 444 return false;
445 } 445 }
@@ -452,7 +452,7 @@ struct event_definition_generator
452 visibility += "new "; 452 visibility += "new ";
453 453
454 if (!as_generator( 454 if (!as_generator(
455 scope_tab << visibility << "event EventHandler" << wrapper_args_template << " " << wrapper_evt_name << "\n" 455 scope_tab(2) << visibility << "event EventHandler" << wrapper_args_template << " " << wrapper_evt_name << "\n"
456 ).generate(sink, attributes::unused, context)) 456 ).generate(sink, attributes::unused, context))
457 return false; 457 return false;
458 } 458 }
@@ -479,7 +479,7 @@ struct event_definition_generator
479 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete; 479 bool is_concrete = context_find_tag<class_context>(context).current_wrapper_kind == class_context::concrete;
480 480
481 if (!as_generator( 481 if (!as_generator(
482 scope_tab << "/// <summary>Method to raise event "<< event_name << ".\n" 482 scope_tab(2) << "/// <summary>Method to raise event "<< event_name << ".\n"
483 ).generate(sink, nullptr, context)) 483 ).generate(sink, nullptr, context))
484 return false; 484 return false;
485 485
@@ -498,7 +498,7 @@ struct event_definition_generator
498 { 498 {
499 499
500 if (!as_generator( 500 if (!as_generator(
501 scope_tab << "/// <para>Since EFL " << evt.documentation.since << ".</para>\n" 501 scope_tab(2) << "/// <para>Since EFL " << evt.documentation.since << ".</para>\n"
502 ).generate(sink, nullptr, context)) 502 ).generate(sink, nullptr, context))
503 return false; 503 return false;
504 } 504 }
@@ -511,21 +511,21 @@ struct event_definition_generator
511 } 511 }
512 512
513 // Close summary 513 // Close summary
514 if (!as_generator(scope_tab << "/// </summary>\n").generate(sink, nullptr, context)) 514 if (!as_generator(scope_tab(2) << "/// </summary>\n").generate(sink, nullptr, context))
515 return false; 515 return false;
516 516
517 if (evt.type.is_engaged()) 517 if (evt.type.is_engaged())
518 { 518 {
519 if (!as_generator(scope_tab << "/// <param name=\"e\">Event to raise.</param>\n" 519 if (!as_generator(scope_tab(2) << "/// <param name=\"e\">Event to raise.</param>\n"
520 ).generate(sink, nullptr, context)) 520 ).generate(sink, nullptr, context))
521 return false; 521 return false;
522 } 522 }
523 523
524 if (!as_generator( 524 if (!as_generator(
525 scope_tab << (is_concrete ? "public" : "protected virtual") << " void On" << event_name << "(" << (!evt.type.is_engaged() ? "" : event_args_type + " e") << ")\n" 525 scope_tab(2) << (is_concrete ? "public" : "protected virtual") << " void On" << event_name << "(" << (!evt.type.is_engaged() ? "" : event_args_type + " e") << ")\n"
526 << scope_tab << "{\n" 526 << scope_tab(2) << "{\n"
527 << event_native_call 527 << event_native_call
528 << scope_tab << "}\n\n" 528 << scope_tab(2) << "}\n\n"
529 ).generate(sink, nullptr, context)) 529 ).generate(sink, nullptr, context))
530 return false; 530 return false;
531 531
@@ -543,20 +543,20 @@ struct event_definition_generator
543 attributes::klass_def klass(get_klass(evt.klass, unit), unit); 543 attributes::klass_def klass(get_klass(evt.klass, unit), unit);
544 auto library_name = context_find_tag<library_context>(context).actual_library_name(klass.filename); 544 auto library_name = context_find_tag<library_context>(context).actual_library_name(klass.filename);
545 return as_generator( 545 return as_generator(
546 scope_tab << "{\n" 546 scope_tab(2) << "{\n"
547 << scope_tab << scope_tab << "add\n" 547 << scope_tab(2) << scope_tab << "add\n"
548 << scope_tab << scope_tab << "{\n"//evt.type.is_engaged() 548 << scope_tab(2) << scope_tab << "{\n"//evt.type.is_engaged()
549 << scope_tab << scope_tab << scope_tab << "Efl.EventCb callerCb = GetInternalEventCallback(value" 549 << scope_tab(2) << scope_tab << scope_tab << "Efl.EventCb callerCb = GetInternalEventCallback(value"
550 << (evt.type.is_engaged() ? event_args : "") << ");\n" 550 << (evt.type.is_engaged() ? event_args : "") << ");\n"
551 << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n" 551 << scope_tab(2) << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
552 << scope_tab << scope_tab << scope_tab << "AddNativeEventHandler(" << library_name << ", key, callerCb, value);\n" 552 << scope_tab(2) << scope_tab << scope_tab << "AddNativeEventHandler(" << library_name << ", key, callerCb, value);\n"
553 << scope_tab << scope_tab << "}\n\n" 553 << scope_tab(2) << scope_tab << "}\n\n"
554 << scope_tab << scope_tab << "remove\n" 554 << scope_tab(2) << scope_tab << "remove\n"
555 << scope_tab << scope_tab << "{\n" 555 << scope_tab(2) << scope_tab << "{\n"
556 << scope_tab << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n" 556 << scope_tab(2) << scope_tab << scope_tab << "string key = \"_" << upper_c_name << "\";\n"
557 << scope_tab << scope_tab << scope_tab << "RemoveNativeEventHandler(" << library_name << ", key, value);\n" 557 << scope_tab(2) << scope_tab << scope_tab << "RemoveNativeEventHandler(" << library_name << ", key, value);\n"
558 << scope_tab << scope_tab << "}\n" 558 << scope_tab(2) << scope_tab << "}\n"
559 << scope_tab << "}\n\n" 559 << scope_tab(2) << "}\n\n"
560 ).generate(sink, attributes::unused, context); 560 ).generate(sink, attributes::unused, context);
561 } 561 }
562}; 562};
diff --git a/src/bin/eolian_mono/eolian/mono/function_declaration.hh b/src/bin/eolian_mono/eolian/mono/function_declaration.hh
index b71ffb1..d209f06 100644
--- a/src/bin/eolian_mono/eolian/mono/function_declaration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_declaration.hh
@@ -42,11 +42,11 @@ struct function_declaration_generator
42 if(f.scope != attributes::member_scope::scope_public) 42 if(f.scope != attributes::member_scope::scope_public)
43 return true; 43 return true;
44 44
45 if(!as_generator(documentation(1)).generate(sink, f, context)) 45 if(!as_generator(documentation(2)).generate(sink, f, context))
46 return false; 46 return false;
47 47
48 return as_generator 48 return as_generator
49 (scope_tab << eolian_mono::type(true) << " " << string << "(" << (parameter % ", ") << ");\n\n") 49 (scope_tab(2) << eolian_mono::type(true) << " " << string << "(" << (parameter % ", ") << ");\n\n")
50 .generate(sink, std::make_tuple(f.return_type, name_helpers::managed_method_name(f), f.parameters), context); 50 .generate(sink, std::make_tuple(f.return_type, name_helpers::managed_method_name(f), f.parameters), context);
51 } 51 }
52}; 52};
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index fa49412..df6f62a 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -207,7 +207,7 @@ struct function_definition_generator
207 return false; 207 return false;
208 208
209 if(!as_generator 209 if(!as_generator
210 (documentation(1)).generate(sink, f, context)) 210 (documentation(2)).generate(sink, f, context))
211 return false; 211 return false;
212 212
213 std::string self = "this.NativeHandle"; 213 std::string self = "this.NativeHandle";
@@ -220,15 +220,15 @@ struct function_definition_generator
220 self = ""; 220 self = "";
221 221
222 if(!as_generator 222 if(!as_generator
223 (scope_tab << eolian_mono::function_scope_get(f) << ((do_super && !f.is_static) ? "virtual " : "") << (f.is_static ? "static " : "") << return_type << " " << string << "(" << (parameter % ", ") 223 (scope_tab(2) << eolian_mono::function_scope_get(f) << ((do_super && !f.is_static) ? "virtual " : "") << (f.is_static ? "static " : "") << return_type << " " << string << "(" << (parameter % ", ")
224 << ") {\n" 224 << ") {\n"
225 << scope_tab(2) << eolian_mono::function_definition_preamble() 225 << scope_tab(3) << eolian_mono::function_definition_preamble()
226 << klass_full_native_inherit_name(f.klass) << "." << string << "_ptr.Value.Delegate(" 226 << klass_full_native_inherit_name(f.klass) << "." << string << "_ptr.Value.Delegate("
227 << self 227 << self
228 << ((!f.is_static && (f.parameters.size() > 0)) ? ", " : "") 228 << ((!f.is_static && (f.parameters.size() > 0)) ? ", " : "")
229 << (argument_invocation % ", ") << ");\n" 229 << (argument_invocation % ", ") << ");\n"
230 << scope_tab(2) << eolian_mono::function_definition_epilogue() 230 << scope_tab(3) << eolian_mono::function_definition_epilogue()
231 << scope_tab(1) << "}\n\n") 231 << scope_tab(2) << "}\n\n")
232 .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.parameters, f, f.c_name, f.parameters, f), context)) 232 .generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.parameters, f, f.c_name, f.parameters, f), context))
233 return false; 233 return false;
234 234
@@ -285,11 +285,11 @@ struct property_extension_method_definition_generator
285 if (property.setter.is_engaged()) 285 if (property.setter.is_engaged())
286 { 286 {
287 attributes::type_def prop_type = property.setter->parameters[0].type; 287 attributes::type_def prop_type = property.setter->parameters[0].type;
288 if (!as_generator(scope_tab << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<" 288 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<"
289 << name_helpers::klass_full_concrete_or_interface_name(cls) 289 << name_helpers::klass_full_concrete_or_interface_name(cls)
290 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" 290 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
291 << scope_tab << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n" 291 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n"
292 << scope_tab << "}\n\n" 292 << scope_tab(2) << "}\n\n"
293 ).generate(sink, std::make_tuple(prop_type, prop_type), context)) 293 ).generate(sink, std::make_tuple(prop_type, prop_type), context))
294 return false; 294 return false;
295 } 295 }
@@ -302,12 +302,12 @@ struct property_extension_method_definition_generator
302 if (property.setter.is_engaged()) 302 if (property.setter.is_engaged())
303 { 303 {
304 attributes::type_def prop_type = property.setter->parameters[0].type; 304 attributes::type_def prop_type = property.setter->parameters[0].type;
305 if (!as_generator(scope_tab << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.BindablePart<T> part, Efl.Csharp.ExtensionTag<" 305 if (!as_generator(scope_tab(2) << "public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "<T>(this Efl.BindablePart<T> part, Efl.Csharp.ExtensionTag<"
306 << name_helpers::klass_full_concrete_or_interface_name(cls) 306 << name_helpers::klass_full_concrete_or_interface_name(cls)
307 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" 307 << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n"
308 << scope_tab << scope_tab << "Contract.Requires(part != null, nameof(part));\n" 308 << scope_tab(2) << scope_tab << "Contract.Requires(part != null, nameof(part));\n"
309 << scope_tab << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n" 309 << scope_tab(2) << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n"
310 << scope_tab << "}\n\n" 310 << scope_tab(2) << "}\n\n"
311 ).generate(sink, std::make_tuple(prop_type, prop_type), context)) 311 ).generate(sink, std::make_tuple(prop_type, prop_type), context))
312 return false; 312 return false;
313 } 313 }
@@ -332,19 +332,19 @@ struct property_wrapper_definition_generator
332 { 332 {
333 if (is_interface) 333 if (is_interface)
334 { 334 {
335 if (!as_generator(scope_tab << scope_tab << get_scope << "get;\n" 335 if (!as_generator(scope_tab(3) << get_scope << "get;\n"
336 ).generate(sink, attributes::unused, context)) 336 ).generate(sink, attributes::unused, context))
337 return false; 337 return false;
338 } 338 }
339 else 339 else
340 { 340 {
341 if (!as_generator(scope_tab << scope_tab << get_scope << "get\n" 341 if (!as_generator(scope_tab(2) << scope_tab << get_scope << "get\n"
342 << scope_tab << scope_tab << "{\n" 342 << scope_tab(2) << scope_tab << "{\n"
343 << scope_tab << scope_tab(2) << "var i = new " 343 << scope_tab(2) << scope_tab(2) << "var i = new "
344 << name_helpers::property_concrete_indexer_name(property) << "();\n" 344 << name_helpers::property_concrete_indexer_name(property) << "();\n"
345 << scope_tab << scope_tab(2) << "i.Self = this;\n" 345 << scope_tab(2) << scope_tab(2) << "i.Self = this;\n"
346 << scope_tab << scope_tab(2) << "return i;\n" 346 << scope_tab(2) << scope_tab(2) << "return i;\n"
347 << scope_tab << scope_tab << "}\n" 347 << scope_tab(2) << scope_tab << "}\n"
348 ).generate(sink, attributes::unused, context)) 348 ).generate(sink, attributes::unused, context))
349 return false; 349 return false;
350 } 350 }
@@ -388,12 +388,12 @@ struct property_wrapper_definition_generator
388 388
389 if (!as_generator 389 if (!as_generator
390 ( 390 (
391 scope_tab << scope << "class " << name_helpers::property_concrete_indexer_name(property) << parentship 391 scope_tab(2) << scope << "class " << name_helpers::property_concrete_indexer_name(property) << parentship
392 << scope_tab << "{\n"
393 << scope_tab(2) << "public " << class_name << " Self {get; set;}\n"
394 << scope_tab(2) << "public "
395 << type_or_tuple << " this[" << type_or_tuple <<" i]\n"
396 << scope_tab(2) << "{\n" 392 << scope_tab(2) << "{\n"
393 << scope_tab(3) << "public " << class_name << " Self {get; set;}\n"
394 << scope_tab(3) << "public "
395 << type_or_tuple << " this[" << type_or_tuple <<" i]\n"
396 << scope_tab(3) << "{\n"
397 ).generate(sink, make_tuple(values, values, keys, keys), context)) 397 ).generate(sink, make_tuple(values, values, keys, keys), context))
398 return false; 398 return false;
399 399
@@ -421,8 +421,8 @@ struct property_wrapper_definition_generator
421 421
422 if (!as_generator 422 if (!as_generator
423 ( 423 (
424 scope_tab(2) << "}\n" 424 scope_tab(3) << "}\n"
425 << scope_tab << "};\n" 425 << scope_tab(2) << "};\n"
426 ).generate(sink, attributes::unused, context)) 426 ).generate(sink, attributes::unused, context))
427 return false; 427 return false;
428 return true; 428 return true;
@@ -437,20 +437,20 @@ struct property_wrapper_definition_generator
437 using efl::eolian::grammar::counter; 437 using efl::eolian::grammar::counter;
438 if (is_interface) 438 if (is_interface)
439 { 439 {
440 if (!as_generator(scope_tab << scope_tab << set_scope << "set;\n" 440 if (!as_generator(scope_tab(2) << scope_tab << set_scope << "set;\n"
441 ).generate(sink, attributes::unused, context)) 441 ).generate(sink, attributes::unused, context))
442 return false; 442 return false;
443 } 443 }
444 else if (values.size() == 1) 444 else if (values.size() == 1)
445 { 445 {
446 if (!as_generator(scope_tab << scope_tab << set_scope << "set " << "{ " << name_prefix << name_helpers::managed_method_name(*property.setter) + "(" << *(string << ",") << "value); }\n" 446 if (!as_generator(scope_tab(2) << scope_tab << set_scope << "set " << "{ " << name_prefix << name_helpers::managed_method_name(*property.setter) + "(" << *(string << ",") << "value); }\n"
447 ).generate(sink, keys, context)) 447 ).generate(sink, keys, context))
448 return false; 448 return false;
449 } 449 }
450 else if (values.size() > 1) 450 else if (values.size() > 1)
451 { 451 {
452 if (!as_generator( 452 if (!as_generator(
453 scope_tab << scope_tab << set_scope << "set " 453 scope_tab(2) << scope_tab << set_scope << "set "
454 << ("{ " << name_prefix << name_helpers::managed_method_name(*property.setter) + "(") 454 << ("{ " << name_prefix << name_helpers::managed_method_name(*property.setter) + "(")
455 << *(string << ",") << ((" value.Item" << counter(1)) % ", ") 455 << *(string << ",") << ((" value.Item" << counter(1)) % ", ")
456 << "); }\n" 456 << "); }\n"
@@ -472,7 +472,7 @@ struct property_wrapper_definition_generator
472 472
473 if (is_interface) // only declaration 473 if (is_interface) // only declaration
474 { 474 {
475 if (!as_generator(scope_tab << scope_tab << get_scope << "get;\n" 475 if (!as_generator(scope_tab(2) << scope_tab << get_scope << "get;\n"
476 ).generate(sink, attributes::unused, context)) 476 ).generate(sink, attributes::unused, context))
477 return false; 477 return false;
478 } 478 }
@@ -480,7 +480,7 @@ struct property_wrapper_definition_generator
480 if (/*has_getter && */values.size() == 1) 480 if (/*has_getter && */values.size() == 1)
481 { 481 {
482 if (!as_generator 482 if (!as_generator
483 (scope_tab << scope_tab << get_scope 483 (scope_tab(2) << scope_tab << get_scope
484 << "get " << "{ return " << name_prefix << name_helpers::managed_method_name(*property.getter) 484 << "get " << "{ return " << name_prefix << name_helpers::managed_method_name(*property.getter)
485 << "(" << (string % ",") << "); }\n" 485 << "(" << (string % ",") << "); }\n"
486 ).generate(sink, keys, context)) 486 ).generate(sink, keys, context))
@@ -489,16 +489,16 @@ struct property_wrapper_definition_generator
489 else if (/*has_getter && */values.size() > 1) 489 else if (/*has_getter && */values.size() > 1)
490 { 490 {
491 if (!as_generator 491 if (!as_generator
492 (scope_tab << scope_tab << get_scope << "get " 492 (scope_tab(2) << scope_tab << get_scope << "get "
493 << "{\n" 493 << "{\n"
494 << *attribute_reorder<1, -1, 1> 494 << *attribute_reorder<1, -1, 1>
495 (scope_tab(3) << type(true) << " _out_" 495 (scope_tab(4) << type(true) << " _out_"
496 << argument(false) << " = default(" << type(true) << ");\n" 496 << argument(false) << " = default(" << type(true) << ");\n"
497 ) 497 )
498 << scope_tab(3) << name_prefix << name_helpers::managed_method_name(*property.getter) 498 << scope_tab(4) << name_prefix << name_helpers::managed_method_name(*property.getter)
499 << "(" << *(string << ",") << (("out _out_" << argument(false)) % ", ") << ");\n" 499 << "(" << *(string << ",") << (("out _out_" << argument(false)) % ", ") << ");\n"
500 << scope_tab(3) << "return (" << (("_out_"<< argument(false)) % ", ") << ");\n" 500 << scope_tab(4) << "return (" << (("_out_"<< argument(false)) % ", ") << ");\n"
501 << scope_tab(2) << "}" << "\n" 501 << scope_tab(3) << "}" << "\n"
502 ).generate(sink, std::make_tuple(values, keys, values, values), context)) 502 ).generate(sink, std::make_tuple(values, keys, values, values), context))
503 return false; 503 return false;
504 } 504 }
@@ -716,8 +716,8 @@ struct property_wrapper_definition_generator
716 if (generated_values.size() == 1) 716 if (generated_values.size() == 1)
717 { 717 {
718 if (!as_generator( 718 if (!as_generator(
719 documentation(1) 719 documentation(2)
720 << scope_tab << scope << (is_static ? "static " : virtual_mod) << type(true) << " " << managed_name << " {\n" 720 << scope_tab(2) << scope << (is_static ? "static " : virtual_mod) << type(true) << " " << managed_name << " {\n"
721 ).generate(sink, std::make_tuple(property, generated_values[0].type), context)) 721 ).generate(sink, std::make_tuple(property, generated_values[0].type), context))
722 return false; 722 return false;
723 } 723 }
@@ -725,8 +725,8 @@ struct property_wrapper_definition_generator
725 { 725 {
726 if (!as_generator 726 if (!as_generator
727 ( 727 (
728 documentation(1) 728 documentation(2)
729 << scope_tab << scope << (is_static ? "static (" : "(") 729 << scope_tab(2) << scope << (is_static ? "static (" : "(")
730 << (attribute_reorder<1, -1>(type(true) /*<< " " << argument*/) % ", ") << ") " 730 << (attribute_reorder<1, -1>(type(true) /*<< " " << argument*/) % ", ") << ") "
731 << managed_name << " {\n" 731 << managed_name << " {\n"
732 ).generate(sink, std::make_tuple(property, generated_values), context)) 732 ).generate(sink, std::make_tuple(property, generated_values), context))
@@ -746,7 +746,7 @@ struct property_wrapper_definition_generator
746 generate_set (sink, property, context, set_scope, empty_keys, values, is_interface); 746 generate_set (sink, property, context, set_scope, empty_keys, values, is_interface);
747 } 747 }
748 748
749 if (!as_generator(scope_tab << "}\n\n").generate(sink, attributes::unused, context)) 749 if (!as_generator(scope_tab(2) << "}\n\n").generate(sink, attributes::unused, context))
750 return false; 750 return false;
751 751
752 return true; 752 return true;
@@ -783,9 +783,9 @@ struct interface_property_indexer_definition_generator
783 std::string managed_name = name_helpers::property_managed_name(property); 783 std::string managed_name = name_helpers::property_managed_name(property);
784 784
785 if (!as_generator 785 if (!as_generator
786 ("public interface " << name_helpers::property_interface_indexer_short_name(property, *implementing_klass) << "\n" 786 (scope_tab << "public interface " << name_helpers::property_interface_indexer_short_name(property, *implementing_klass) << "\n"
787 << "{\n" 787 << scope_tab << "{\n"
788 << "}\n" 788 << scope_tab << "}\n"
789 ).generate (sink, attributes::unused, context)) 789 ).generate (sink, attributes::unused, context))
790 return false; 790 return false;
791 791
diff --git a/src/bin/eolian_mono/eolian/mono/function_helpers.hh b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
index 4b9447f..a70df96 100644
--- a/src/bin/eolian_mono/eolian/mono/function_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_helpers.hh
@@ -117,7 +117,7 @@ struct function_definition_epilogue_generator
117 "Eina.Error.RaiseIfUnhandledException();\n" 117 "Eina.Error.RaiseIfUnhandledException();\n"
118 << *(convert_out_assign) 118 << *(convert_out_assign)
119 << *(convert_in_ptr_assign) 119 << *(convert_in_ptr_assign)
120 << scope_tab(2) << convert_return << "\n" 120 << scope_tab(3) << convert_return << "\n"
121 ).generate(sink, std::make_tuple(f.parameters, f.parameters, f.return_type), context)) 121 ).generate(sink, std::make_tuple(f.parameters, f.parameters, f.return_type), context))
122 return false; 122 return false;
123 123
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 3a93a2b..7fe60f0 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -110,21 +110,21 @@ struct klass
110 if (!as_generator(*(interface_property_indexer_definition(cls))).generate(sink, cls.properties, iface_cxt)) 110 if (!as_generator(*(interface_property_indexer_definition(cls))).generate(sink, cls.properties, iface_cxt))
111 return false; 111 return false;
112 112
113 if(!as_generator(documentation).generate(sink, cls, iface_cxt)) 113 if(!as_generator(documentation(1)).generate(sink, cls, iface_cxt))
114 return false; 114 return false;
115 115
116 // Mark the interface with the proper native Efl_Class* getter 116 // Mark the interface with the proper native Efl_Class* getter
117 if(!as_generator(lit("[") << name_helpers::klass_full_native_inherit_name(cls) << "]\n") 117 if(!as_generator(scope_tab << lit("[") << name_helpers::klass_full_native_inherit_name(cls) << "]\n")
118 .generate(sink, attributes::unused, iface_cxt)) 118 .generate(sink, attributes::unused, iface_cxt))
119 return false; 119 return false;
120 120
121 if(!as_generator("[Efl.Eo.BindingEntity]\n").generate(sink, attributes::unused, iface_cxt)) 121 if(!as_generator(scope_tab << "[Efl.Eo.BindingEntity]\n").generate(sink, attributes::unused, iface_cxt))
122 return false; 122 return false;
123 123
124 using efl::eolian::grammar::lit; 124 using efl::eolian::grammar::lit;
125 if(!as_generator 125 if(!as_generator
126 ( 126 (
127 lit("public ") << (is_partial ? "partial ":"") 127 scope_tab << lit("public ") << (is_partial ? "partial ":"")
128 /*<< class_type*/ << "interface" /*<<*/ " " << string << " : " 128 /*<< class_type*/ << "interface" /*<<*/ " " << string << " : "
129 ) 129 )
130 .generate(sink, name_helpers::klass_interface_name(cls), iface_cxt)) 130 .generate(sink, name_helpers::klass_interface_name(cls), iface_cxt))
@@ -140,10 +140,10 @@ struct klass
140 return false; 140 return false;
141 } 141 }
142 142
143 if(!as_generator("\n" << scope_tab << "Efl.Eo.IWrapper, IDisposable").generate(sink, attributes::unused, iface_cxt)) 143 if(!as_generator("\n" << scope_tab(2) << "Efl.Eo.IWrapper, IDisposable").generate(sink, attributes::unused, iface_cxt))
144 return false; 144 return false;
145 145
146 if(!as_generator("\n{\n").generate(sink, attributes::unused, iface_cxt)) 146 if(!as_generator("\n" << scope_tab << "{\n").generate(sink, attributes::unused, iface_cxt))
147 return false; 147 return false;
148 148
149 if(!as_generator(*(function_declaration)).generate(sink, cls.functions, iface_cxt)) 149 if(!as_generator(*(function_declaration)).generate(sink, cls.functions, iface_cxt))
@@ -157,7 +157,7 @@ struct klass
157 157
158 for (auto &&p : cls.parts) 158 for (auto &&p : cls.parts)
159 if (!as_generator( 159 if (!as_generator(
160 documentation(1) 160 documentation(2)
161 << name_helpers::klass_full_concrete_or_interface_name(p.klass) << " " << utils::capitalize(p.name) << "{ get;}\n" 161 << name_helpers::klass_full_concrete_or_interface_name(p.klass) << " " << utils::capitalize(p.name) << "{ get;}\n"
162 ).generate(sink, p, iface_cxt)) 162 ).generate(sink, p, iface_cxt))
163 return false; 163 return false;
@@ -166,7 +166,7 @@ struct klass
166 return false; 166 return false;
167 167
168 // End of interface declaration 168 // End of interface declaration
169 if(!as_generator("}\n\n").generate(sink, attributes::unused, iface_cxt)) return false; 169 if(!as_generator(scope_tab << "}\n\n").generate(sink, attributes::unused, iface_cxt)) return false;
170 } 170 }
171 171
172 // Events arguments go in the top namespace to avoid the Concrete suffix clutter in interface events. 172 // Events arguments go in the top namespace to avoid the Concrete suffix clutter in interface events.
@@ -204,12 +204,12 @@ struct klass
204 // other classes that implement the interface. 204 // other classes that implement the interface.
205 if(!as_generator 205 if(!as_generator
206 ( 206 (
207 documentation 207 documentation(1)
208 << "public sealed " << (is_partial ? "partial ":"") << "class " << concrete_name << " :\n" 208 << scope_tab << "public sealed " << (is_partial ? "partial ":"") << "class " << concrete_name << " :\n"
209 << scope_tab << (root ? "Efl.Eo.EoWrapper" : "") << (klass_full_concrete_or_interface_name % "") 209 << scope_tab(2) << (root ? "Efl.Eo.EoWrapper" : "") << (klass_full_concrete_or_interface_name % "")
210 << ",\n" << scope_tab << interface_name 210 << ",\n" << scope_tab(2) << interface_name
211 << *(",\n" << scope_tab << name_helpers::klass_full_concrete_or_interface_name) << "\n" 211 << *(",\n" << scope_tab(2) << name_helpers::klass_full_concrete_or_interface_name) << "\n"
212 << "{\n" 212 << scope_tab << "{\n"
213 ).generate(sink, std::make_tuple(cls, inherit_classes, inherit_interfaces), concrete_cxt)) 213 ).generate(sink, std::make_tuple(cls, inherit_classes, inherit_interfaces), concrete_cxt))
214 return false; 214 return false;
215 215
@@ -218,27 +218,27 @@ struct klass
218 218
219 if (!as_generator 219 if (!as_generator
220 ( 220 (
221 scope_tab << "/// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.\n" 221 scope_tab(2) << "/// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.\n"
222 << scope_tab << "/// Do not call this constructor directly.</summary>\n" 222 << scope_tab(2) << "/// Do not call this constructor directly.</summary>\n"
223 << scope_tab << "/// <param name=\"ch\">Tag struct storing the native handle of the object being constructed.</param>\n" 223 << scope_tab(2) << "/// <param name=\"ch\">Tag struct storing the native handle of the object being constructed.</param>\n"
224 << scope_tab << "private " << concrete_name << "(ConstructingHandle ch) : base(ch)\n" 224 << scope_tab(2) << "private " << concrete_name << "(ConstructingHandle ch) : base(ch)\n"
225 << scope_tab << "{\n" 225 << scope_tab(2) << "{\n"
226 << scope_tab << "}\n\n" 226 << scope_tab(2) << "}\n\n"
227 ) 227 )
228 .generate(sink, attributes::unused, concrete_cxt)) 228 .generate(sink, attributes::unused, concrete_cxt))
229 return false; 229 return false;
230 230
231 if (!as_generator 231 if (!as_generator
232 ( 232 (
233 scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(concrete_cxt).actual_library_name(cls.filename) 233 scope_tab(2) << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(concrete_cxt).actual_library_name(cls.filename)
234 << ")] internal static extern System.IntPtr\n" 234 << ")] internal static extern System.IntPtr\n"
235 << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n\n" 235 << scope_tab(2) << scope_tab << name_helpers::klass_get_name(cls) << "();\n\n"
236 << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << interface_name << "\"/> class.\n" 236 << scope_tab(2) << "/// <summary>Initializes a new instance of the <see cref=\"" << interface_name << "\"/> class.\n"
237 << scope_tab << "/// Internal usage: This is used when interacting with C code and should not be used directly.</summary>\n" 237 << scope_tab(2) << "/// Internal usage: This is used when interacting with C code and should not be used directly.</summary>\n"
238 << scope_tab << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n" 238 << scope_tab(2) << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n"
239 << scope_tab << "private " << concrete_name << "(Efl.Eo.WrappingHandle wh) : base(wh)\n" 239 << scope_tab(2) << "private " << concrete_name << "(Efl.Eo.WrappingHandle wh) : base(wh)\n"
240 << scope_tab << "{\n" 240 << scope_tab(2) << "{\n"
241 << scope_tab << "}\n\n" 241 << scope_tab(2) << "}\n\n"
242 ) 242 )
243 .generate(sink, attributes::unused, concrete_cxt)) 243 .generate(sink, attributes::unused, concrete_cxt))
244 return false; 244 return false;
@@ -278,17 +278,17 @@ struct klass
278 278
279 // Copied from nativeinherit class, used when setting up providers. 279 // Copied from nativeinherit class, used when setting up providers.
280 if(!as_generator( 280 if(!as_generator(
281 scope_tab << "private static IntPtr GetEflClassStatic()\n" 281 scope_tab(2) << "private static IntPtr GetEflClassStatic()\n"
282 << scope_tab << "{\n" 282 << scope_tab(2) << "{\n"
283 << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n" 283 << scope_tab(2) << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n"
284 << scope_tab << "}\n\n" 284 << scope_tab(2) << "}\n\n"
285 ).generate(sink, attributes::unused, concrete_cxt)) 285 ).generate(sink, attributes::unused, concrete_cxt))
286 return false; 286 return false;
287 287
288 if(!generate_native_inherit_class(sink, cls, change_indentation(indent.inc(), concrete_cxt))) 288 if(!generate_native_inherit_class(sink, cls, change_indentation(indent.inc(), concrete_cxt)))
289 return true; 289 return true;
290 290
291 if(!as_generator("}\n").generate(sink, attributes::unused, concrete_cxt)) return false; 291 if(!as_generator(scope_tab << "}\n").generate(sink, attributes::unused, concrete_cxt)) return false;
292 } 292 }
293 293
294 // Inheritable class 294 // Inheritable class
@@ -301,11 +301,11 @@ struct klass
301 // Class header 301 // Class header
302 if(!as_generator 302 if(!as_generator
303 ( 303 (
304 documentation 304 documentation(1)
305 << "[" << name_helpers::klass_full_native_inherit_name(cls) << "]\n" 305 << scope_tab << "[" << name_helpers::klass_full_native_inherit_name(cls) << "]\n"
306 << "[Efl.Eo.BindingEntity]\n" 306 << scope_tab << "[Efl.Eo.BindingEntity]\n"
307 << "[SuppressMessage(\"Microsoft.Naming\", \"CA1724:TypeNamesShouldNotMatchNamespaces\")]\n" 307 << scope_tab << "[SuppressMessage(\"Microsoft.Naming\", \"CA1724:TypeNamesShouldNotMatchNamespaces\")]\n"
308 << "public " 308 << scope_tab<< "public "
309 << (is_partial 309 << (is_partial
310 ? class_type == "class" 310 ? class_type == "class"
311 ? "partial class" 311 ? "partial class"
@@ -317,7 +317,7 @@ struct klass
317 << (root ? "Efl.Eo.EoWrapper" : "") // ... or root 317 << (root ? "Efl.Eo.EoWrapper" : "") // ... or root
318 << (inherit_interfaces.empty() ? "" : ", ") 318 << (inherit_interfaces.empty() ? "" : ", ")
319 << (klass_full_concrete_or_interface_name % ", ") // interfaces 319 << (klass_full_concrete_or_interface_name % ", ") // interfaces
320 << "\n{\n" 320 << "\n" << scope_tab << "{\n"
321 ) 321 )
322 .generate(sink, std::make_tuple(cls, inherit_classes, inherit_interfaces), inherit_cxt)) 322 .generate(sink, std::make_tuple(cls, inherit_classes, inherit_interfaces), inherit_cxt))
323 return false; 323 return false;
@@ -359,17 +359,17 @@ struct klass
359 359
360 // Copied from nativeinherit class, used when setting up providers. 360 // Copied from nativeinherit class, used when setting up providers.
361 if(!as_generator( 361 if(!as_generator(
362 scope_tab << "private static IntPtr GetEflClassStatic()\n" 362 scope_tab(2) << "private static IntPtr GetEflClassStatic()\n"
363 << scope_tab << "{\n" 363 << scope_tab(2) << "{\n"
364 << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n" 364 << scope_tab(2) << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n"
365 << scope_tab << "}\n\n" 365 << scope_tab(2) << "}\n\n"
366 ).generate(sink, attributes::unused, inherit_cxt)) 366 ).generate(sink, attributes::unused, inherit_cxt))
367 return false; 367 return false;
368 368
369 if(!generate_native_inherit_class(sink, cls, change_indentation(indent.inc(), inherit_cxt))) 369 if(!generate_native_inherit_class(sink, cls, change_indentation(indent.inc(), inherit_cxt)))
370 return true; 370 return true;
371 371
372 if(!as_generator("}\n").generate(sink, attributes::unused, inherit_cxt)) return false; 372 if(!as_generator(scope_tab << "}\n").generate(sink, attributes::unused, inherit_cxt)) return false;
373 } 373 }
374 374
375 375
@@ -403,10 +403,10 @@ struct klass
403 if(!as_generator 403 if(!as_generator
404 (lit("#if EFL_BETA\n") 404 (lit("#if EFL_BETA\n")
405 << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes 405 << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes
406 << "public static class " << name_helpers::klass_concrete_name(cls) 406 << scope_tab << "public static class " << name_helpers::klass_concrete_name(cls)
407 << "Extensions {\n" 407 << "Extensions {\n"
408 << extension_method_stream.str() 408 << extension_method_stream.str()
409 << "}\n" 409 << scope_tab << "}\n"
410 << "#pragma warning restore CS1591\n" 410 << "#pragma warning restore CS1591\n"
411 << "#endif\n") 411 << "#endif\n")
412 .generate(sink, cls.namespaces, context)) 412 .generate(sink, cls.namespaces, context))
@@ -431,7 +431,7 @@ struct klass
431 auto inherit_name = name_helpers::klass_inherit_name(cls); 431 auto inherit_name = name_helpers::klass_inherit_name(cls);
432 auto implementable_methods = helpers::get_all_registerable_methods(cls, context); 432 auto implementable_methods = helpers::get_all_registerable_methods(cls, context);
433 bool root = !helpers::has_regular_ancestor(cls); 433 bool root = !helpers::has_regular_ancestor(cls);
434 auto const& indent = current_indentation(inative_cxt); 434 auto const& indent = current_indentation(inative_cxt).inc();
435 std::string klass_since; 435 std::string klass_since;
436 436
437 if (!documentation_helpers::generate_since_tag_line(std::back_inserter(klass_since), cls.documentation, indent, context)) 437 if (!documentation_helpers::generate_since_tag_line(std::back_inserter(klass_since), cls.documentation, indent, context))
@@ -517,7 +517,7 @@ struct klass
517 return false; 517 return false;
518 518
519 if (!klass_since.empty()) 519 if (!klass_since.empty())
520 klass_since = static_cast<std::string>(scope_tab) + klass_since; 520 klass_since = static_cast<std::string>(scope_tab(2)) + klass_since;
521 521
522 // Attribute getter of the native 'Efl_Class *' handle (for proper inheritance from additional explicit interfaces) 522 // Attribute getter of the native 'Efl_Class *' handle (for proper inheritance from additional explicit interfaces)
523 if(!as_generator( 523 if(!as_generator(
@@ -539,7 +539,7 @@ struct klass
539 << indent << scope_tab << "#pragma warning restore CA1707, CS1591, SA1300, SA1600\n\n") 539 << indent << scope_tab << "#pragma warning restore CA1707, CS1591, SA1300, SA1600\n\n")
540 .generate(sink, implementable_methods, change_indentation(indent.inc(), inative_cxt))) return false; 540 .generate(sink, implementable_methods, change_indentation(indent.inc(), inative_cxt))) return false;
541 541
542 if(!as_generator("}\n").generate(sink, attributes::unused, inative_cxt)) return false; 542 if(!as_generator(indent << "}\n").generate(sink, attributes::unused, inative_cxt)) return false;
543 } 543 }
544 return true; 544 return true;
545 } 545 }
@@ -554,21 +554,21 @@ struct klass
554 auto inherit_name = name_helpers::klass_concrete_name(cls); 554 auto inherit_name = name_helpers::klass_concrete_name(cls);
555 555
556 if(!as_generator( 556 if(!as_generator(
557 scope_tab << "/// <summary>Pointer to the native class description.</summary>\n" 557 scope_tab(2) << "/// <summary>Pointer to the native class description.</summary>\n"
558 << scope_tab << "public override System.IntPtr NativeClass\n" 558 << scope_tab(2) << "public override System.IntPtr NativeClass\n"
559 << scope_tab << "{\n" 559 << scope_tab(2) << "{\n"
560 << scope_tab << scope_tab << "get\n" 560 << scope_tab(2) << scope_tab << "get\n"
561 << scope_tab << scope_tab << "{\n" 561 << scope_tab(2) << scope_tab << "{\n"
562 << scope_tab << scope_tab << scope_tab << "if (((object)this).GetType() == typeof(" << inherit_name << "))\n" 562 << scope_tab(2) << scope_tab << scope_tab << "if (((object)this).GetType() == typeof(" << inherit_name << "))\n"
563 << scope_tab << scope_tab << scope_tab << "{\n" 563 << scope_tab(2) << scope_tab << scope_tab << "{\n"
564 << scope_tab << scope_tab << scope_tab << scope_tab << "return GetEflClassStatic();\n" 564 << scope_tab(2) << scope_tab << scope_tab << scope_tab << "return GetEflClassStatic();\n"
565 << scope_tab << scope_tab << scope_tab << "}\n" 565 << scope_tab(2) << scope_tab << scope_tab << "}\n"
566 << scope_tab << scope_tab << scope_tab << "else\n" 566 << scope_tab(2) << scope_tab << scope_tab << "else\n"
567 << scope_tab << scope_tab << scope_tab << "{\n" 567 << scope_tab(2) << scope_tab << scope_tab << "{\n"
568 << scope_tab << scope_tab << scope_tab << scope_tab << "return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];\n" 568 << scope_tab(2) << scope_tab << scope_tab << scope_tab << "return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];\n"
569 << scope_tab << scope_tab << scope_tab << "}\n" 569 << scope_tab(2) << scope_tab << scope_tab << "}\n"
570 << scope_tab << scope_tab << "}\n" 570 << scope_tab(2) << scope_tab << "}\n"
571 << scope_tab << "}\n\n" 571 << scope_tab(2) << "}\n\n"
572 ).generate(sink, attributes::unused, context)) 572 ).generate(sink, attributes::unused, context))
573 return false; 573 return false;
574 574
@@ -581,9 +581,9 @@ struct klass
581 auto inherit_name = name_helpers::klass_concrete_name(cls); 581 auto inherit_name = name_helpers::klass_concrete_name(cls);
582 582
583 if(!as_generator( 583 if(!as_generator(
584 scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(cls.filename) 584 scope_tab(2) << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(cls.filename)
585 << ")] internal static extern System.IntPtr\n" 585 << ")] internal static extern System.IntPtr\n"
586 << scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n\n" 586 << scope_tab(2) << scope_tab << name_helpers::klass_get_name(cls) << "();\n\n"
587 ).generate(sink, attributes::unused, context)) 587 ).generate(sink, attributes::unused, context))
588 return false; 588 return false;
589 589
@@ -595,40 +595,40 @@ struct klass
595 }); 595 });
596 596
597 std::string klass_since; 597 std::string klass_since;
598 if (!documentation_helpers::generate_since_tag_line(std::back_inserter(klass_since), cls.documentation, scope_tab, context)) 598 if (!documentation_helpers::generate_since_tag_line(std::back_inserter(klass_since), cls.documentation, scope_tab(2), context))
599 return false; 599 return false;
600 600
601 // Public (API) constructors 601 // Public (API) constructors
602 if (!as_generator( 602 if (!as_generator(
603 scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n" 603 scope_tab(2) << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
604 << klass_since 604 << klass_since
605 << scope_tab << "/// </summary>\n" 605 << scope_tab(2) << "/// </summary>\n"
606 << scope_tab << "/// <param name=\"parent\">Parent instance.</param>\n" 606 << scope_tab(2) << "/// <param name=\"parent\">Parent instance.</param>\n"
607 << *(documentation) 607 << *(documentation(1))
608 // For constructors with arguments, the parent is also required, as optional parameters can't come before non-optional paramenters. 608 // For constructors with arguments, the parent is also required, as optional parameters can't come before non-optional paramenters.
609 << scope_tab << "public " << inherit_name << "(Efl.Object parent" << ((constructors.size() > 0) ? "" : "= null") 609 << scope_tab(2) << "public " << inherit_name << "(Efl.Object parent" << ((constructors.size() > 0) ? "" : "= null")
610 << *(", " << constructor_param ) << ") : " 610 << *(", " << constructor_param ) << ") : "
611 << "base(" << name_helpers::klass_get_name(cls) << "(), parent)\n" 611 << "base(" << name_helpers::klass_get_name(cls) << "(), parent)\n"
612 << scope_tab << "{\n" 612 << scope_tab(2) << "{\n"
613 << (*(scope_tab << scope_tab << constructor_invocation << "\n")) 613 << (*(scope_tab << scope_tab << constructor_invocation << "\n"))
614 << scope_tab << scope_tab << "FinishInstantiation();\n" 614 << scope_tab(2) << scope_tab << "FinishInstantiation();\n"
615 << scope_tab << "}\n\n" 615 << scope_tab(2) << "}\n\n"
616 << scope_tab << "/// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.\n" 616 << scope_tab(2) << "/// <summary>Subclasses should override this constructor if they are expected to be instantiated from native code.\n"
617 << scope_tab << "/// Do not call this constructor directly.\n" 617 << scope_tab(2) << "/// Do not call this constructor directly.\n"
618 << klass_since 618 << klass_since
619 << scope_tab << "/// </summary>\n" 619 << scope_tab(2) << "/// </summary>\n"
620 << scope_tab << "/// <param name=\"ch\">Tag struct storing the native handle of the object being constructed.</param>\n" 620 << scope_tab(2) << "/// <param name=\"ch\">Tag struct storing the native handle of the object being constructed.</param>\n"
621 << scope_tab << "protected " << inherit_name << "(ConstructingHandle ch) : base(ch)\n" 621 << scope_tab(2) << "protected " << inherit_name << "(ConstructingHandle ch) : base(ch)\n"
622 << scope_tab << "{\n" 622 << scope_tab(2) << "{\n"
623 << scope_tab << "}\n\n" 623 << scope_tab(2) << "}\n\n"
624 << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n" 624 << scope_tab(2) << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
625 << scope_tab << "/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.\n" 625 << scope_tab(2) << "/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.\n"
626 << klass_since 626 << klass_since
627 << scope_tab << "/// </summary>\n" 627 << scope_tab(2) << "/// </summary>\n"
628 << scope_tab << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n" 628 << scope_tab(2) << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n"
629 << scope_tab << "internal " << inherit_name << "(Efl.Eo.WrappingHandle wh) : base(wh)\n" 629 << scope_tab(2) << "internal " << inherit_name << "(Efl.Eo.WrappingHandle wh) : base(wh)\n"
630 << scope_tab << "{\n" 630 << scope_tab(2) << "{\n"
631 << scope_tab << "}\n\n" 631 << scope_tab(2) << "}\n\n"
632 ).generate(sink, std::make_tuple(constructors, constructors, constructors), context)) 632 ).generate(sink, std::make_tuple(constructors, constructors, constructors), context))
633 return false; 633 return false;
634 634
@@ -638,27 +638,27 @@ struct klass
638 if (cls.type == attributes::class_type::abstract_) 638 if (cls.type == attributes::class_type::abstract_)
639 { 639 {
640 if (!as_generator( 640 if (!as_generator(
641 scope_tab << "[Efl.Eo.PrivateNativeClass]\n" 641 scope_tab(2) << "[Efl.Eo.PrivateNativeClass]\n"
642 << scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n" 642 << scope_tab(2) << "private class " << inherit_name << "Realized : " << inherit_name << "\n"
643 << scope_tab << "{\n" 643 << scope_tab(2) << "{\n"
644 << scope_tab << scope_tab << "private " << inherit_name << "Realized(Efl.Eo.WrappingHandle wh) : base(wh)\n" 644 << scope_tab(2) << scope_tab << "private " << inherit_name << "Realized(Efl.Eo.WrappingHandle wh) : base(wh)\n"
645 << scope_tab << scope_tab << "{\n" 645 << scope_tab(2) << scope_tab << "{\n"
646 << scope_tab << scope_tab << "}\n" 646 << scope_tab(2) << scope_tab << "}\n"
647 << scope_tab << "}\n" 647 << scope_tab(2) << "}\n"
648 ).generate(sink, attributes::unused, context)) 648 ).generate(sink, attributes::unused, context))
649 return false; 649 return false;
650 } 650 }
651 651
652 return as_generator( 652 return as_generator(
653 scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n" 653 scope_tab(2) << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
654 << scope_tab << "/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.\n" 654 << scope_tab(2) << "/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.\n"
655 << klass_since 655 << klass_since
656 << scope_tab << "/// </summary>\n" 656 << scope_tab(2) << "/// </summary>\n"
657 << scope_tab << "/// <param name=\"baseKlass\">The pointer to the base native Eo class.</param>\n" 657 << scope_tab(2) << "/// <param name=\"baseKlass\">The pointer to the base native Eo class.</param>\n"
658 << scope_tab << "/// <param name=\"parent\">The Efl.Object parent of this instance.</param>\n" 658 << scope_tab(2) << "/// <param name=\"parent\">The Efl.Object parent of this instance.</param>\n"
659 << scope_tab << "protected " << inherit_name << "(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)\n" 659 << scope_tab(2) << "protected " << inherit_name << "(IntPtr baseKlass, Efl.Object parent) : base(baseKlass, parent)\n"
660 << scope_tab << "{\n" 660 << scope_tab(2) << "{\n"
661 << scope_tab << "}\n\n" 661 << scope_tab(2) << "}\n\n"
662 ).generate(sink, attributes::unused, context); 662 ).generate(sink, attributes::unused, context);
663 } 663 }
664 664
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index 5e6246d..91b29af 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -1612,11 +1612,11 @@ struct constructor_invocation_generator
1612 { 1612 {
1613 auto params = ctor.function.parameters; 1613 auto params = ctor.function.parameters;
1614 if (!as_generator( 1614 if (!as_generator(
1615 "if (" << 1615 scope_tab << "if (" <<
1616 (efl::eolian::grammar::attribute_reorder<-1> 1616 (efl::eolian::grammar::attribute_reorder<-1>
1617 ("Efl.Eo.Globals.ParamHelperCheck(" << constructor_parameter_name(ctor) << ")") % " || ") << ")\n" 1617 ("Efl.Eo.Globals.ParamHelperCheck(" << constructor_parameter_name(ctor) << ")") % " || ") << ")\n"
1618 << scope_tab << scope_tab << "{\n" 1618 << scope_tab(2) << scope_tab << "{\n"
1619 << scope_tab << scope_tab << scope_tab << name_helpers::managed_method_name(ctor.function) << "(" 1619 << scope_tab(2) << scope_tab << scope_tab << name_helpers::managed_method_name(ctor.function) << "("
1620 ).generate(sink, params, context)) 1620 ).generate(sink, params, context))
1621 return false; 1621 return false;
1622 1622
@@ -1633,7 +1633,7 @@ struct constructor_invocation_generator
1633 1633
1634 if (!as_generator( 1634 if (!as_generator(
1635 ");\n" 1635 ");\n"
1636 << scope_tab << scope_tab << "}\n").generate(sink, attributes::unused, context)) 1636 << scope_tab(2) << scope_tab << "}\n").generate(sink, attributes::unused, context))
1637 return false; 1637 return false;
1638 return true; 1638 return true;
1639 } 1639 }
diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh
index 0b8dece..4facf27 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -37,14 +37,14 @@ struct part_definition_generator
37 return true; 37 return true;
38 38
39 auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass); 39 auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass);
40 return as_generator(documentation(1) 40 return as_generator(documentation(2)
41 << scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n" 41 << scope_tab(2) << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n"
42 << scope_tab << "{\n" 42 << scope_tab(2) << "{\n"
43 << scope_tab << scope_tab << "get\n" 43 << scope_tab(2) << scope_tab << "get\n"
44 << scope_tab << scope_tab << "{\n" 44 << scope_tab(2) << scope_tab << "{\n"
45 << scope_tab << scope_tab << scope_tab << "return GetPart(\"" << part.name << "\") as " << part_klass_name << ";\n" 45 << scope_tab(2) << scope_tab << scope_tab << "return GetPart(\"" << part.name << "\") as " << part_klass_name << ";\n"
46 << scope_tab << scope_tab << "}\n" 46 << scope_tab(2) << scope_tab << "}\n"
47 << scope_tab << "}\n" 47 << scope_tab(2) << "}\n"
48 ).generate(sink, part.documentation, context); 48 ).generate(sink, part.documentation, context);
49 } 49 }
50 50
@@ -70,12 +70,12 @@ struct part_extension_method_definition_generator
70 bindableClass = "Efl.BindableFactoryPart"; 70 bindableClass = "Efl.BindableFactoryPart";
71 71
72 if (!as_generator( 72 if (!as_generator(
73 scope_tab << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<" 73 scope_tab(2) << "public static " << bindableClass << "<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "<T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag<"
74 << name_helpers::klass_full_concrete_or_interface_name(cls) 74 << name_helpers::klass_full_concrete_or_interface_name(cls)
75 << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n" 75 << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n"
76 << scope_tab << "{\n" 76 << scope_tab(2) << "{\n"
77 << scope_tab << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\", fac);\n" 77 << scope_tab(2) << scope_tab << "return new " << bindableClass << "<" << part_klass_name << ">(\"" << part.name << "\", fac);\n"
78 << scope_tab << "}\n\n" 78 << scope_tab(2) << "}\n\n"
79 ).generate(sink, attributes::unused, context)) 79 ).generate(sink, attributes::unused, context))
80 return false; 80 return false;
81 81
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 7a3019e..24d0ff3 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -296,7 +296,7 @@ struct struct_internal_definition_generator
296 auto const& indent = current_indentation(context); 296 auto const& indent = current_indentation(context);
297 if (!as_generator 297 if (!as_generator
298 ( 298 (
299 indent << "#pragma warning disable CS1591\n\n" 299 "#pragma warning disable CS1591\n\n"
300 << indent << "/// <summary>Internal wrapper for struct " << string << ".</summary>\n" 300 << indent << "/// <summary>Internal wrapper for struct " << string << ".</summary>\n"
301 << indent << "[StructLayout(LayoutKind.Sequential)]\n" 301 << indent << "[StructLayout(LayoutKind.Sequential)]\n"
302 << indent << "internal struct " << string << "\n" 302 << indent << "internal struct " << string << "\n"
@@ -398,7 +398,7 @@ struct struct_internal_definition_generator
398 398
399 // close internal class 399 // close internal class
400 if(!as_generator(indent << "}\n" 400 if(!as_generator(indent << "}\n"
401 << indent << "#pragma warning restore CS1591\n" 401 << "#pragma warning restore CS1591\n"
402 ).generate(sink, attributes::unused, context)) return false; 402 ).generate(sink, attributes::unused, context)) return false;
403 403
404 return true; 404 return true;
@@ -426,7 +426,7 @@ struct struct_definition_generator
426 return true; 426 return true;
427 427
428 auto struct_name = binding_struct_name(struct_); 428 auto struct_name = binding_struct_name(struct_);
429 auto const& indent = current_indentation(context); 429 auto const& indent = current_indentation(context).inc();
430 430
431 if (!as_generator( 431 if (!as_generator(
432 indent << scope_tab << "/// <summary>Packs tuple into " << struct_name << " object.\n" 432 indent << scope_tab << "/// <summary>Packs tuple into " << struct_name << " object.\n"
@@ -472,7 +472,7 @@ struct struct_definition_generator
472 template <typename OutputIterator, typename Context> 472 template <typename OutputIterator, typename Context>
473 bool generate_deconstruct_method(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 473 bool generate_deconstruct_method(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
474 { 474 {
475 auto const& indent = current_indentation(context); 475 auto const& indent = current_indentation(context).inc();
476 auto struct_name = binding_struct_name(struct_); 476 auto struct_name = binding_struct_name(struct_);
477 477
478 if (!as_generator( 478 if (!as_generator(
@@ -528,15 +528,15 @@ struct struct_definition_generator
528 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 528 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
529 { 529 {
530 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "struct_definition_generator: " << struct_.cxx_name << std::endl; 530 EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "struct_definition_generator: " << struct_.cxx_name << std::endl;
531 auto const& indent = current_indentation(context); 531 auto const& indent = current_indentation(context).inc();
532 if(!as_generator(documentation).generate(sink, struct_, context)) 532 if(!as_generator(documentation(1)).generate(sink, struct_, context))
533 return false; 533 return false;
534 auto struct_managed_name = binding_struct_name(struct_); 534 auto struct_managed_name = binding_struct_name(struct_);
535 if(!as_generator 535 if(!as_generator
536 ( 536 (
537 indent << "[StructLayout(LayoutKind.Sequential)]\n" 537 indent << "[StructLayout(LayoutKind.Sequential)]\n"
538 << indent << "[Efl.Eo.BindingEntity]\n" 538 << indent << "[Efl.Eo.BindingEntity]\n"
539 << "[SuppressMessage(\"Microsoft.Naming\", \"CA1724:TypeNamesShouldNotMatchNamespaces\")]\n" 539 << indent << "[SuppressMessage(\"Microsoft.Naming\", \"CA1724:TypeNamesShouldNotMatchNamespaces\")]\n"
540 << indent << "public struct " << struct_managed_name << " : IEquatable<" << struct_managed_name << ">\n" 540 << indent << "public struct " << struct_managed_name << " : IEquatable<" << struct_managed_name << ">\n"
541 << indent << "{\n" 541 << indent << "{\n"
542 ) 542 )