mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
![Mike Kestner](/assets/img/avatar_default.png)
* generator/ClassBase.cs : remove default ctor generation and hasDefaultConstructor field. * generator/Ctor.cs : chain to base (IntPtr.Zero). * generator/StructBase.cs : remove hasDefaultConstructor usage. * glib/Object.cs : remove Object () ctor. Add Ben's GetGType method, although nothing uses it yet. Still working on integrating the remainder of Ben's patch. * gtk/Gtk.metadata : remove all the disabledefaultctor rules. * */*.custom : add base (IntPtr.Zero) or this (...) chaining for all ctors. svn path=/trunk/gtk-sharp/; revision=25184
31 lines
831 B
Plaintext
Executable File
31 lines
831 B
Plaintext
Executable File
// Gtk.Object.custom - Gtk Object class customizations
|
|
//
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
//
|
|
// (c) 2002-2003 Mike Kestner
|
|
//
|
|
// This code is inserted after the automatically generated code.
|
|
|
|
[DllImport("gtksharpglue")]
|
|
private static extern bool gtksharp_object_is_floating (IntPtr raw);
|
|
|
|
[DllImport("libgobject-2.0-0.dll")]
|
|
private static extern void g_object_ref (IntPtr raw);
|
|
|
|
protected override IntPtr Raw {
|
|
get {
|
|
return base.Raw;
|
|
}
|
|
set {
|
|
base.Raw = value;
|
|
if (value == IntPtr.Zero)
|
|
return;
|
|
|
|
if (gtksharp_object_is_floating (value)) {
|
|
g_object_ref (value);
|
|
Sink ();
|
|
}
|
|
// System.Diagnostics.Debug.WriteLine ("Gtk.Object:set_Raw: object type is: " + (this as GLib.Object).GType.Name + " refcount now: " + RefCount + " needs_ref: " + needs_ref);
|
|
}
|
|
}
|