2002-08-31 20:37:52 +00:00
|
|
|
// GLib.Idle.cs - Idle class implementation
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
// Rachel Hestilow <hestilow@ximian.com>
|
|
|
|
//
|
2004-06-25 18:42:19 +00:00
|
|
|
// Copyright (c) 2002 Mike Kestner
|
|
|
|
// Copyright (c) Rachel Hestilow
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of version 2 of the Lesser GNU General
|
|
|
|
// Public License as published by the Free Software Foundation.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this program; if not, write to the
|
|
|
|
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
// Boston, MA 02111-1307, USA.
|
|
|
|
|
2002-08-31 20:37:52 +00:00
|
|
|
|
|
|
|
namespace GLib {
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
public delegate bool IdleHandler ();
|
|
|
|
|
|
|
|
public class Idle {
|
|
|
|
|
2003-03-15 21:02:25 +00:00
|
|
|
private Idle ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2003-02-22 04:34:56 +00:00
|
|
|
[DllImport("libglib-2.0-0.dll")]
|
2002-08-31 20:37:52 +00:00
|
|
|
static extern uint g_idle_add (IdleHandler d, IntPtr data);
|
|
|
|
|
|
|
|
public static uint Add (IdleHandler hndlr)
|
|
|
|
{
|
|
|
|
return g_idle_add (hndlr, IntPtr.Zero);
|
|
|
|
}
|
2003-12-24 19:37:41 +00:00
|
|
|
|
|
|
|
[DllImport("libglib-2.0-0.dll")]
|
|
|
|
static extern bool g_source_remove_by_funcs_user_data (IdleHandler d, IntPtr data);
|
|
|
|
|
|
|
|
public static bool Remove (IdleHandler hndlr)
|
|
|
|
{
|
|
|
|
return g_source_remove_by_funcs_user_data (hndlr, IntPtr.Zero);
|
|
|
|
}
|
|
|
|
|
2002-08-31 20:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|