mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
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:
parent
7142444f6c
commit
a8b11a7445
@ -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>
|
2007-04-09 Brad Taylor <brad@getcoded.net>
|
||||||
|
|
||||||
* gtk/glue/widget.c:
|
* gtk/glue/widget.c:
|
||||||
|
11
glib/Idle.cs
11
glib/Idle.cs
@ -27,16 +27,19 @@ namespace GLib {
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
[CDeclCallback]
|
|
||||||
public delegate bool IdleHandler ();
|
public delegate bool IdleHandler ();
|
||||||
|
|
||||||
public class Idle {
|
public class Idle {
|
||||||
|
|
||||||
|
[CDeclCallback]
|
||||||
|
delegate bool IdleHandlerInternal ();
|
||||||
|
|
||||||
|
|
||||||
internal class IdleProxy : SourceProxy {
|
internal class IdleProxy : SourceProxy {
|
||||||
public IdleProxy (IdleHandler real)
|
public IdleProxy (IdleHandler real)
|
||||||
{
|
{
|
||||||
real_handler = real;
|
real_handler = real;
|
||||||
proxy_handler = new IdleHandler (Handler);
|
proxy_handler = new IdleHandlerInternal (Handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Handler ()
|
public bool Handler ()
|
||||||
@ -60,12 +63,12 @@ namespace GLib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libglib-2.0-0.dll")]
|
[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)
|
public static uint Add (IdleHandler hndlr)
|
||||||
{
|
{
|
||||||
IdleProxy p = new IdleProxy (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)
|
lock (Source.source_handlers)
|
||||||
Source.source_handlers [code] = p;
|
Source.source_handlers [code] = p;
|
||||||
|
|
||||||
|
@ -24,16 +24,18 @@ namespace GLib {
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
[CDeclCallback]
|
|
||||||
public delegate bool TimeoutHandler ();
|
public delegate bool TimeoutHandler ();
|
||||||
|
|
||||||
public class Timeout {
|
public class Timeout {
|
||||||
|
|
||||||
|
[CDeclCallback]
|
||||||
|
delegate bool TimeoutHandlerInternal ();
|
||||||
|
|
||||||
internal class TimeoutProxy : SourceProxy {
|
internal class TimeoutProxy : SourceProxy {
|
||||||
public TimeoutProxy (TimeoutHandler real)
|
public TimeoutProxy (TimeoutHandler real)
|
||||||
{
|
{
|
||||||
real_handler = real;
|
real_handler = real;
|
||||||
proxy_handler = new TimeoutHandler (Handler);
|
proxy_handler = new TimeoutHandlerInternal (Handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Handler ()
|
public bool Handler ()
|
||||||
@ -54,13 +56,13 @@ namespace GLib {
|
|||||||
|
|
||||||
private Timeout () {}
|
private Timeout () {}
|
||||||
[DllImport("libglib-2.0-0.dll")]
|
[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)
|
public static uint Add (uint interval, TimeoutHandler hndlr)
|
||||||
{
|
{
|
||||||
TimeoutProxy p = new TimeoutProxy (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)
|
lock (Source.source_handlers)
|
||||||
Source.source_handlers [code] = p;
|
Source.source_handlers [code] = p;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user