From 74756f2c2adb2d244244e464c0c8be31441af10b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 2 Jun 2009 12:34:18 +0200 Subject: [PATCH] Add MiniObject code generator specific cases at more places --- generator/Ctor.cs | 2 +- generator/DefaultSignalHandler.cs | 2 ++ generator/Method.cs | 2 +- generator/ReturnValue.cs | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/generator/Ctor.cs b/generator/Ctor.cs index 776b084c33..e4ef118176 100644 --- a/generator/Ctor.cs +++ b/generator/Ctor.cs @@ -37,7 +37,7 @@ namespace GtkSharp.Generation { { if (elem.HasAttribute ("preferred")) preferred = true; - if (implementor is ObjectGen) + if (implementor is ObjectGen || implementor is MiniObjectGen) needs_chaining = true; name = implementor.Name; } diff --git a/generator/DefaultSignalHandler.cs b/generator/DefaultSignalHandler.cs index 989310808b..2c73d71722 100644 --- a/generator/DefaultSignalHandler.cs +++ b/generator/DefaultSignalHandler.cs @@ -124,6 +124,8 @@ namespace GtkSharp.Generation { if (igen is ObjectGen) return "GLib.GType.Object"; + if (igen is MiniObjectGen) + return "Gst.MiniObject.GType"; if (igen is BoxedGen) return retval.CSType + ".GType"; if (igen is EnumGen) diff --git a/generator/Method.cs b/generator/Method.cs index 1492bc4639..50d6e9c13b 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -118,7 +118,7 @@ namespace GtkSharp.Generation { if (Name == "ToString" && Parameters.Count == 0) sw.Write("override "); - else if (Name == "GetGType" && container_type is ObjectGen) + else if (Name == "GetGType" && (container_type is ObjectGen || container_type is MiniObjectGen)) sw.Write("new "); else if (Modifiers == "new " || (dup != null && ((dup.Signature != null && Signature != null && dup.Signature.ToString() == Signature.ToString()) || (dup.Signature == null && Signature == null)))) sw.Write("new "); diff --git a/generator/ReturnValue.cs b/generator/ReturnValue.cs index bbf0c29050..999f95896d 100644 --- a/generator/ReturnValue.cs +++ b/generator/ReturnValue.cs @@ -146,7 +146,7 @@ namespace GtkSharp.Generation { if (IGen is IManualMarshaler) return (IGen as IManualMarshaler).AllocNative (var); - else if (IGen is ObjectGen && owned) + else if ((IGen is ObjectGen || IGen is MiniObjectGen) && owned) return var + " == null ? IntPtr.Zero : " + var + ".OwnedHandle"; else if (IGen is OpaqueGen && owned) return var + " == null ? IntPtr.Zero : " + var + ".OwnedCopy"; -- 2.34.1