2007-04-12 Mike Kestner <mkestner@novell.com>

* glib/Idle.cs :
	* glib/Timeout.cs : don't add the CDeclCallback attr to the
	public delegate type, since it causes a MissingMethod exception
	on win32.

svn path=/trunk/gtk-sharp/; revision=75656
This commit is contained in:
Mike Kestner 2007-04-12 17:57:50 +00:00
parent 7142444f6c
commit a8b11a7445
3 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2007-04-12 Mike Kestner <mkestner@novell.com>
* glib/Idle.cs :
* glib/Timeout.cs : don't add the CDeclCallback attr to the
public delegate type, since it causes a MissingMethod exception
on win32.
2007-04-09 Brad Taylor <brad@getcoded.net>
* gtk/glue/widget.c:

View File

@ -27,16 +27,19 @@ namespace GLib {
using System.Collections;
using System.Runtime.InteropServices;
[CDeclCallback]
public delegate bool IdleHandler ();
public class Idle {
[CDeclCallback]
delegate bool IdleHandlerInternal ();
internal class IdleProxy : SourceProxy {
public IdleProxy (IdleHandler real)
{
real_handler = real;
proxy_handler = new IdleHandler (Handler);
proxy_handler = new IdleHandlerInternal (Handler);
}
public bool Handler ()
@ -60,12 +63,12 @@ namespace GLib {
}
[DllImport("libglib-2.0-0.dll")]
static extern uint g_idle_add (IdleHandler d, IntPtr data);
static extern uint g_idle_add (IdleHandlerInternal d, IntPtr data);
public static uint Add (IdleHandler hndlr)
{
IdleProxy p = new IdleProxy (hndlr);
uint code = g_idle_add ((IdleHandler) p.proxy_handler, IntPtr.Zero);
uint code = g_idle_add ((IdleHandlerInternal) p.proxy_handler, IntPtr.Zero);
lock (Source.source_handlers)
Source.source_handlers [code] = p;

View File

@ -24,16 +24,18 @@ namespace GLib {
using System;
using System.Runtime.InteropServices;
[CDeclCallback]
public delegate bool TimeoutHandler ();
public class Timeout {
[CDeclCallback]
delegate bool TimeoutHandlerInternal ();
internal class TimeoutProxy : SourceProxy {
public TimeoutProxy (TimeoutHandler real)
{
real_handler = real;
proxy_handler = new TimeoutHandler (Handler);
proxy_handler = new TimeoutHandlerInternal (Handler);
}
public bool Handler ()
@ -54,13 +56,13 @@ namespace GLib {
private Timeout () {}
[DllImport("libglib-2.0-0.dll")]
static extern uint g_timeout_add (uint interval, TimeoutHandler d, IntPtr data);
static extern uint g_timeout_add (uint interval, TimeoutHandlerInternal d, IntPtr data);
public static uint Add (uint interval, TimeoutHandler hndlr)
{
TimeoutProxy p = new TimeoutProxy (hndlr);
uint code = g_timeout_add (interval, (TimeoutHandler) p.proxy_handler, IntPtr.Zero);
uint code = g_timeout_add (interval, (TimeoutHandlerInternal) p.proxy_handler, IntPtr.Zero);
lock (Source.source_handlers)
Source.source_handlers [code] = p;