2003-10-17 22:31:46 +00:00
|
|
|
// Gtk.Object.custom - Gtk Object class customizations
|
2002-09-04 05:25:58 +00:00
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
2004-06-25 18:42:19 +00:00
|
|
|
// Copyright (c) 2002-2003 Mike Kestner
|
2002-09-04 05:25:58 +00:00
|
|
|
//
|
|
|
|
// This code is inserted after the automatically generated code.
|
2004-06-25 18:42:19 +00:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of version 2 of the Lesser GNU General
|
|
|
|
// Public License as published by the Free Software Foundation.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this program; if not, write to the
|
|
|
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
// Boston, MA 02111-1307, USA.
|
|
|
|
|
2002-09-04 05:25:58 +00:00
|
|
|
|
2004-12-07 19:03:55 +00:00
|
|
|
[DllImport("gtksharpglue-2")]
|
2002-11-10 10:03:51 +00:00
|
|
|
private static extern bool gtksharp_object_is_floating (IntPtr raw);
|
2002-09-12 05:21:16 +00:00
|
|
|
|
2004-12-07 19:03:55 +00:00
|
|
|
[DllImport("gtksharpglue-2")]
|
2004-09-29 18:45:59 +00:00
|
|
|
private static extern bool gtksharp_object_set_floating (IntPtr raw, bool val);
|
|
|
|
|
2003-07-23 17:19:21 +00:00
|
|
|
[DllImport("libgobject-2.0-0.dll")]
|
|
|
|
private static extern void g_object_ref (IntPtr raw);
|
|
|
|
|
2002-11-10 10:03:51 +00:00
|
|
|
protected override IntPtr Raw {
|
|
|
|
get {
|
|
|
|
return base.Raw;
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
base.Raw = value;
|
2004-04-07 19:15:01 +00:00
|
|
|
if (value == IntPtr.Zero)
|
|
|
|
return;
|
|
|
|
|
2003-07-23 17:19:21 +00:00
|
|
|
if (gtksharp_object_is_floating (value)) {
|
|
|
|
g_object_ref (value);
|
2002-11-10 10:03:51 +00:00
|
|
|
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);
|
|
|
|
}
|
2002-09-12 05:21:16 +00:00
|
|
|
}
|
2004-09-29 18:45:59 +00:00
|
|
|
|
2004-12-17 23:21:53 +00:00
|
|
|
[DllImport("libgtk-win32-2.0-0.dll")]
|
|
|
|
private static extern void gtk_object_destroy (IntPtr raw);
|
|
|
|
|
|
|
|
public virtual void Destroy ()
|
|
|
|
{
|
|
|
|
gtk_object_destroy (Handle);
|
|
|
|
}
|
|
|
|
|
2004-09-29 18:45:59 +00:00
|
|
|
public bool IsFloating {
|
|
|
|
get {
|
|
|
|
return gtksharp_object_is_floating (Handle);
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
gtksharp_object_set_floating (Handle, value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|