diff --git a/CPPInterop.sln b/CPPInterop.sln index e342028e..13f8c073 100644 --- a/CPPInterop.sln +++ b/CPPInterop.sln @@ -5,8 +5,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Interop", "src EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "tests\Tests.csproj", "{3C290CBE-CA39-47F6-B3A0-ACD16C5A38C8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Code", "src\Mono.VisualC.Code\Mono.VisualC.Code.csproj", "{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "generator", "src\generator\generator.csproj", "{AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}" EndProject Global @@ -23,10 +21,6 @@ Global {4A864586-93C5-4DC1-8A80-F094A88506D7}.Debug|Any CPU.Build.0 = Debug|Any CPU {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.ActiveCfg = Release|Any CPU {4A864586-93C5-4DC1-8A80-F094A88506D7}.Release|Any CPU.Build.0 = Release|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Release|Any CPU.Build.0 = Release|Any CPU {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Debug|Any CPU.Build.0 = Debug|Any CPU {AD0F9378-789C-4AF1-B0DD-6DD9A63C3401}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/src/Makefile.am b/src/Makefile.am index 5b4fb29b..1391d887 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,2 +1,2 @@ - SUBDIRS = Mono.VisualC.Interop Mono.VisualC.Code generator + SUBDIRS = Mono.VisualC.Interop generator diff --git a/src/Mono.VisualC.Code/Access.cs b/src/Mono.VisualC.Code/Access.cs deleted file mode 100644 index 79dc4999..00000000 --- a/src/Mono.VisualC.Code/Access.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -namespace Mono.VisualC.Code { - public enum Access { - Public, - Protected, - Private - } -} - diff --git a/src/Mono.VisualC.Code/AssemblyInfo.cs b/src/Mono.VisualC.Code/AssemblyInfo.cs deleted file mode 100644 index ee7458b7..00000000 --- a/src/Mono.VisualC.Code/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("Mono.VisualC.Code")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - -[assembly: CLSCompliant(true)] diff --git a/src/Mono.VisualC.Code/Atoms/Class.cs b/src/Mono.VisualC.Code/Atoms/Class.cs deleted file mode 100644 index c09a06f9..00000000 --- a/src/Mono.VisualC.Code/Atoms/Class.cs +++ /dev/null @@ -1,265 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; -using System.Reflection; - -using System.CodeDom; -using Mono.VisualC.Interop; -using Mono.VisualC.Code; - -namespace Mono.VisualC.Code.Atoms { - - public class Class : CodeContainer { - - // FIXME: This should be moved into Mono.VisualC.Interop and an attribute - // for name mangling purposes (MSVC mangles differently depending on defined as class or struct). - public enum Definition { - Class, - Struct - } - public struct BaseClass { - public string Name; - public Access Access; - public bool IsVirtual; - } - - public string StaticCppLibrary { get; set; } - public Definition DefinedAs { get; set; } - - public IList Bases { get; set; } - public IList TemplateArguments { get; set; } - public string GenericName {get; set;} - public CppType OriginalType {get; set;} - - public Class (string name) - { - Name = name; - Bases = new List (); - TemplateArguments = new List (); - } - - internal protected override object InsideCodeNamespace (CodeNamespace ns) - { - ns.Types.Add (CreateWrapperClass ()); - return null; - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - if (!decl.IsClass) - return null; - - decl.Members.Add (CreateWrapperClass ()); - return null; - } - - public CodeTypeDeclaration CreateWrapperClass () - { - var wrapper = new CodeTypeDeclaration (Name) { - Attributes = MemberAttributes.Public, - TypeAttributes = TypeAttributes.Public - }; - foreach (var arg in TemplateArguments) - wrapper.TypeParameters.Add (arg); - - if (Atoms.Count == 0) { - wrapper.Comments.Add (new CodeCommentStatement ("FIXME: This type is a stub.")); - string m = CreateBaseImplementation (wrapper); - wrapper.BaseTypes.Add (m); - wrapper.Members.Add (new CodeMemberMethod { Name = "Dispose", Attributes = MemberAttributes.Public}); - - var ctor = new CodeConstructor { - Name = this.Name, - Attributes = MemberAttributes.Assembly - }; - ctor.Parameters.Add (new CodeParameterDeclarationExpression (typeof (CppTypeInfo).Name, "subClass")); - - wrapper.Members.Add (ctor); - return wrapper; - } - - var iface = CreateInterface (wrapper); - wrapper.Members.Add (iface); - - var native = CreateNativeLayout (); - wrapper.Members.Add (native); - - // FIXME: For now, we'll have the managed wrapper extend from the first public base class - string managedBase = Bases.Where (b => b.Access == Access.Public).Select (b => b.Name).FirstOrDefault (); - bool hasOverrides = true; - - if (managedBase == null) { - hasOverrides = false; - managedBase = CreateBaseImplementation (wrapper); - } - wrapper.BaseTypes.Add (managedBase); - - // add static impl field - var implField = new CodeMemberField (iface.TypeReference (), "impl") { Attributes = MemberAttributes.Static | MemberAttributes.Private }; - if (StaticCppLibrary != null) { - CodeTypeReference [] types = new CodeTypeReference [] { - iface.TypeReference (), - native.TypeReference (), - wrapper.TypeReference () - }; - var getClassMethod = new CodeMethodReferenceExpression (new CodeTypeReferenceExpression (new CodeTypeReference (StaticCppLibrary, CodeTypeReferenceOptions.GlobalReference)), "GetClass", types); - implField.InitExpression = new CodeMethodInvokeExpression (getClassMethod, new CodePrimitiveExpression (Name)); - } - wrapper.Members.Add (implField); - - // always add native subclass ctor - wrapper.Members.Add (CreateNativeSubclassConstructor (hasOverrides)); - - CodeMemberMethod dispose = null; - foreach (var atom in Atoms) { - Method method = atom as Method; - if (method != null && method.IsDestructor) { - dispose = (CodeMemberMethod)method.InsideCodeTypeDeclaration (wrapper); - atom.Visit (dispose); - } else - atom.Visit (wrapper); - } - - if (dispose == null) { - dispose = CreateDestructorlessDispose (); - wrapper.Members.Add (dispose); - } - - if (hasOverrides) - dispose.Attributes |= MemberAttributes.Override; - - return wrapper; - } - - string CreateBaseImplementation (CodeTypeDeclaration wrapper) - { - string managedBase = typeof (ICppObject).Name; - - // Add Native property - var nativeField = new CodeMemberField (typeof (CppInstancePtr).Name, "native_ptr") { Attributes = MemberAttributes.Family }; - var nativeProperty = new CodeMemberProperty { - Name = "Native", - Type = new CodeTypeReference (typeof (CppInstancePtr).Name), - HasSet = false, - Attributes = MemberAttributes.Public | MemberAttributes.Final - }; - nativeProperty.GetStatements.Add (new CodeMethodReturnStatement (new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), nativeField.Name))); - - wrapper.Members.Add (nativeField); - wrapper.Members.Add (nativeProperty); - return managedBase; - } - - public CodeTypeDeclaration CreateInterface () - { - return CreateInterface (null); - } - public CodeTypeDeclaration CreateInterface (CodeTypeDeclaration wrapper) - { - var iface = new CodeTypeDeclaration ("I" + Name) { - TypeAttributes = TypeAttributes.Interface | (wrapper != null? TypeAttributes.NestedPublic : TypeAttributes.Public), - Attributes = MemberAttributes.Public, - IsInterface = true - }; - - foreach (var arg in TemplateArguments) - iface.TypeParameters.Add (arg); - - if (wrapper != null) - iface.BaseTypes.Add (new CodeTypeReference (typeof (ICppClassOverridable<>).Name, wrapper.TypeReference ())); - else - iface.BaseTypes.Add (new CodeTypeReference (typeof (ICppClass).Name)); - - foreach (var atom in Atoms) - atom.Visit (iface); - - return iface; - } - - public CodeTypeDeclaration CreateNativeLayout () - { - var native = new CodeTypeDeclaration ("_" + Name) { - TypeAttributes = TypeAttributes.NestedPrivate | TypeAttributes.SequentialLayout, - Attributes = MemberAttributes.Private, - IsStruct = true - }; - - foreach (var atom in Atoms) - atom.Visit (native); - - return native; - } - - private CodeConstructor CreateNativeSubclassConstructor (bool callBase) - { - var ctor = new CodeConstructor { - Name = this.Name, - Attributes = MemberAttributes.Assembly - }; - ctor.Parameters.Add (new CodeParameterDeclarationExpression (typeof (CppTypeInfo).Name, "subClass")); - - // FIXME: Again, will this always work? - var implTypeInfo = new CodeFieldReferenceExpression (new CodeFieldReferenceExpression { FieldName = "impl" }, "TypeInfo"); - - if (callBase) - ctor.BaseConstructorArgs.Add (implTypeInfo); - - var addBase = new CodeMethodInvokeExpression (new CodeArgumentReferenceExpression ("subClass"), "AddBase", implTypeInfo); - ctor.Statements.Add (addBase); - - return ctor; - } - - private CodeMemberMethod CreateDestructorlessDispose () - { - var dispose = new CodeMemberMethod { - Name = "Dispose", - Attributes = MemberAttributes.Public - }; - - var warning = new CodeCommentStatement ("FIXME: Check for inline destructor for this class."); - dispose.Statements.Add (warning); - - var native = new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), "Native"); - dispose.Statements.Add (new CodeMethodInvokeExpression (native, "Dispose")); - - return dispose; - } - - public override void Write (TextWriter writer) - { - string declarator = (DefinedAs == Definition.Class? "class" : "struct"); - writer.Write ("{0} {1}", declarator, Name); - - var bce = Bases.GetEnumerator (); - - if (bce.MoveNext ()) { - writer.Write (" : "); - - while (true) { - var baseClass = bce.Current; - - if (baseClass.IsVirtual) writer.Write ("virtual "); - switch (baseClass.Access) { - case Access.Public: writer.Write ("public "); break; - case Access.Protected: writer.Write ("protected "); break; - case Access.Private: writer.Write ("private "); break; - } - - writer.Write (baseClass.Name); - - if (!bce.MoveNext ()) - break; - - writer.Write (", "); - } - } - - writer.WriteLine (" {"); - base.Write (writer); - writer.WriteLine ("};"); - } - } -} - diff --git a/src/Mono.VisualC.Code/Atoms/Enumeration.cs b/src/Mono.VisualC.Code/Atoms/Enumeration.cs deleted file mode 100644 index e88887ba..00000000 --- a/src/Mono.VisualC.Code/Atoms/Enumeration.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Linq; -using System.IO; -using System.Reflection; -using System.Collections.Generic; - -using System.CodeDom; - -namespace Mono.VisualC.Code.Atoms { - public class Enumeration : CodeAtom { - - public struct Item { - public string Name; - public int Value; - } - - public string Name { get; set; } - public IList Items { get; set; } - - public Enumeration (string name) - { - Name = name; - Items = new List (); - } - - internal protected override object InsideCodeNamespace (CodeNamespace ns) - { - ns.Types.Add (CreateEnumType ()); - return null; - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - if (!decl.IsClass) - return null; - - decl.Members.Add (CreateEnumType ()); - return null; - } - - public CodeTypeDeclaration CreateEnumType () - { - var type = new CodeTypeDeclaration (Name) { - Attributes = MemberAttributes.Public, - TypeAttributes = TypeAttributes.Public, - IsEnum = true - }; - - foreach (Item i in Items) - type.Members.Add (new CodeMemberField (typeof (int), i.Name) { InitExpression = new CodePrimitiveExpression (i.Value) }); - - return type; - } - - public override void Write (TextWriter writer) - { - throw new NotImplementedException (); - } - } -} - diff --git a/src/Mono.VisualC.Code/Atoms/Field.cs b/src/Mono.VisualC.Code/Atoms/Field.cs deleted file mode 100644 index f0fa36cb..00000000 --- a/src/Mono.VisualC.Code/Atoms/Field.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.IO; -using System.CodeDom; - -using Mono.VisualC.Interop; - -namespace Mono.VisualC.Code.Atoms { - public class Field : CodeAtom { - - public string Name { get; set; } - public CppType Type { get; set; } - - public Field (string name, CppType type) - { - Name = name; - Type = type; - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - // FIXME: eventually this could add CppFields to the interface so they could be - // so they could be accessed as properties in the managed api - if (!decl.IsStruct) - return null; - - CodeMemberField field = new CodeMemberField { Name = this.Name }; - CodeTypeReference typeRef = TypeReference; - - if (typeRef == null) { - field.Comments.Add (new CodeCommentStatement ("FIXME: Unknown type \"" + Type.ToString () + "\" for field \"" + Name + ".\" Assuming IntPtr.")); - field.Type = new CodeTypeReference (typeof (IntPtr)); - } else - field.Type = typeRef; - - decl.Members.Add (field); - return field; - } - - // FIXME: Handle fixed size arrays? Can't really see a good way to do that yet. - public CodeTypeReference TypeReference { - get { - - if (Type.Modifiers.Count > 0) { - CppModifiers lastModifier = Type.Modifiers [Type.Modifiers.Count - 1]; - if (lastModifier == CppModifiers.Pointer || lastModifier == CppModifiers.Reference) - return new CodeTypeReference (typeof (IntPtr)); - } - - if (Type.ElementType == CppTypes.Enum || Type.ElementType == CppTypes.Union) - return Type.TypeReference (); - - if (Type.ElementType == CppTypes.Typename) - return new CodeTypeReference (Type.ElementTypeName, CodeTypeReferenceOptions.GenericTypeParameter); - - Type managedType = Type.ToManagedType (); - if (managedType != null) - return new CodeTypeReference (managedType); - - return null; - } - } - - public override void Write (TextWriter writer) - { - writer.WriteLine ("{0} {1};", Type.ToString (), Name); - } - } -} - diff --git a/src/Mono.VisualC.Code/Atoms/Method.cs b/src/Mono.VisualC.Code/Atoms/Method.cs deleted file mode 100644 index 50463435..00000000 --- a/src/Mono.VisualC.Code/Atoms/Method.cs +++ /dev/null @@ -1,311 +0,0 @@ -using System; -using System.Linq; -using System.Text; -using System.IO; -using System.Collections.Generic; -using System.CodeDom; - -using Mono.VisualC.Interop; -using Mono.VisualC.Interop.ABI; -using Mono.VisualC.Interop.Util; - -namespace Mono.VisualC.Code.Atoms { - - public class Method : CodeContainer { - - public Access Access { get; set; } - public bool IsVirtual { get; set; } - public bool IsStatic { get; set; } - public bool IsConst { get; set; } - public bool IsConstructor { get; set; } - public bool IsDestructor { get; set; } - - public CppType RetType { get; set; } - - public IList> Parameters { get; set; } - public Class Klass { get; set; } - - private string formatted_name; - - // for testing: - // FIXME: make this Nullable, auto implemented property and remove bool field once this won't cause gmcs to crash - public NameTypePair Mangled { - get { - if (!hasMangledInfo) throw new InvalidOperationException ("No mangle info present."); - return mangled; - } - set { - mangled = value; - hasMangledInfo = true; - } - - } - private NameTypePair mangled; - private bool hasMangledInfo = false; - - - public Method (string name) - { - Name = name; - Parameters = new List> (); - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - if (decl.IsClass) { - var method = CreateWrapperMethod (); - - if (method == null || CommentedOut) - return null; - - if (Comment != null) - method.Comments.Add (new CodeCommentStatement (Comment)); - - decl.Members.Add (method); - return method; - - } else if (decl.IsInterface) { - CodeTypeMember method = CreateInterfaceMethod (); - CodeTypeMember member; - - if (CommentedOut) { - member = new CodeSnippetTypeMember (); - member.Comments.Add (new CodeCommentStatement (method.CommentOut (current_code_provider))); - - } else - member = method; - - if (Comment != null) - member.Comments.Insert (0, new CodeCommentStatement (Comment)); - - decl.Members.Add (member); - } - - return null; - } - - internal protected override object InsideCodeStatementCollection (CodeStatementCollection stmts) - { - List arguments = new List (); - var native = new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), "Native"); - var native_ptr = new CodeFieldReferenceExpression (new CodeThisReferenceExpression (), "native_ptr"); - - if (!IsStatic) - arguments.Add (native); - - foreach (var param in Parameters) { - // FIXME: handle typenames better - if (param.Type.ElementType != CppTypes.Typename) { - Type managedType = param.Type.ToManagedType (); - if (managedType != null && managedType.IsByRef) { - arguments.Add (new CodeDirectionExpression (FieldDirection.Ref, new CodeArgumentReferenceExpression (param.Name))); - continue; - } - } - arguments.Add (new CodeArgumentReferenceExpression (param.Name)); - } - - // FIXME: Does just specifying the field name work for all code generators? - var impl = new CodeFieldReferenceExpression { FieldName = "impl" }; - - - if (IsConstructor) { - var alloc = new CodeMethodInvokeExpression (impl, "Alloc", new CodeThisReferenceExpression ()); - stmts.Add (new CodeAssignStatement (native_ptr, alloc)); - } - - var invoke = new CodeMethodInvokeExpression (impl, Name, arguments.ToArray ()); - - if (RetType.Equals (CppTypes.Void) || IsConstructor) - stmts.Add (invoke); - else - stmts.Add (new CodeMethodReturnStatement (invoke)); - - if (IsDestructor) - stmts.Add (new CodeMethodInvokeExpression (native, "Dispose")); - - return null; - } - - private CodeMemberMethod CreateInterfaceMethod () - { - var returnType = ReturnTypeReference; - var method = new CodeMemberMethod { - Name = this.Name, - ReturnType = returnType - }; - - if (returnType == null) { - Comment = "FIXME: Unknown return type \"" + RetType.ToString () + "\" for method \"" + Name + "\"";; - CommentedOut = true; - method.ReturnType = new CodeTypeReference (typeof (void)); - } - - if (IsVirtual) method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (VirtualAttribute).Name)); - if (IsConstructor) method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (ConstructorAttribute).Name)); - if (IsDestructor) method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (DestructorAttribute).Name)); - if (IsConst) method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (ConstAttribute).Name)); - - if (IsStatic) - method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (StaticAttribute).Name)); - else - method.Parameters.Add (new CodeParameterDeclarationExpression (typeof (CppInstancePtr).Name, "this")); - - if (hasMangledInfo) - method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (AbiTestAttribute).Name, - new CodeAttributeArgument (new CodePrimitiveExpression (Mangled.Name)), - new CodeAttributeArgument ("Abi", new CodeTypeOfExpression (Mangled.Type)))); - for (int i = 0; i < Parameters.Count; i++) { - var param = GenerateParameterDeclaration (Parameters [i]); - string paramStr = Parameters [i].Type.ToString (); - - if (param == null) { - Comment = "FIXME: Unknown parameter type \"" + paramStr + "\" to method \"" + Name + "\""; - CommentedOut = true; - method.Parameters.Add (new CodeParameterDeclarationExpression (paramStr, Parameters [i].Name)); - continue; - } - - // FIXME: Only add MangleAs attribute if the managed type chosen would mangle differently by default - if (!IsVirtual && !paramStr.Equals (string.Empty)) - param.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (MangleAsAttribute).Name, new CodeAttributeArgument (new CodePrimitiveExpression (paramStr)))); - - method.Parameters.Add (param); - } - - return method; - } - - private CodeMemberMethod CreateWrapperMethod () - { - CodeMemberMethod method; - - if (IsConstructor) { - var ctor = new CodeConstructor { - Name = FormattedName, - Attributes = MemberAttributes.Public - }; - if (Klass.Bases.Count > 0) { - var typeInfo = new CodeFieldReferenceExpression (new CodeFieldReferenceExpression { FieldName = "impl" }, "TypeInfo"); - ctor.BaseConstructorArgs.Add (typeInfo); - // The first public base class can use the subclass ctor as above, but for the rest, we do this to get the right CppTypeInfo - foreach (Class.BaseClass bc in Klass.Bases.Where (b => b.Access == Access.Public).Skip (1)) { - // FIXME: This won't work if one of the base classes ends up being generic - ctor.Statements.Add (new CodeObjectCreateExpression (bc.Name, typeInfo)); - } - ctor.Statements.Add (new CodeMethodInvokeExpression (typeInfo, "CompleteType")); - } - method = ctor; - } else if (IsDestructor) - method = new CodeMemberMethod { - Name = "Dispose", - Attributes = MemberAttributes.Public - }; - else - method = new CodeMemberMethod { - Name = FormattedName, - Attributes = MemberAttributes.Public, - ReturnType = ReturnTypeReference - }; - - if (IsStatic) - method.Attributes |= MemberAttributes.Static; - else if (!IsVirtual && !IsDestructor) - // I'm only making methods that are virtual in C++ virtual in managed code. - // I think it is the right thing to do because the consumer of the API might not - // get the intended effect if the managed method is overridden and the native method is not. - method.Attributes |= MemberAttributes.Final; - else if (IsVirtual && !IsDestructor) - method.CustomAttributes.Add (new CodeAttributeDeclaration (typeof (OverrideNativeAttribute).Name)); - - for (int i = 0; i < Parameters.Count; i++) { - var param = GenerateParameterDeclaration (Parameters [i]); - if (param == null) - return null; - - method.Parameters.Add (param); - } - - return method; - } - - public CodeTypeReference ReturnTypeReference { - get { - CodeTypeReference returnType; - - if (RetType.ElementType == CppTypes.Typename) - returnType = new CodeTypeReference (RetType.ElementTypeName, CodeTypeReferenceOptions.GenericTypeParameter); - else { - Type managedType = RetType.ToManagedType (); - if (managedType != null && managedType.IsByRef) - returnType = new CodeTypeReference (typeof (IntPtr)); - else if (managedType != null && managedType != typeof (ICppObject)) - returnType = new CodeTypeReference (managedType); - else - returnType = RetType.TypeReference (); - } - - return returnType; - } - } - - private CodeParameterDeclarationExpression GenerateParameterDeclaration (NameTypePair param) - { - CodeParameterDeclarationExpression paramDecl; - - if (param.Type.ElementType == CppTypes.Typename) - paramDecl = new CodeParameterDeclarationExpression (param.Type.ElementTypeName, param.Name); - - else { - Type managedType = param.Type.ToManagedType (); - CodeTypeReference typeRef = param.Type.TypeReference (); - - if (managedType != null && managedType.IsByRef) - paramDecl = new CodeParameterDeclarationExpression (managedType.GetElementType (), param.Name) { Direction = FieldDirection.Ref }; - - else if (managedType != null && managedType != typeof (ICppObject)) - paramDecl = new CodeParameterDeclarationExpression (managedType, param.Name); - - else if (typeRef != null) - paramDecl = new CodeParameterDeclarationExpression (typeRef, param.Name); - - else - return null; - - } - - return paramDecl; - } - - public string FormattedName { - get { - if (formatted_name == null) { - string upper = Name.ToUpper (); - StringBuilder sb = new StringBuilder (Name.Length); - - for (int i = 0; i < Name.Length; i++) { - if (i == 0) - sb.Append (upper [0]); - else if (Name [i] == '_') - sb.Append (upper [++i]); - else - sb.Append (Name [i]); - } - formatted_name = sb.ToString (); - if (formatted_name == Klass.Name) - formatted_name += "1"; - } - return formatted_name; - } - set { - formatted_name = value; - } - } - - public override void Write (TextWriter writer) - { - throw new NotImplementedException (); - } - } -} - diff --git a/src/Mono.VisualC.Code/Atoms/Namespace.cs b/src/Mono.VisualC.Code/Atoms/Namespace.cs deleted file mode 100644 index abdcae38..00000000 --- a/src/Mono.VisualC.Code/Atoms/Namespace.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.IO; -using System.CodeDom; - -namespace Mono.VisualC.Code.Atoms { - public class Namespace : CodeContainer { - - public Namespace (string name) - { - Name = name; - } - - internal protected override object InsideCodeCompileUnit (CodeCompileUnit ccu) - { - CreateNamespace (ccu, Name); - return null; - } - - internal protected override object InsideCodeNamespace (CodeNamespace ns) - { - CodeCompileUnit ccu = ns.UserData ["CodeCompileUnit"] as CodeCompileUnit; - if (ccu == null) - throw new NotSupportedException ("Invalid CodeNamespace"); - - CreateNamespace (ccu, ns.Name + "." + Name); - return null; - } - - private void CreateNamespace (CodeCompileUnit ccu, string name) - { - CodeNamespace ns = new CodeNamespace (name); - ns.Imports.Add (new CodeNamespaceImport ("System")); - ns.Imports.Add (new CodeNamespaceImport ("System.Runtime.InteropServices")); - ns.Imports.Add (new CodeNamespaceImport ("Mono.VisualC.Interop")); - - ns.UserData ["CodeCompileUnit"] = ccu; - - foreach (var atom in Atoms) - atom.Visit (ns); - - ccu.Namespaces.Add (ns); - } - - public override void Write (TextWriter writer) - { - writer.WriteLine ("namespace {0} {{", Name); - base.Write (writer); - writer.WriteLine ("}"); - } - } -} - diff --git a/src/Mono.VisualC.Code/Atoms/Preprocessor.cs b/src/Mono.VisualC.Code/Atoms/Preprocessor.cs deleted file mode 100644 index 62585d2f..00000000 --- a/src/Mono.VisualC.Code/Atoms/Preprocessor.cs +++ /dev/null @@ -1,81 +0,0 @@ - -using System; -using System.Reflection; -using System.Linq; -using System.IO; - -using System.CodeDom; - -namespace Mono.VisualC.Code.Atoms { - - // FIXME: support conditional compilation - public class PoundDefine : CodeAtom { - public string Name {get; set;} - public T Value {get; set;} - private bool value_set = false; - - public PoundDefine(string name) { - Name = name; - } - public PoundDefine (string name, T value) { - Name = name; - Value = value; - value_set = true; - } - public override void Write (TextWriter writer) { - if (value_set) - writer.WriteLine ("#define {0} {1}", Name, Value); - else - writer.WriteLine ("#define {0}", Name); - } - - internal protected override object InsideCodeNamespace (CodeNamespace ns) - { - if (!value_set) - return null; - - // create a new type Constants if it does not exist - CodeTypeDeclaration constants = (from type in ns.Types.Cast () - where type.Name.Equals ("Constants") select type).SingleOrDefault (); - if (constants == null) { - constants = new CodeTypeDeclaration ("Constants"); - constants.TypeAttributes = TypeAttributes.Public | TypeAttributes.Sealed; - ns.Types.Add (constants); - } - - return constants; - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - if (!value_set) - return null; - - var constant = new CodeMemberField (typeof (T), Name); - constant.Attributes = MemberAttributes.Public | MemberAttributes.Const; - constant.InitExpression = new CodePrimitiveExpression (Value); - decl.Members.Add (constant); - - return constant; - } - } - - public class PoundIfDef : CodeContainer { - public enum Condition { - Defined, - NotDefined - } - public Condition IfCondition {get; set;} - public PoundIfDef (Condition condition, string name) { - IfCondition = condition; - Name = name; - } - - public override void Write (TextWriter writer) { - string directive = (IfCondition == Condition.Defined ? "#ifdef {0}" : "#ifndef {0}"); - writer.WriteLine (directive, Name); - base.Write (writer); - writer.WriteLine ("#endif"); - } - } -} diff --git a/src/Mono.VisualC.Code/Atoms/Property.cs b/src/Mono.VisualC.Code/Atoms/Property.cs deleted file mode 100644 index aabd39d4..00000000 --- a/src/Mono.VisualC.Code/Atoms/Property.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.IO; -using System.CodeDom; - -namespace Mono.VisualC.Code.Atoms { - public class Property : CodeAtom { - - public string Name { get; set; } - public Method Getter { get; set; } - public Method Setter { get; set; } - - public Property (string name) - { - Name = name; - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - // if getter is omitted, just output the setter like a method - if (decl.IsInterface || Getter == null) { - if (Getter != null) - Getter.Visit (decl); - if (Setter != null) - Setter.Visit (decl); - return null; - } else if (!decl.IsClass) - return null; - - var prop = new CodeMemberProperty { - Name = this.Name, - // FIXME: For now, no properties will be virtual... change this at some point? - Attributes = MemberAttributes.Public | MemberAttributes.Final, - Type = Getter.ReturnTypeReference - }; - - Getter.Visit (prop.GetStatements); - - if (Setter != null) - Setter.Visit (prop.SetStatements); - - decl.Members.Add (prop); - return prop; - } - - public override void Write (TextWriter writer) - { - throw new NotImplementedException (); - } - } -} - diff --git a/src/Mono.VisualC.Code/Atoms/Union.cs b/src/Mono.VisualC.Code/Atoms/Union.cs deleted file mode 100644 index 88eacbee..00000000 --- a/src/Mono.VisualC.Code/Atoms/Union.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.IO; -using System.CodeDom; -using System.Reflection; -using System.Runtime.InteropServices; - -namespace Mono.VisualC.Code.Atoms { - - public class Union : CodeContainer { - - public Union (string name) - { - Name = name; - } - - public CodeTypeDeclaration CreateUnionType () - { - var union = new CodeTypeDeclaration (Name) { - Attributes = MemberAttributes.Public, - TypeAttributes = TypeAttributes.Public, - IsStruct = true - }; -// var explicitLayout = new CodeAttributeArgument (new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (typeof (short)), (short)LayoutKind.Explicit)); - union.CustomAttributes.Add (new CodeAttributeDeclaration (new CodeTypeReference (typeof (StructLayoutAttribute)), new CodeAttributeArgument (new CodePrimitiveExpression ((short)LayoutKind.Explicit)))); - - foreach (var atom in Atoms) { - Field field = atom as Field; - if (field == null) - throw new Exception ("Only Fields allowed in Union."); - - CodeMemberField cmf = field.InsideCodeTypeDeclaration (union) as CodeMemberField; - if (cmf != null) - cmf.CustomAttributes.Add (new CodeAttributeDeclaration (new CodeTypeReference (typeof (FieldOffsetAttribute)), new CodeAttributeArgument (new CodePrimitiveExpression (0)))); - } - - return union; - } - - internal protected override object InsideCodeNamespace (CodeNamespace ns) - { - ns.Types.Add (CreateUnionType ()); - return null; - } - - internal protected override object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - if (!decl.IsClass) - return null; - - decl.Members.Add (CreateUnionType ()); - return null; - } - - public override void Write (TextWriter writer) - { - writer.WriteLine ("union {0} {{", Name); - base.Write (writer); - writer.WriteLine ("}"); - } - } -} - diff --git a/src/Mono.VisualC.Code/CodeAtom.cs b/src/Mono.VisualC.Code/CodeAtom.cs deleted file mode 100644 index b004db66..00000000 --- a/src/Mono.VisualC.Code/CodeAtom.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; - -using System.CodeDom; -using System.CodeDom.Compiler; - -namespace Mono.VisualC.Code { - - public abstract class CodeAtom { - - public string Comment { get; set; } - public bool CommentedOut { get; set; } - - [ThreadStatic] - protected static CodeDomProvider current_code_provider; - - internal protected virtual void Visit (object obj) - { - object result = obj; - - while (result != null) { - if (result is CodeCompileUnit) { result = InsideCodeCompileUnit (result as CodeCompileUnit); continue; } - if (result is CodeNamespace) { result = InsideCodeNamespace (result as CodeNamespace); continue; } - if (result is CodeTypeDeclaration) { result = InsideCodeTypeDeclaration (result as CodeTypeDeclaration); continue; } - if (result is CodeMemberMethod) { result = InsideCodeStatementCollection (((CodeMemberMethod)result).Statements); continue; } - if (result is CodeStatementCollection) { result = InsideCodeStatementCollection (result as CodeStatementCollection); continue; } - break; - } - } - - internal protected virtual object InsideCodeCompileUnit (CodeCompileUnit ccu) - { - return null; - } - - internal protected virtual object InsideCodeNamespace (CodeNamespace ns) - { - return null; - } - - internal protected virtual object InsideCodeTypeDeclaration (CodeTypeDeclaration decl) - { - return null; - } - - internal protected virtual object InsideCodeStatementCollection (CodeStatementCollection stmts) - { - return null; - } - public abstract void Write (TextWriter writer); - } -} - diff --git a/src/Mono.VisualC.Code/CodeContainer.cs b/src/Mono.VisualC.Code/CodeContainer.cs deleted file mode 100644 index 8729fff8..00000000 --- a/src/Mono.VisualC.Code/CodeContainer.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Collections.Generic; - -using System.CodeDom; -using System.CodeDom.Compiler; - -using Mono.VisualC.Code.Atoms; - -namespace Mono.VisualC.Code { - - public abstract class CodeContainer : CodeAtom { - - private LinkedList containedAtoms; - public string IndentString {get; set;} - public string Name { get; set; } - - public CodeContainer (string indentString) - { - containedAtoms = new LinkedList (); - IndentString = indentString; - } - - public CodeContainer() : this("\t") - { - } - - public virtual LinkedList Atoms { - get { return containedAtoms; } - } - - - // Convenience method - public virtual void AddToNamespace (string name, CodeAtom atom) - { - Namespace ns = Atoms.OfType ().Where (n => n.Name == name).SingleOrDefault (); - if (ns == null) { - ns = new Namespace (name); - Atoms.AddLast (ns); - } - - ns.Atoms.AddLast (atom); - } - - public override void Write (TextWriter writer) - { - IndentedTextWriter itw = new IndentedTextWriter (writer, IndentString); - itw.Indent = 1; - foreach (CodeAtom atom in containedAtoms) { - atom.Write (itw); - } - } - - } -} - diff --git a/src/Mono.VisualC.Code/CodeDomExtensions.cs b/src/Mono.VisualC.Code/CodeDomExtensions.cs deleted file mode 100644 index a30f95d2..00000000 --- a/src/Mono.VisualC.Code/CodeDomExtensions.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Text; -using System.CodeDom; -using System.CodeDom.Compiler; - -using Mono.VisualC.Interop; - -namespace Mono.VisualC.Code { - - internal delegate void CodeGenMethod (T codeObject, TextWriter writer, CodeGeneratorOptions cgo); - public static class CodeDomExtensions { - - public static CodeComment CommentOut (this CodeTypeMember code, CodeDomProvider provider) - { - // FIXME: Not implemented in mono - try { - return CommentOut (provider.GenerateCodeFromMember, code); - } catch (NotImplementedException) {} - - return new CodeComment (); - } - public static CodeComment CommentOut (this CodeStatement code, CodeDomProvider provider) - { - return CommentOut (provider.GenerateCodeFromStatement, code); - } - public static CodeComment CommentOut (this CodeExpression code, CodeDomProvider provider) - { - return CommentOut (provider.GenerateCodeFromExpression, code); - } - - private static CodeComment CommentOut (CodeGenMethod method, T codeObject) - { - StringWriter output = new StringWriter (); - CodeGeneratorOptions opts = new CodeGeneratorOptions (); - - method (codeObject, output, opts); - - return new CodeComment (output.ToString ()); - } - - public static CodeTypeReference TypeReference (this CodeTypeDeclaration ctd) - { - return new CodeTypeReference (ctd.Name, ctd.TypeParameterReferences ()); - } - - public static CodeTypeReference TypeReference (this CppType t) - { - return t.TypeReference (false); - } - - public static CodeTypeReference TypeReference (this CppType t, bool useManagedType) - { - var tempParm = from m in t.Modifiers.OfType () - from p in m.Types - select p.TypeReference (true); - - Type managedType = useManagedType && (t.ElementType != CppTypes.Typename)? t.ToManagedType () : null; - - if ((managedType == null || managedType == typeof (ICppObject)) && t.ElementTypeName != null) { - string qualifiedName = t.Namespaces != null? string.Join (".", t.Namespaces) + "." + t.ElementTypeName : t.ElementTypeName; - return new CodeTypeReference (qualifiedName, tempParm.ToArray ()); - } else if (managedType != null) - return new CodeTypeReference (managedType.FullName, tempParm.ToArray ()); - - return null; - } - - public static CodeTypeReference [] TypeParameterReferences (this CodeTypeDeclaration ctd) - { - return ctd.TypeParameters.Cast ().Select (p => new CodeTypeReference (p)).ToArray (); - } - - } -} - diff --git a/src/Mono.VisualC.Code/CodeUnit.cs b/src/Mono.VisualC.Code/CodeUnit.cs deleted file mode 100644 index 8602282e..00000000 --- a/src/Mono.VisualC.Code/CodeUnit.cs +++ /dev/null @@ -1,79 +0,0 @@ - -using System; -using System.IO; -using System.Collections.Generic; - -using System.CodeDom; -using System.CodeDom.Compiler; - -namespace Mono.VisualC.Code { - public class CodeUnit : CodeContainer { - - public string ManagedNamespace { get; set; } - - public CodeUnit () : base (string.Empty) - { - } - - public virtual CodeCompileUnit WrapperToCodeDom (CodeDomProvider provider) - { - CodeCompileUnit ccu = new CodeCompileUnit (); - ccu.UserData ["CodeAtom"] = this; - - current_code_provider = provider; - Visit (ccu); - current_code_provider = null; - - return ccu; - } - - internal protected override object InsideCodeCompileUnit (CodeCompileUnit ccu) - { - CodeNamespace ns = new CodeNamespace (ManagedNamespace); - ns.Imports.Add (new CodeNamespaceImport ("System")); - ns.Imports.Add (new CodeNamespaceImport ("System.Runtime.InteropServices")); - ns.Imports.Add (new CodeNamespaceImport ("Mono.VisualC.Interop")); - - ns.UserData ["CodeCompileUnit"] = ccu; - - ccu.Namespaces.Add (ns); - return ns; - } - - internal protected override object InsideCodeNamespace (CodeNamespace ns) - { - foreach (var atom in Atoms) - atom.Visit (ns); - - return null; - } - - public override string ToString () - { - StringWriter str = new StringWriter (); - Write (str); - return str.ToString (); - } - - public override void Write (TextWriter writer) - { - writer.WriteLine ("//------------------------------------------------------------------------------"); - writer.WriteLine ("// "); - writer.WriteLine ("// This code was generated by a tool."); - writer.WriteLine ("// Runtime Version:{0}{1}//", Environment.Version, writer.NewLine); - writer.WriteLine ("// Changes to this file may cause incorrect behavior and will be lost if"); - writer.WriteLine ("// the code is regenerated."); - writer.WriteLine ("// "); - writer.WriteLine ("//------------------------------------------------------------------------------{0}", writer.NewLine); - - base.Write (writer); - } - - public virtual void Save (string fileName) - { - using (StreamWriter stream = File.CreateText (fileName)) { - Write (stream); - } - } - } -} diff --git a/src/Mono.VisualC.Code/Makefile.am b/src/Mono.VisualC.Code/Makefile.am deleted file mode 100644 index 11f46573..00000000 --- a/src/Mono.VisualC.Code/Makefile.am +++ /dev/null @@ -1,100 +0,0 @@ - -EXTRA_DIST = m4/expansions.m4 - -if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = mcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG" -BUILD_DIR = $(top_srcdir)/bin/Debug - -ASSEMBLY = $(BUILD_DIR)/Mono.VisualC.Code.dll -ASSEMBLY_MDB = $(ASSEMBLY).mdb - -MONO_VISUALC_INTEROP_DLL_SOURCE=$(BUILD_DIR)/Mono.VisualC.Interop.dll -MONO_VISUALC_INTEROP_DLL=$(BUILD_DIR)/Mono.VisualC.Interop.dll -MONO_VISUALC_CODE_DLL_MDB_SOURCE=$(BUILD_DIR)/Mono.VisualC.Code.dll.mdb -MONO_VISUALC_CODE_DLL_MDB=$(BUILD_DIR)/Mono.VisualC.Code.dll.mdb - -endif - -if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = mcs -ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -BUILD_DIR = $(top_srcdir)/bin/Release - -ASSEMBLY = $(BUILD_DIR)/Mono.VisualC.Code.dll -ASSEMBLY_MDB = - -MONO_VISUALC_INTEROP_DLL_SOURCE=$(BUILD_DIR)/Mono.VisualC.Interop.dll -MONO_VISUALC_INTEROP_DLL=$(BUILD_DIR)/Mono.VisualC.Interop.dll -MONO_VISUALC_CODE_DLL_MDB= - -endif - -COMPILE_TARGET = library - -AL=al2 -SATELLITE_ASSEMBLY_NAME=$(notdir $(basename $(ASSEMBLY))).resources.dll - -PROGRAMFILES = \ - $(MONO_VISUALC_INTEROP_DLL) \ - $(MONO_VISUALC_CODE_DLL_MDB) - -LINUX_PKGCONFIG = \ - $(MONO_VISUALC_CODE_PC) - - -RESGEN=resgen2 - -all: $(ASSEMBLY) $(PROGRAMFILES) $(LINUX_PKGCONFIG) - -FILES = \ - Access.cs \ - AssemblyInfo.cs \ - Atoms/Class.cs \ - Atoms/Enumeration.cs \ - Atoms/Field.cs \ - Atoms/Method.cs \ - Atoms/Namespace.cs \ - Atoms/Preprocessor.cs \ - Atoms/Property.cs \ - Atoms/Union.cs \ - CodeAtom.cs \ - CodeContainer.cs \ - CodeDomExtensions.cs \ - CodeUnit.cs \ - NameTypePair.cs - -DATA_FILES = - -RESOURCES = - -EXTRAS = \ - Atoms \ - mono.visualc.code.pc.in - -REFERENCES = \ - ../../bin/Debug/Mono.VisualC.Interop.dll \ - System \ - System.Core - -DLL_REFERENCES = - -CLEANFILES = $(PROGRAMFILES) $(LINUX_PKGCONFIG) - -include $(top_srcdir)/Makefile.include - -MONO_VISUALC_CODE_PC = $(BUILD_DIR)/mono.visualc.code.pc - -$(eval $(call emit-deploy-target,MONO_VISUALC_INTEROP_DLL)) -$(eval $(call emit-deploy-wrapper,MONO_VISUALC_CODE_PC,mono.visualc.code.pc)) - - -$(eval $(call emit_resgen_targets)) -$(build_xamlg_list): %.xaml.g.cs: %.xaml - xamlg '$<' - -$(ASSEMBLY_MDB): $(ASSEMBLY) - -$(ASSEMBLY): $(build_sources) $(build_resources) $(build_datafiles) $(DLL_REFERENCES) $(build_xamlg_list) $(build_satellite_assembly_list) - mkdir -p $(shell dirname $(ASSEMBLY)) - $(ASSEMBLY_COMPILER_COMMAND) $(ASSEMBLY_COMPILER_FLAGS) -out:$(ASSEMBLY) -target:$(COMPILE_TARGET) $(build_sources_embed) $(build_resources_embed) $(build_references_ref) diff --git a/src/Mono.VisualC.Code/Mono.VisualC.Code.csproj b/src/Mono.VisualC.Code/Mono.VisualC.Code.csproj deleted file mode 100644 index ab2ce988..00000000 --- a/src/Mono.VisualC.Code/Mono.VisualC.Code.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180} - Library - Mono.VisualC.Code - Mono.VisualC.Code - v3.5 - - - - - 2.0 - http://localhost/Mono.VisualC.Code/ - true - Web - true - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - true - false - true - - - true - full - false - ..\..\bin\Debug - DEBUG - prompt - 4 - false - AllRules.ruleset - - - none - false - ..\..\bin\Release - prompt - 4 - false - AllRules.ruleset - - - - - - False - ..\..\bin\Debug\Mono.VisualC.Interop.dll - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Mono.VisualC.Code/Mono.VisualC.Code.sln b/src/Mono.VisualC.Code/Mono.VisualC.Code.sln deleted file mode 100644 index 5a6a5837..00000000 --- a/src/Mono.VisualC.Code/Mono.VisualC.Code.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.VisualC.Code", "Mono.VisualC.Code.csproj", "{A22BF9D9-BBCB-4462-BE08-0F4D5280B180}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A22BF9D9-BBCB-4462-BE08-0F4D5280B180}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - StartupItem = Mono.VisualC.Code.csproj - EndGlobalSection -EndGlobal diff --git a/src/Mono.VisualC.Code/NameTypePair.cs b/src/Mono.VisualC.Code/NameTypePair.cs deleted file mode 100644 index 09cc2536..00000000 --- a/src/Mono.VisualC.Code/NameTypePair.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -namespace Mono.VisualC.Code { - - public struct NameTypePair { - public string Name; - public TType Type; - } -} - diff --git a/src/Mono.VisualC.Code/mono.visualc.code.pc.in b/src/Mono.VisualC.Code/mono.visualc.code.pc.in deleted file mode 100644 index da4e64bb..00000000 --- a/src/Mono.VisualC.Code/mono.visualc.code.pc.in +++ /dev/null @@ -1,6 +0,0 @@ -Name: Mono.VisualC.Code -Description: Mono.VisualC.Code -Version: 0.1 - -Requires: -Libs: -r:@expanded_libdir@/@PACKAGE@/Mono.VisualC.Code.dll diff --git a/src/generator/generator.csproj b/src/generator/generator.csproj index be4c5db9..00d8e02a 100644 --- a/src/generator/generator.csproj +++ b/src/generator/generator.csproj @@ -67,7 +67,7 @@ - + False ..\..\bin\Debug\Mono.VisualC.Interop.dll