summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno da Silva Belo <bruno.belo@expertisesolutions.com.br>2019-11-04 14:40:18 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-11-04 14:53:54 -0300
commit0e6e9838089ec09321f948f6c46826bd444664e9 (patch)
tree9026ad6db3abcb686ff11d7953855f1f6613d708
parent0e71e0e286d97c4aaee76f1c079e2f00fc616cbf (diff)
csharp: Changing visibility of nested class/struct
Reviewers: felipealmeida, lauromoura, YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8393 Differential Revision: https://phab.enlightenment.org/D10588
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh6
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh2
-rw-r--r--src/bindings/mono/eina_mono/eina_log.cs4
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_common.cs34
-rw-r--r--src/bindings/mono/eo_mono/EoWrapper.cs4
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs28
-rw-r--r--src/tests/efl_mono/Model.cs4
7 files changed, 42 insertions, 40 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 1697ace234..f2c2c5ab7d 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -232,7 +232,7 @@ struct klass
232 << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << interface_name << "\"/> class.\n" 232 << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << interface_name << "\"/> class.\n"
233 << scope_tab << "/// Internal usage: This is used when interacting with C code and should not be used directly.</summary>\n" 233 << scope_tab << "/// Internal usage: This is used when interacting with C code and should not be used directly.</summary>\n"
234 << scope_tab << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n" 234 << scope_tab << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n"
235 << scope_tab << "private " << concrete_name << "(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" 235 << scope_tab << "private " << concrete_name << "(Efl.Eo.WrappingHandle wh) : base(wh)\n"
236 << scope_tab << "{\n" 236 << scope_tab << "{\n"
237 << scope_tab << "}\n\n" 237 << scope_tab << "}\n\n"
238 ) 238 )
@@ -580,7 +580,7 @@ struct klass
580 << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n" 580 << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
581 << 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.</summary>\n" 581 << 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.</summary>\n"
582 << scope_tab << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n" 582 << scope_tab << "/// <param name=\"wh\">The native pointer to be wrapped.</param>\n"
583 << scope_tab << "protected " << inherit_name << "(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" 583 << scope_tab << "internal " << inherit_name << "(Efl.Eo.WrappingHandle wh) : base(wh)\n"
584 << scope_tab << "{\n" 584 << scope_tab << "{\n"
585 << scope_tab << "}\n\n" 585 << scope_tab << "}\n\n"
586 ).generate(sink, std::make_tuple(constructors, constructors, constructors), context)) 586 ).generate(sink, std::make_tuple(constructors, constructors, constructors), context))
@@ -595,7 +595,7 @@ struct klass
595 scope_tab << "[Efl.Eo.PrivateNativeClass]\n" 595 scope_tab << "[Efl.Eo.PrivateNativeClass]\n"
596 << scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n" 596 << scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n"
597 << scope_tab << "{\n" 597 << scope_tab << "{\n"
598 << scope_tab << scope_tab << "private " << inherit_name << "Realized(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n" 598 << scope_tab << scope_tab << "private " << inherit_name << "Realized(Efl.Eo.WrappingHandle wh) : base(wh)\n"
599 << scope_tab << scope_tab << "{\n" 599 << scope_tab << scope_tab << "{\n"
600 << scope_tab << scope_tab << "}\n" 600 << scope_tab << scope_tab << "}\n"
601 << scope_tab << "}\n" 601 << 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 45c1747650..c733432465 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -291,7 +291,7 @@ struct struct_internal_definition_generator
291 indent << "#pragma warning disable CS1591\n\n" 291 indent << "#pragma warning disable CS1591\n\n"
292 << indent << "/// <summary>Internal wrapper for struct " << string << ".</summary>\n" 292 << indent << "/// <summary>Internal wrapper for struct " << string << ".</summary>\n"
293 << indent << "[StructLayout(LayoutKind.Sequential)]\n" 293 << indent << "[StructLayout(LayoutKind.Sequential)]\n"
294 << indent << "public struct " << string << "\n" 294 << indent << "internal struct " << string << "\n"
295 << indent << "{\n" 295 << indent << "{\n"
296 ) 296 )
297 .generate(sink, std::make_tuple<>(binding_struct_name(struct_), struct_internal_decl_name()), context)) 297 .generate(sink, std::make_tuple<>(binding_struct_name(struct_), struct_internal_decl_name()), context))
diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs
index 60e805412c..2174c65c20 100644
--- a/src/bindings/mono/eina_mono/eina_log.cs
+++ b/src/bindings/mono/eina_mono/eina_log.cs
@@ -79,7 +79,7 @@ public static class Log
79 /// <summary>The colors to be used by the logging system. 79 /// <summary>The colors to be used by the logging system.
80 /// <para>Since EFL 1.23.</para> 80 /// <para>Since EFL 1.23.</para>
81 /// </summary> 81 /// </summary>
82 public static class Color 82 internal static class Color
83 { 83 {
84 /// <summary>Light red 84 /// <summary>Light red
85 /// <para>Since EFL 1.23.</para> 85 /// <para>Since EFL 1.23.</para>
@@ -139,7 +139,7 @@ public static class Log
139 static Log() 139 static Log()
140 { 140 {
141 const String name = "mono"; 141 const String name = "mono";
142 const String color = "\033[32;1m"; 142 const String color = Color.GREEN;
143 143
144 // Maybe move this check outside when other eina stuff get support? 144 // Maybe move this check outside when other eina stuff get support?
145 domain = eina_log_domain_register(name, color); 145 domain = eina_log_domain_register(name, color);
diff --git a/src/bindings/mono/eldbus_mono/eldbus_common.cs b/src/bindings/mono/eldbus_mono/eldbus_common.cs
index eeff8654ca..562f61a4e3 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_common.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_common.cs
@@ -178,7 +178,7 @@ public static class Argument
178 /// The type of a byte. 178 /// The type of a byte.
179 /// <para>Since EFL 1.23.</para> 179 /// <para>Since EFL 1.23.</para>
180 /// </summary> 180 /// </summary>
181 public static class ByteType 181 internal static class ByteType
182 { 182 {
183 /// <summary> 183 /// <summary>
184 /// The code of the byte. 184 /// The code of the byte.
@@ -196,7 +196,7 @@ public static class Argument
196 /// The type of a boolean 196 /// The type of a boolean
197 /// <para>Since EFL 1.23.</para> 197 /// <para>Since EFL 1.23.</para>
198 /// </summary> 198 /// </summary>
199 public static class BooleanType 199 internal static class BooleanType
200 { 200 {
201 /// <summary> 201 /// <summary>
202 /// The code of the boolean. 202 /// The code of the boolean.
@@ -214,7 +214,7 @@ public static class Argument
214 /// The type of a Int16. 214 /// The type of a Int16.
215 /// <para>Since EFL 1.23.</para> 215 /// <para>Since EFL 1.23.</para>
216 /// </summary> 216 /// </summary>
217 public static class Int16Type 217 internal static class Int16Type
218 { 218 {
219 /// <summary> 219 /// <summary>
220 /// The code of the Int16. 220 /// The code of the Int16.
@@ -232,7 +232,7 @@ public static class Argument
232 /// The type of an unsigned Int16. 232 /// The type of an unsigned Int16.
233 /// <para>Since EFL 1.23.</para> 233 /// <para>Since EFL 1.23.</para>
234 /// </summary> 234 /// </summary>
235 public static class UInt16Type 235 internal static class UInt16Type
236 { 236 {
237 /// <summary> 237 /// <summary>
238 /// The code of the unsigned Int16. 238 /// The code of the unsigned Int16.
@@ -250,7 +250,7 @@ public static class Argument
250 /// The type of a Int32. 250 /// The type of a Int32.
251 /// <para>Since EFL 1.23.</para> 251 /// <para>Since EFL 1.23.</para>
252 /// </summary> 252 /// </summary>
253 public static class Int32Type 253 internal static class Int32Type
254 { 254 {
255 /// <summary> 255 /// <summary>
256 /// The code of the Int32. 256 /// The code of the Int32.
@@ -268,7 +268,7 @@ public static class Argument
268 /// The type of an unsigned Int32. 268 /// The type of an unsigned Int32.
269 /// <para>Since EFL 1.23.</para> 269 /// <para>Since EFL 1.23.</para>
270 /// </summary> 270 /// </summary>
271 public static class UInt32Type 271 internal static class UInt32Type
272 { 272 {
273 /// <summary> 273 /// <summary>
274 /// The code of the unsigned Int32. 274 /// The code of the unsigned Int32.
@@ -286,7 +286,7 @@ public static class Argument
286 /// The type of a Int64. 286 /// The type of a Int64.
287 /// <para>Since EFL 1.23.</para> 287 /// <para>Since EFL 1.23.</para>
288 /// </summary> 288 /// </summary>
289 public static class Int64Type 289 internal static class Int64Type
290 { 290 {
291 /// <summary> 291 /// <summary>
292 /// The code of the Int64. 292 /// The code of the Int64.
@@ -304,7 +304,7 @@ public static class Argument
304 /// The type of an unsigned Int64. 304 /// The type of an unsigned Int64.
305 /// <para>Since EFL 1.23.</para> 305 /// <para>Since EFL 1.23.</para>
306 /// </summary> 306 /// </summary>
307 public static class UInt64Type 307 internal static class UInt64Type
308 { 308 {
309 /// <summary> 309 /// <summary>
310 /// The code of the unsigned Int64. 310 /// The code of the unsigned Int64.
@@ -322,7 +322,7 @@ public static class Argument
322 /// The type of the double. 322 /// The type of the double.
323 /// <para>Since EFL 1.23.</para> 323 /// <para>Since EFL 1.23.</para>
324 /// </summary> 324 /// </summary>
325 public static class DoubleType 325 internal static class DoubleType
326 { 326 {
327 /// <summary> 327 /// <summary>
328 /// The code of the double. 328 /// The code of the double.
@@ -340,7 +340,7 @@ public static class Argument
340 /// The type of a string. 340 /// The type of a string.
341 /// <para>Since EFL 1.23.</para> 341 /// <para>Since EFL 1.23.</para>
342 /// </summary> 342 /// </summary>
343 public static class StringType 343 internal static class StringType
344 { 344 {
345 /// <summary> 345 /// <summary>
346 /// The code of the string. 346 /// The code of the string.
@@ -358,7 +358,7 @@ public static class Argument
358 /// The type of an object path. 358 /// The type of an object path.
359 /// <para>Since EFL 1.23.</para> 359 /// <para>Since EFL 1.23.</para>
360 /// </summary> 360 /// </summary>
361 public static class ObjectPathType 361 internal static class ObjectPathType
362 { 362 {
363 /// <summary> 363 /// <summary>
364 /// The code of the object path. 364 /// The code of the object path.
@@ -376,7 +376,7 @@ public static class Argument
376 /// The type of a signature. 376 /// The type of a signature.
377 /// <para>Since EFL 1.23.</para> 377 /// <para>Since EFL 1.23.</para>
378 /// </summary> 378 /// </summary>
379 public static class SignatureType 379 internal static class SignatureType
380 { 380 {
381 /// <summary> 381 /// <summary>
382 /// The code of the signature. 382 /// The code of the signature.
@@ -394,7 +394,7 @@ public static class Argument
394 /// The type of a array. 394 /// The type of a array.
395 /// <para>Since EFL 1.23.</para> 395 /// <para>Since EFL 1.23.</para>
396 /// </summary> 396 /// </summary>
397 public static class ArrayType 397 internal static class ArrayType
398 { 398 {
399 /// <summary> 399 /// <summary>
400 /// The code of the array. 400 /// The code of the array.
@@ -412,7 +412,7 @@ public static class Argument
412 /// The type of a struct. 412 /// The type of a struct.
413 /// <para>Since EFL 1.23.</para> 413 /// <para>Since EFL 1.23.</para>
414 /// </summary> 414 /// </summary>
415 public static class StructType 415 internal static class StructType
416 { 416 {
417 /// <summary> 417 /// <summary>
418 /// The code of the struct. 418 /// The code of the struct.
@@ -430,7 +430,7 @@ public static class Argument
430 /// The type of a variant. 430 /// The type of a variant.
431 /// <para>Since EFL 1.23.</para> 431 /// <para>Since EFL 1.23.</para>
432 /// </summary> 432 /// </summary>
433 public static class VariantType 433 internal static class VariantType
434 { 434 {
435 /// <summary> 435 /// <summary>
436 /// The code of the variant. 436 /// The code of the variant.
@@ -448,7 +448,7 @@ public static class Argument
448 /// The type of a dictionary. 448 /// The type of a dictionary.
449 /// <para>Since EFL 1.23.</para> 449 /// <para>Since EFL 1.23.</para>
450 /// </summary> 450 /// </summary>
451 public static class DictEntryType 451 internal static class DictEntryType
452 { 452 {
453 /// <summary> 453 /// <summary>
454 /// The code of the dictionary. 454 /// The code of the dictionary.
@@ -466,7 +466,7 @@ public static class Argument
466 /// The type of an unix file descriptor. 466 /// The type of an unix file descriptor.
467 /// <para>Since EFL 1.23.</para> 467 /// <para>Since EFL 1.23.</para>
468 /// </summary> 468 /// </summary>
469 public static class UnixFdType 469 internal static class UnixFdType
470 { 470 {
471 /// <summary> 471 /// <summary>
472 /// The code of unix fd. 472 /// The code of unix fd.
diff --git a/src/bindings/mono/eo_mono/EoWrapper.cs b/src/bindings/mono/eo_mono/EoWrapper.cs
index d49a5b5b42..621a8bca68 100644
--- a/src/bindings/mono/eo_mono/EoWrapper.cs
+++ b/src/bindings/mono/eo_mono/EoWrapper.cs
@@ -81,7 +81,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
81 /// <para>Since EFL 1.23.</para> 81 /// <para>Since EFL 1.23.</para>
82 /// </summary> 82 /// </summary>
83 /// <param name="wh">The native pointer to be wrapped.</param> 83 /// <param name="wh">The native pointer to be wrapped.</param>
84 protected EoWrapper(Efl.Eo.Globals.WrappingHandle wh) 84 internal EoWrapper(Efl.Eo.WrappingHandle wh)
85 { 85 {
86 handle = wh.NativeHandle; 86 handle = wh.NativeHandle;
87 AddWrapperSupervisor(); 87 AddWrapperSupervisor();
@@ -485,7 +485,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
485/// But as <see cref="Efl.Object" /> is abstract, whis realized class will allow us to create C# instances of it.</summary> 485/// But as <see cref="Efl.Object" /> is abstract, whis realized class will allow us to create C# instances of it.</summary>
486internal class ObjectRealized : Efl.Object 486internal class ObjectRealized : Efl.Object
487{ 487{
488 protected ObjectRealized(Efl.Eo.Globals.WrappingHandle ch) : base(ch) { } 488 internal ObjectRealized(Efl.Eo.WrappingHandle ch) : base(ch) { }
489} 489}
490 490
491} // namespace Efl 491} // namespace Efl
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index f886167f31..4e3e2e4486 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -759,23 +759,25 @@ public static class Globals
759 Monitor.Exit(Efl.All.InitLock); 759 Monitor.Exit(Efl.All.InitLock);
760 } 760 }
761 761
762 /// <summary>
763 /// Internal struct used by the binding to pass the native handle pointer
764 /// to the managed object wrapping constructor.
765 /// Internal usage only: do not use this class in inherited classes.
766 /// </summary>
767 public struct WrappingHandle
768 {
769 public WrappingHandle(IntPtr h)
770 {
771 NativeHandle = h;
772 }
773 762
774 public IntPtr NativeHandle { get; private set; }
775 }
776 763
777} // Globals 764} // Globals
778 765
766/// <summary>
767/// Internal struct used by the binding to pass the native handle pointer
768/// to the managed object wrapping constructor.
769/// Internal usage only: do not use this class in inherited classes.
770/// </summary>
771internal struct WrappingHandle
772{
773 public WrappingHandle(IntPtr h)
774 {
775 NativeHandle = h;
776 }
777
778 public IntPtr NativeHandle { get; private set; }
779}
780
779public static class Config 781public static class Config
780{ 782{
781 783
diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs
index 63d28d408f..144318b8a1 100644
--- a/src/tests/efl_mono/Model.cs
+++ b/src/tests/efl_mono/Model.cs
@@ -9,9 +9,9 @@ using System.Diagnostics.CodeAnalysis;
9namespace TestSuite { 9namespace TestSuite {
10 10
11[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")] 11[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
12public class TestModel { 12public static class TestModel {
13 13
14 public class VeggieViewModel 14 private class VeggieViewModel
15 { 15 {
16 public string Name { get; set; } 16 public string Name { get; set; }
17 public string Type { get; set; } 17 public string Type { get; set; }