23464e6514
[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
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
|
|
namespace GtkSharp {
|
|
|
|
using System;
|
|
using System.Collections;
|
|
public delegate void GtkClipboardGetFuncNative(IntPtr clipboard, ref Gtk.SelectionData selection_data, uint info, uint obj_id);
|
|
|
|
public class GtkClipboardGetFuncWrapper : GLib.DelegateWrapper {
|
|
|
|
public void NativeCallback (IntPtr clipboard, ref Gtk.SelectionData selection_data, uint info, uint obj_id)
|
|
{
|
|
if (RemoveIfNotAlive ()) return;
|
|
object[] _args = new object[4];
|
|
_args[0] = (Gtk.Clipboard) GLib.Object.GetObject(clipboard, false);
|
|
if (_args[0] == null)
|
|
_args[0] = new Gtk.Clipboard(clipboard);
|
|
_args[1] = selection_data;
|
|
_args[2] = info;
|
|
_args[3] = Gtk.Clipboard.clipboard_objects[obj_id];
|
|
|
|
_managed ((Gtk.Clipboard) _args[0], ref selection_data, (uint) _args[2], _args[3]);
|
|
}
|
|
|
|
public GtkClipboardGetFuncNative NativeDelegate;
|
|
protected Gtk.ClipboardGetFunc _managed;
|
|
|
|
public GtkClipboardGetFuncWrapper (Gtk.ClipboardGetFunc managed, object o) : base (o)
|
|
{
|
|
NativeDelegate = new GtkClipboardGetFuncNative (NativeCallback);
|
|
_managed = managed;
|
|
}
|
|
}
|
|
|
|
}
|