diff --git a/ChangeLog b/ChangeLog index 74684d135..c9369b386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-10-24 Mike Kestner + + * generator/SymbolTable.cs: mappings for GCallback and GSourceFunc. + * glib/GCallback.cs: GCallback declaration. + * glib/Source.cs: GSourceFunc declaration. + 2007-10-24 Mike Kestner * generator/VirtualMethod.cs: clean up compiler warning and duplicate diff --git a/generator/SymbolTable.cs b/generator/SymbolTable.cs index 60acd9a08..f11e0edbd 100644 --- a/generator/SymbolTable.cs +++ b/generator/SymbolTable.cs @@ -74,6 +74,8 @@ namespace GtkSharp.Generation { AddType (new SimpleGen ("gdouble", "double", "0.0")); AddType (new SimpleGen ("double", "double", "0.0")); AddType (new SimpleGen ("GQuark", "int", "0")); + AddType (new SimpleGen ("GSourceFunc", "GLib.GSourceFunc", "null")); + AddType (new SimpleGen ("GCallback", "GLib.GCallback", "null")); // platform specific integer types. AddType (new LPGen ("ssize_t")); diff --git a/glib/GCallback.cs b/glib/GCallback.cs new file mode 100644 index 000000000..99b60ea0e --- /dev/null +++ b/glib/GCallback.cs @@ -0,0 +1,29 @@ +// GLib.Callback.cs - Callback delegate +// +// Author: Mike Kestner +// +// Copyright (c) 2007 Novell, Inc. +// +// 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. + + +namespace GLib { + + using System; + + [CDeclCallback] + public delegate void GCallback (); + +} diff --git a/glib/Makefile.am b/glib/Makefile.am index d0d1e25fa..3d7434aa6 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -27,6 +27,7 @@ sources = \ EnumWrapper.cs \ ExceptionManager.cs \ FileUtils.cs \ + GCallback.cs \ GException.cs \ GInterfaceAdapter.cs \ GInterfaceAttribute.cs \ diff --git a/glib/Source.cs b/glib/Source.cs index 8fc38e3e0..155666f81 100644 --- a/glib/Source.cs +++ b/glib/Source.cs @@ -25,6 +25,9 @@ namespace GLib { using System.Collections; using System.Runtime.InteropServices; + [CDeclCallback] + public delegate bool GSourceFunc (); + // // Base class for IdleProxy and TimeoutProxy //