[Mono-list] Patch for gtk-sharp/codegen/defs-parse.pl

David Dawkins david@dawkins.st
Wed, 2 Jan 2002 00:03:40 -0000

This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit

> Okay, thanks for the info.  I just committed a fix.  Can you verify it
> for me on your setup?  Thanks again.

Seems to work just fine. glib/generated/voidSignal.cs now looks
sane. I attached it, if you'd like to verify with something you know
to be "good". This is the only file in the "generated" directory, BTW.


Content-Type: application/octet-stream;
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;

// Generated file: Do not modify

namespace GtkSharp {

	using System;
	using System.Collections;
	using System.Runtime.InteropServices;
	using GLib;

	public delegate void voidDelegate(IntPtr window, int key);

	public class voidSignal : SignalCallback {

		private static voidDelegate _Delegate;

		private static void voidCallback(IntPtr window, int key)
			if (!_Instances.Contains(key))
				throw new Exception("Unexpected signal key");

			voidSignal inst =3D (voidSignal) _Instances[key];
			SignalArgs args =3D new SignalArgs ();
			inst._handler (inst._obj, args);

		[DllImport("gobject-1.3.dll", CharSet=3DCharSet.Ansi, =
		static extern void g_signal_connect_data(IntPtr obj, IntPtr name, =
voidDelegate cb, int key, IntPtr p, int flags);

		public voidSignal(GLib.Object obj, IntPtr raw, String name, =
EventHandler eh) : base(obj, eh)
			if (_Delegate =3D=3D null) {
				_Delegate =3D new voidDelegate(voidCallback);
			g_signal_connect_data(raw, Marshal.StringToHGlobalAnsi(name), =
_Delegate, _key, new IntPtr(0), 0);

{			_Instances.Remove(_key);
			if(_Instances.Count =3D=3D 0) {
				_Delegate =3D null;