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
This commit is contained in:
Bruno da Silva Belo 2019-11-04 14:40:18 -03:00 committed by Lauro Moura
parent 0e71e0e286
commit 0e6e983808
7 changed files with 42 additions and 40 deletions

View File

@ -232,7 +232,7 @@ struct klass
<< scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << interface_name << "\"/> class.\n" << 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 << "/// 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 << "/// <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"
<< scope_tab << "}\n\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 << "/// <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 << "/// 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 << "/// <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"
<< scope_tab << "}\n\n" << scope_tab << "}\n\n"
).generate(sink, std::make_tuple(constructors, constructors, constructors), context)) ).generate(sink, std::make_tuple(constructors, constructors, constructors), context))
@ -595,7 +595,7 @@ struct klass
scope_tab << "[Efl.Eo.PrivateNativeClass]\n" scope_tab << "[Efl.Eo.PrivateNativeClass]\n"
<< scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n" << scope_tab << "private class " << inherit_name << "Realized : " << inherit_name << "\n"
<< scope_tab << "{\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 << scope_tab << "}\n" << scope_tab << scope_tab << "}\n"
<< scope_tab << "}\n" << scope_tab << "}\n"

View File

@ -291,7 +291,7 @@ struct struct_internal_definition_generator
indent << "#pragma warning disable CS1591\n\n" indent << "#pragma warning disable CS1591\n\n"
<< indent << "/// <summary>Internal wrapper for struct " << string << ".</summary>\n" << indent << "/// <summary>Internal wrapper for struct " << string << ".</summary>\n"
<< indent << "[StructLayout(LayoutKind.Sequential)]\n" << indent << "[StructLayout(LayoutKind.Sequential)]\n"
<< indent << "public struct " << string << "\n" << indent << "internal struct " << string << "\n"
<< indent << "{\n" << indent << "{\n"
) )
.generate(sink, std::make_tuple<>(binding_struct_name(struct_), struct_internal_decl_name()), context)) .generate(sink, std::make_tuple<>(binding_struct_name(struct_), struct_internal_decl_name()), context))

View File

@ -79,7 +79,7 @@ public static class Log
/// <summary>The colors to be used by the logging system. /// <summary>The colors to be used by the logging system.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class Color internal static class Color
{ {
/// <summary>Light red /// <summary>Light red
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
@ -139,7 +139,7 @@ public static class Log
static Log() static Log()
{ {
const String name = "mono"; 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? // Maybe move this check outside when other eina stuff get support?
domain = eina_log_domain_register(name, color); domain = eina_log_domain_register(name, color);

View File

@ -178,7 +178,7 @@ public static class Argument
/// The type of a byte. /// The type of a byte.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class ByteType internal static class ByteType
{ {
/// <summary> /// <summary>
/// The code of the byte. /// The code of the byte.
@ -196,7 +196,7 @@ public static class Argument
/// The type of a boolean /// The type of a boolean
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class BooleanType internal static class BooleanType
{ {
/// <summary> /// <summary>
/// The code of the boolean. /// The code of the boolean.
@ -214,7 +214,7 @@ public static class Argument
/// The type of a Int16. /// The type of a Int16.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class Int16Type internal static class Int16Type
{ {
/// <summary> /// <summary>
/// The code of the Int16. /// The code of the Int16.
@ -232,7 +232,7 @@ public static class Argument
/// The type of an unsigned Int16. /// The type of an unsigned Int16.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class UInt16Type internal static class UInt16Type
{ {
/// <summary> /// <summary>
/// The code of the unsigned Int16. /// The code of the unsigned Int16.
@ -250,7 +250,7 @@ public static class Argument
/// The type of a Int32. /// The type of a Int32.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class Int32Type internal static class Int32Type
{ {
/// <summary> /// <summary>
/// The code of the Int32. /// The code of the Int32.
@ -268,7 +268,7 @@ public static class Argument
/// The type of an unsigned Int32. /// The type of an unsigned Int32.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class UInt32Type internal static class UInt32Type
{ {
/// <summary> /// <summary>
/// The code of the unsigned Int32. /// The code of the unsigned Int32.
@ -286,7 +286,7 @@ public static class Argument
/// The type of a Int64. /// The type of a Int64.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class Int64Type internal static class Int64Type
{ {
/// <summary> /// <summary>
/// The code of the Int64. /// The code of the Int64.
@ -304,7 +304,7 @@ public static class Argument
/// The type of an unsigned Int64. /// The type of an unsigned Int64.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class UInt64Type internal static class UInt64Type
{ {
/// <summary> /// <summary>
/// The code of the unsigned Int64. /// The code of the unsigned Int64.
@ -322,7 +322,7 @@ public static class Argument
/// The type of the double. /// The type of the double.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class DoubleType internal static class DoubleType
{ {
/// <summary> /// <summary>
/// The code of the double. /// The code of the double.
@ -340,7 +340,7 @@ public static class Argument
/// The type of a string. /// The type of a string.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class StringType internal static class StringType
{ {
/// <summary> /// <summary>
/// The code of the string. /// The code of the string.
@ -358,7 +358,7 @@ public static class Argument
/// The type of an object path. /// The type of an object path.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class ObjectPathType internal static class ObjectPathType
{ {
/// <summary> /// <summary>
/// The code of the object path. /// The code of the object path.
@ -376,7 +376,7 @@ public static class Argument
/// The type of a signature. /// The type of a signature.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class SignatureType internal static class SignatureType
{ {
/// <summary> /// <summary>
/// The code of the signature. /// The code of the signature.
@ -394,7 +394,7 @@ public static class Argument
/// The type of a array. /// The type of a array.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class ArrayType internal static class ArrayType
{ {
/// <summary> /// <summary>
/// The code of the array. /// The code of the array.
@ -412,7 +412,7 @@ public static class Argument
/// The type of a struct. /// The type of a struct.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class StructType internal static class StructType
{ {
/// <summary> /// <summary>
/// The code of the struct. /// The code of the struct.
@ -430,7 +430,7 @@ public static class Argument
/// The type of a variant. /// The type of a variant.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class VariantType internal static class VariantType
{ {
/// <summary> /// <summary>
/// The code of the variant. /// The code of the variant.
@ -448,7 +448,7 @@ public static class Argument
/// The type of a dictionary. /// The type of a dictionary.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class DictEntryType internal static class DictEntryType
{ {
/// <summary> /// <summary>
/// The code of the dictionary. /// The code of the dictionary.
@ -466,7 +466,7 @@ public static class Argument
/// The type of an unix file descriptor. /// The type of an unix file descriptor.
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
public static class UnixFdType internal static class UnixFdType
{ {
/// <summary> /// <summary>
/// The code of unix fd. /// The code of unix fd.

View File

@ -81,7 +81,7 @@ public abstract class EoWrapper : IWrapper, IDisposable
/// <para>Since EFL 1.23.</para> /// <para>Since EFL 1.23.</para>
/// </summary> /// </summary>
/// <param name="wh">The native pointer to be wrapped.</param> /// <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; handle = wh.NativeHandle;
AddWrapperSupervisor(); 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> /// 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 internal class ObjectRealized : Efl.Object
{ {
protected ObjectRealized(Efl.Eo.Globals.WrappingHandle ch) : base(ch) { } internal ObjectRealized(Efl.Eo.WrappingHandle ch) : base(ch) { }
} }
} // namespace Efl } // namespace Efl

View File

@ -759,23 +759,25 @@ public static class Globals
Monitor.Exit(Efl.All.InitLock); 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 } // 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 public static class Config
{ {

View File

@ -9,9 +9,9 @@ using System.Diagnostics.CodeAnalysis;
namespace TestSuite { namespace TestSuite {
[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")] [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 Name { get; set; }
public string Type { get; set; } public string Type { get; set; }