diff --git a/ChangeLog b/ChangeLog index 966a50981..65051f53a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-19 Christian Hoff + + * generator/*.cs: Add the "partial" keyword to each generated class, + struct and interface. + 2009-08-19 Christian Hoff * glib/MainContext.cs: Add API to create new MainContexts. Add a few diff --git a/generator/ClassGen.cs b/generator/ClassGen.cs index 700a27a1e..d36c77db3 100644 --- a/generator/ClassGen.cs +++ b/generator/ClassGen.cs @@ -73,7 +73,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("#region Autogenerated code"); if (IsDeprecated) sw.WriteLine ("\t[Obsolete]"); - sw.Write ("\t{0} class " + Name, IsInternal ? "internal" : "public"); + sw.Write ("\t{0} partial class " + Name, IsInternal ? "internal" : "public"); sw.WriteLine (" {"); sw.WriteLine (); diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index c3f80f34a..759485a6e 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -230,7 +230,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\tusing System.Runtime.InteropServices;"); sw.WriteLine (); sw.WriteLine ("#region Autogenerated code"); - sw.WriteLine ("\tpublic class " + Name + "Adapter : GLib.GInterfaceAdapter, " + QualifiedName + " {"); + sw.WriteLine ("\tpublic partial class " + Name + "Adapter : GLib.GInterfaceAdapter, " + QualifiedName + " {"); sw.WriteLine (); if (!IsConsumeOnly) { @@ -277,7 +277,7 @@ namespace GtkSharp.Generation { sw.WriteLine (); sw.WriteLine ("\t[GLib.GInterface (typeof (" + Name + "Adapter))]"); string access = IsInternal ? "internal" : "public"; - sw.WriteLine ("\t" + access + " interface " + Name + "Implementor : GLib.IWrapper {"); + sw.WriteLine ("\t" + access + " partial interface " + Name + "Implementor : GLib.IWrapper {"); sw.WriteLine (); Hashtable vm_table = new Hashtable (); foreach (InterfaceVM vm in interface_vms) { @@ -323,7 +323,7 @@ namespace GtkSharp.Generation { sw.WriteLine (); sw.WriteLine ("#region Autogenerated code"); string access = IsInternal ? "internal" : "public"; - sw.WriteLine ("\t" + access + " interface " + Name + " : GLib.IWrapper {"); + sw.WriteLine ("\t" + access + " partial interface " + Name + " : GLib.IWrapper {"); sw.WriteLine (); foreach (Signal sig in sigs.Values) { diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index e70b94bb5..0bd73fa53 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -150,7 +150,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t[Obsolete]"); foreach (string attr in custom_attrs) sw.WriteLine ("\t" + attr); - sw.Write ("\t{0} {1}class " + Name, IsInternal ? "internal" : "public", IsAbstract ? "abstract " : ""); + sw.Write ("\t{0} partial {1}class " + Name, IsInternal ? "internal" : "public", IsAbstract ? "abstract " : ""); string cs_parent = table.GetCSType(Elem.GetAttribute("parent")); if (cs_parent != "") { di.objects.Add (CName, QualifiedName); diff --git a/generator/OpaqueGen.cs b/generator/OpaqueGen.cs index 55735415c..a46008822 100644 --- a/generator/OpaqueGen.cs +++ b/generator/OpaqueGen.cs @@ -63,7 +63,7 @@ namespace GtkSharp.Generation { if (IsDeprecated) sw.WriteLine ("\t[Obsolete]"); - sw.Write ("\t{0}{1}class " + Name, IsInternal ? "internal " : "public ", IsAbstract ? "abstract " : String.Empty); + sw.Write ("\t{0} partial {1}class " + Name, IsInternal ? "internal" : "public", IsAbstract ? "abstract " : String.Empty); string cs_parent = table.GetCSType(Elem.GetAttribute("parent")); if (cs_parent != "") sw.Write (" : " + cs_parent); diff --git a/generator/StructBase.cs b/generator/StructBase.cs index 7e1b87aa0..6c7cd0454 100644 --- a/generator/StructBase.cs +++ b/generator/StructBase.cs @@ -160,7 +160,7 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t[Obsolete]"); sw.WriteLine ("\t[StructLayout(LayoutKind.Sequential)]"); string access = IsInternal ? "internal" : "public"; - sw.WriteLine ("\t" + access + " struct " + Name + " {"); + sw.WriteLine ("\t" + access + " partial struct " + Name + " {"); sw.WriteLine (); need_read_native = false;