|
|
|
@ -489,11 +489,6 @@ namespace CppSharp.Generators.CSharp |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Options.GenerateClassMarshals) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GenerateClassMarshals(@class); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GenerateClassConstructors(@class); |
|
|
|
GenerateClassConstructors(@class); |
|
|
|
|
|
|
|
|
|
|
|
GenerateClassMethods(@class.Methods); |
|
|
|
GenerateClassMethods(@class.Methods); |
|
|
|
@ -511,25 +506,6 @@ namespace CppSharp.Generators.CSharp |
|
|
|
Context.TypeMaps.TypeMaps.Add(@class.Name, typeMap); |
|
|
|
Context.TypeMaps.TypeMaps.Add(@class.Name, typeMap); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void GenerateClassMarshals(Class @class) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
WriteLine("int CppSharp.Runtime.ICppMarshal.NativeDataSize"); |
|
|
|
|
|
|
|
WriteStartBraceIndent(); |
|
|
|
|
|
|
|
WriteLine("get {{ return {0}; }}", @class.Layout.DataSize); |
|
|
|
|
|
|
|
WriteCloseBraceIndent(); |
|
|
|
|
|
|
|
NewLine(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteLine("void CppSharp.Runtime.ICppMarshal.MarshalManagedToNative(global::System.IntPtr instance)"); |
|
|
|
|
|
|
|
WriteStartBraceIndent(); |
|
|
|
|
|
|
|
WriteCloseBraceIndent(); |
|
|
|
|
|
|
|
NewLine(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WriteLine("void CppSharp.Runtime.ICppMarshal.MarshalNativeToManaged(global::System.IntPtr instance)"); |
|
|
|
|
|
|
|
WriteStartBraceIndent(); |
|
|
|
|
|
|
|
WriteCloseBraceIndent(); |
|
|
|
|
|
|
|
NewLine(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void GenerateInterface(Class @class) |
|
|
|
private void GenerateInterface(Class @class) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!@class.IsGenerated || @class.IsIncomplete) |
|
|
|
if (!@class.IsGenerated || @class.IsIncomplete) |
|
|
|
@ -744,11 +720,6 @@ namespace CppSharp.Generators.CSharp |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (@class.IsRefType) |
|
|
|
if (@class.IsRefType) |
|
|
|
bases.Add("IDisposable"); |
|
|
|
bases.Add("IDisposable"); |
|
|
|
|
|
|
|
|
|
|
|
if (Options.GenerateClassMarshals) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bases.Add("CppSharp.Runtime.ICppMarshal"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (bases.Count > 0 && !@class.IsStatic) |
|
|
|
if (bases.Count > 0 && !@class.IsStatic) |
|
|
|
|