mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-16 11:34:47 +02:00
2007-07-19 Mike Kestner <mkestner@novell.com>
* generator/OpaqueGen.cs : override the new Copy vm if a Copy method exists for the type. * glib/Opaque.cs : add a virtual method to allow subclasses with Copy methods to override. Use the method in GetOpaque for unowned instantiations to try to obtain an owned instance. [Fixes #82037] svn path=/trunk/gtk-sharp/; revision=82293
This commit is contained in:
parent
0951a97f5a
commit
a06235f02f
@ -1,3 +1,11 @@
|
|||||||
|
2007-07-19 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* generator/OpaqueGen.cs : override the new Copy vm if a Copy method
|
||||||
|
exists for the type.
|
||||||
|
* glib/Opaque.cs : add a virtual method to allow subclasses with
|
||||||
|
Copy methods to override. Use the method in GetOpaque for unowned
|
||||||
|
instantiations to try to obtain an owned instance. [Fixes #82037]
|
||||||
|
|
||||||
2007-07-18 Mike Kestner <mkestner@novell.com>
|
2007-07-18 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* gdk/EventExpose.cs : return a pointer from the get_area glue
|
* gdk/EventExpose.cs : return a pointer from the get_area glue
|
||||||
|
@ -129,6 +129,16 @@ namespace GtkSharp.Generation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Method copy = Methods ["Copy"] as Method;
|
||||||
|
if (copy != null) {
|
||||||
|
sw.WriteLine ("\t\tprotected override GLib.Opaque Copy (IntPtr raw)");
|
||||||
|
sw.WriteLine ("\t\t{");
|
||||||
|
sw.WriteLine ("\t\t\tGLib.Opaque result = new " + QualifiedName + " (" + copy.CName + " (raw));");
|
||||||
|
sw.WriteLine ("\t\t\tresult.Owned = true;");
|
||||||
|
sw.WriteLine ("\t\t\treturn result;");
|
||||||
|
sw.WriteLine ("\t\t}");
|
||||||
|
sw.WriteLine ();
|
||||||
|
}
|
||||||
sw.WriteLine ("#endregion");
|
sw.WriteLine ("#endregion");
|
||||||
|
|
||||||
AppendCustom(sw, gen_info.CustomDir);
|
AppendCustom(sw, gen_info.CustomDir);
|
||||||
|
@ -51,7 +51,9 @@ namespace GLib {
|
|||||||
opaque.Unref (o);
|
opaque.Unref (o);
|
||||||
}
|
}
|
||||||
opaque.owned = true;
|
opaque.owned = true;
|
||||||
}
|
} else
|
||||||
|
opaque = opaque.Copy (o);
|
||||||
|
|
||||||
return opaque;
|
return opaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +102,10 @@ namespace GLib {
|
|||||||
protected virtual void Ref (IntPtr raw) {}
|
protected virtual void Ref (IntPtr raw) {}
|
||||||
protected virtual void Unref (IntPtr raw) {}
|
protected virtual void Unref (IntPtr raw) {}
|
||||||
protected virtual void Free (IntPtr raw) {}
|
protected virtual void Free (IntPtr raw) {}
|
||||||
|
protected virtual Opaque Copy (IntPtr raw)
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public IntPtr Handle {
|
public IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
|
Loading…
Reference in New Issue
Block a user