2005-05-04 Mike Kestner <mkestner@novell.com>

* glib/Signal.cs : s/DestroyNotify/SignalDestroyNotify to fix mcs 1.0
	compilation.
	* gdk/Input.custom : ditto.

svn path=/trunk/gtk-sharp/; revision=44046
This commit is contained in:
Mike Kestner 2005-05-04 20:36:55 +00:00
parent fdbb151684
commit b957224b9f
3 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2005-05-04 Mike Kestner <mkestner@novell.com>
* glib/Signal.cs : s/DestroyNotify/SignalDestroyNotify to fix mcs 1.0
compilation.
* gdk/Input.custom : ditto.
2005-05-04 Todd Berman <tberman@off.net>
* glade/XML.custom: Store the callback wrapper so it doesn't get GC'd.

View File

@ -21,7 +21,7 @@
// Boston, MA 02111-1307, USA.
[GLib.CDeclCallback]
delegate void DestroyNotify (IntPtr data);
delegate void InputDestroyNotify (IntPtr data);
static void ReleaseGCHandle (IntPtr data)
{
@ -32,16 +32,16 @@
gch.Free ();
}
static DestroyNotify release_gchandle;
static InputDestroyNotify release_gchandle;
[DllImport("libgdk-win32-2.0-0.dll")]
static extern int gdk_input_add_full (int source, int condition, GdkSharp.InputFunctionNative function, IntPtr data, DestroyNotify destroy);
static extern int gdk_input_add_full (int source, int condition, GdkSharp.InputFunctionNative function, IntPtr data, InputDestroyNotify destroy);
[Obsolete]
public static int AddFull (int source, Gdk.InputCondition condition, Gdk.InputFunction function, IntPtr data, Gdk.DestroyNotify destroy)
{
if (release_gchandle == null)
release_gchandle = new DestroyNotify (ReleaseGCHandle);
release_gchandle = new InputDestroyNotify (ReleaseGCHandle);
GdkSharp.InputFunctionWrapper function_wrapper = new GdkSharp.InputFunctionWrapper (function);
GCHandle gch = GCHandle.Alloc (function_wrapper);
return gdk_input_add_full (source, (int) condition, function_wrapper.NativeDelegate, (IntPtr) gch, release_gchandle);
@ -51,7 +51,7 @@
public static int Add (int source, Gdk.InputCondition condition, Gdk.InputFunction function)
{
if (release_gchandle == null)
release_gchandle = new DestroyNotify (ReleaseGCHandle);
release_gchandle = new InputDestroyNotify (ReleaseGCHandle);
GdkSharp.InputFunctionWrapper function_wrapper = new GdkSharp.InputFunctionWrapper (function);
GCHandle gch = GCHandle.Alloc (function_wrapper);
return gdk_input_add_full (source, (int) condition, function_wrapper.NativeDelegate, (IntPtr) gch, release_gchandle);

View File

@ -51,9 +51,9 @@ namespace GLib {
uint after_id = UInt32.MaxValue;
Delegate marshaler;
static DestroyNotify notify = new DestroyNotify (OnNativeDestroy);
static SignalDestroyNotify notify = new SignalDestroyNotify (OnNativeDestroy);
[CDeclCallback]
delegate void DestroyNotify (IntPtr data, IntPtr obj);
delegate void SignalDestroyNotify (IntPtr data, IntPtr obj);
static void OnNativeDestroy (IntPtr data, IntPtr obj)
{
GCHandle gch = (GCHandle) data;
@ -191,7 +191,7 @@ namespace GLib {
static extern void g_object_set_data (IntPtr instance, IntPtr key, IntPtr data);
[DllImport("libgobject-2.0-0.dll")]
static extern void g_object_set_data_full (IntPtr instance, IntPtr key, IntPtr data, DestroyNotify notify);
static extern void g_object_set_data_full (IntPtr instance, IntPtr key, IntPtr data, SignalDestroyNotify notify);
[DllImport("libgobject-2.0-0.dll")]
static extern uint g_signal_connect_data(IntPtr obj, IntPtr name, Delegate cb, IntPtr gc_handle, IntPtr dummy, int flags);