lauromoura pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0e6e9838089ec09321f948f6c46826bd444664e9

commit 0e6e9838089ec09321f948f6c46826bd444664e9
Author: Bruno da Silva Belo <bruno.b...@expertisesolutions.com.br>
Date:   Mon Nov 4 14:40:18 2019 -0300

    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
---
 src/bin/eolian_mono/eolian/mono/klass.hh           |  6 ++--
 .../eolian_mono/eolian/mono/struct_definition.hh   |  2 +-
 src/bindings/mono/eina_mono/eina_log.cs            |  4 +--
 src/bindings/mono/eldbus_mono/eldbus_common.cs     | 34 +++++++++++-----------
 src/bindings/mono/eo_mono/EoWrapper.cs             |  4 +--
 src/bindings/mono/eo_mono/iwrapper.cs              | 28 +++++++++---------
 src/tests/efl_mono/Model.cs                        |  4 +--
 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
              << scope_tab << "/// <summary>Initializes a new instance of the 
<see cref=\"" << interface_name << "\"/> class.\n"
              << scope_tab << "/// Internal usage: This is used when 
interacting with C code and should not be used directly.</summary>\n"
              << scope_tab << "/// <param name=\"wh\">The native pointer to be 
wrapped.</param>\n"
-             << scope_tab << "private " << concrete_name << 
"(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n"
+             << scope_tab << "private " << concrete_name << 
"(Efl.Eo.WrappingHandle wh) : base(wh)\n"
              << scope_tab << "{\n"
              << scope_tab << "}\n\n"
             )
@@ -580,7 +580,7 @@ struct klass
                      << scope_tab << "/// <summary>Initializes a new instance 
of the <see cref=\"" << inherit_name << "\"/> class.\n"
                      << 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"
                      << scope_tab << "/// <param name=\"wh\">The native 
pointer to be wrapped.</param>\n"
-                     << scope_tab << "protected " << inherit_name << 
"(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n"
+                     << scope_tab << "internal " << inherit_name << 
"(Efl.Eo.WrappingHandle wh) : base(wh)\n"
                      << scope_tab << "{\n"
                      << scope_tab << "}\n\n"
                  ).generate(sink, std::make_tuple(constructors, constructors, 
constructors), context))
@@ -595,7 +595,7 @@ struct klass
                 scope_tab << "[Efl.Eo.PrivateNativeClass]\n"
                 << scope_tab << "private class " << inherit_name << "Realized 
: " << inherit_name << "\n"
                 << scope_tab << "{\n"
-                << scope_tab << scope_tab << "private " << inherit_name << 
"Realized(Efl.Eo.Globals.WrappingHandle wh) : base(wh)\n"
+                << scope_tab << scope_tab << "private " << inherit_name << 
"Realized(Efl.Eo.WrappingHandle wh) : base(wh)\n"
                 << scope_tab << scope_tab << "{\n"
                 << scope_tab << scope_tab << "}\n"
                 << 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
           indent << "#pragma warning disable CS1591\n\n"
           << indent << "/// <summary>Internal wrapper for struct " << string 
<< ".</summary>\n"
           << indent << "[StructLayout(LayoutKind.Sequential)]\n"
-          << indent << "public struct " << string << "\n"
+          << indent << "internal struct " << string << "\n"
           << indent << "{\n"
          )
          .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
     /// <summary>The colors to be used by the logging system.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class Color
+    internal static class Color
     {
         /// <summary>Light red
         /// <para>Since EFL 1.23.</para>
@@ -139,7 +139,7 @@ public static class Log
     static Log()
     {
         const String name = "mono";
-        const String color = "\033[32;1m";
+        const String color = Color.GREEN;
 
         // Maybe move this check outside when other eina stuff get support?
         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
     /// The type of a byte.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class ByteType
+    internal static class ByteType
     {
         /// <summary>
         /// The code of the byte.
@@ -196,7 +196,7 @@ public static class Argument
     /// The type of a boolean
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class BooleanType
+    internal static class BooleanType
     {
         /// <summary>
         /// The code of the boolean.
@@ -214,7 +214,7 @@ public static class Argument
     /// The type of a Int16.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class Int16Type
+    internal static class Int16Type
     {
         /// <summary>
         /// The code of the Int16.
@@ -232,7 +232,7 @@ public static class Argument
     /// The type of an unsigned Int16.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class UInt16Type
+    internal static class UInt16Type
     {
         /// <summary>
         /// The code of the unsigned Int16.
@@ -250,7 +250,7 @@ public static class Argument
     /// The type of a Int32.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class Int32Type
+    internal static class Int32Type
     {
         /// <summary>
         /// The code of the Int32.
@@ -268,7 +268,7 @@ public static class Argument
     /// The type of an unsigned Int32.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class UInt32Type
+    internal static class UInt32Type
     {
         /// <summary>
         /// The code of the unsigned Int32.
@@ -286,7 +286,7 @@ public static class Argument
     /// The type of a Int64.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class Int64Type
+    internal static class Int64Type
     {
         /// <summary>
         /// The code of the Int64.
@@ -304,7 +304,7 @@ public static class Argument
     /// The type of an unsigned Int64.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class UInt64Type
+    internal static class UInt64Type
     {
         /// <summary>
         /// The code of the unsigned Int64.
@@ -322,7 +322,7 @@ public static class Argument
     /// The type of the double.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class DoubleType
+    internal static class DoubleType
     {
         /// <summary>
         /// The code of the double.
@@ -340,7 +340,7 @@ public static class Argument
     /// The type of a string.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class StringType
+    internal static class StringType
     {
         /// <summary>
         /// The code of the string.
@@ -358,7 +358,7 @@ public static class Argument
     /// The type of an object path.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class ObjectPathType
+    internal static class ObjectPathType
     {
         /// <summary>
         /// The code of the object path.
@@ -376,7 +376,7 @@ public static class Argument
     /// The type of a signature.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class SignatureType
+    internal static class SignatureType
     {
         /// <summary>
         /// The code of the signature.
@@ -394,7 +394,7 @@ public static class Argument
     /// The type of a array.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class ArrayType
+    internal static class ArrayType
     {
         /// <summary>
         /// The code of the array.
@@ -412,7 +412,7 @@ public static class Argument
     /// The type of a struct.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class StructType
+    internal static class StructType
     {
         /// <summary>
         /// The code of the struct.
@@ -430,7 +430,7 @@ public static class Argument
     /// The type of a variant.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class VariantType
+    internal static class VariantType
     {
         /// <summary>
         /// The code of the variant.
@@ -448,7 +448,7 @@ public static class Argument
     /// The type of a dictionary.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class DictEntryType
+    internal static class DictEntryType
     {
         /// <summary>
         /// The code of the dictionary.
@@ -466,7 +466,7 @@ public static class Argument
     /// The type of an unix file descriptor.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static class UnixFdType
+    internal static class UnixFdType
     {
         /// <summary>
         /// 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
     /// <para>Since EFL 1.23.</para>
     /// </summary>
     /// <param name="wh">The native pointer to be wrapped.</param>
-    protected EoWrapper(Efl.Eo.Globals.WrappingHandle wh)
+    internal EoWrapper(Efl.Eo.WrappingHandle wh)
     {
         handle = wh.NativeHandle;
         AddWrapperSupervisor();
@@ -485,7 +485,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
 /// But as <see cref="Efl.Object" /> is abstract, whis realized class will 
allow us to create C# instances of it.</summary>
 internal class ObjectRealized : Efl.Object
 {
-    protected ObjectRealized(Efl.Eo.Globals.WrappingHandle ch) : base(ch) { }
+    internal ObjectRealized(Efl.Eo.WrappingHandle ch) : base(ch) { }
 }
 
 } // 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
         Monitor.Exit(Efl.All.InitLock);
     }
 
-    /// <summary>
-    /// Internal struct used by the binding to pass the native handle pointer
-    /// to the managed object wrapping constructor.
-    /// Internal usage only: do not use this class in inherited classes.
-    /// </summary>
-    public struct WrappingHandle
-    {
-        public WrappingHandle(IntPtr h)
-        {
-            NativeHandle = h;
-        }
 
-        public IntPtr NativeHandle { get; private set; }
-    }
 
 } // Globals
 
+/// <summary>
+/// Internal struct used by the binding to pass the native handle pointer
+/// to the managed object wrapping constructor.
+/// Internal usage only: do not use this class in inherited classes.
+/// </summary>
+internal struct WrappingHandle
+{
+    public WrappingHandle(IntPtr h)
+    {
+        NativeHandle = h;
+    }
+
+    public IntPtr NativeHandle { get; private set; }
+}
+
 public static class Config
 {
 
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;
 namespace TestSuite {
 
 [SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
-public class TestModel {
+public static class TestModel {
 
-    public class VeggieViewModel
+    private class VeggieViewModel
     {
         public string Name { get; set; }
         public string Type { get; set; }

-- 


Reply via email to