GtkSharp/gtk/GtkSharp.GtkClipboardClearFuncNative.cs
Mike Kestner 23464e6514 2003-07-23 Mike Kestner <mkestner@ximian.com>
[Equal credit to Ettore Perazzoli <ettore@ximian.com> for fixing
	all the bugs in the initial patch]
	* */*.custom : fix incorrect usage of new Object (IntPtr) where
	Glib.Object.GetObject should've been used.  add ref_owned param
	to GetObject calls.
	* generator/CallbackGen.cs : setup ref_owned in bodies
	* generator/ClassBase.cs : add ref_owned to GetObject FromNative call
	* generator/Method.cs : setup ref_owned in bodies
	* generator/Property.cs : setup ref_owned in bodies
	* generator/SignalHandler.cs : pass ref_owned to GetObject
	* generator/StructBase.cs : setup ref_owned in bodies
	* glib/Object.cs : kill Ref/Unref methods.  Don't want it to be
	easy for users to screw with ref counts, or make it look like they
	should need to.
	(GetObject): add ref_owned param and ref/unref to remain at 1
	* glib/Value.cs : pass ref_owned to GetObject

svn path=/trunk/gtk-sharp/; revision=16581
2003-07-23 17:19:21 +00:00

33 lines
992 B
C#

namespace GtkSharp {
using System;
using System.Collections;
public delegate void GtkClipboardClearFuncNative(IntPtr clipboard, uint objid);
public class GtkClipboardClearFuncWrapper : GLib.DelegateWrapper {
public void NativeCallback (IntPtr clipboard, uint objid)
{
if (RemoveIfNotAlive ()) return;
object[] _args = new object[2];
_args[0] = (Gtk.Clipboard) GLib.Object.GetObject(clipboard, false);
if (_args[0] == null)
_args[0] = new Gtk.Clipboard(clipboard);
_args[1] = Gtk.Clipboard.clipboard_objects[objid];
_managed ((Gtk.Clipboard) _args[0], _args[1]);
Gtk.Clipboard.clipboard_objects.Remove (objid);
}
public GtkClipboardClearFuncNative NativeDelegate;
protected Gtk.ClipboardClearFunc _managed;
public GtkClipboardClearFuncWrapper (Gtk.ClipboardClearFunc managed, object o) : base (o)
{
NativeDelegate = new GtkClipboardClearFuncNative (NativeCallback);
_managed = managed;
}
}
}