2001-11-25 00:25:47 +00:00
|
|
|
// GtkSharp.SignalCallback.cs - Signal callback base class implementation
|
|
|
|
//
|
|
|
|
// Authors: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Mike Kestner
|
|
|
|
|
|
|
|
namespace GtkSharp {
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using GLib;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// SignalCallback Class
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Base Class for GSignal to C# event marshalling.
|
|
|
|
/// </remarks>
|
|
|
|
|
|
|
|
public abstract class SignalCallback {
|
|
|
|
|
|
|
|
// A counter used to produce unique keys for instances.
|
|
|
|
protected static int _NextKey = 0;
|
|
|
|
|
|
|
|
// Hashtable containing refs to all current instances.
|
|
|
|
protected static Hashtable _Instances = new Hashtable ();
|
|
|
|
|
|
|
|
// protected instance members
|
|
|
|
protected GLib.Object _obj;
|
2002-07-16 23:14:35 +00:00
|
|
|
protected MulticastDelegate _handler;
|
2001-11-25 00:25:47 +00:00
|
|
|
protected int _key;
|
2002-07-16 23:14:35 +00:00
|
|
|
protected Type _argstype;
|
2001-11-25 00:25:47 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// SignalCallback Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Initializes instance data.
|
|
|
|
/// </remarks>
|
|
|
|
|
2002-07-16 23:14:35 +00:00
|
|
|
public SignalCallback (GLib.Object obj, MulticastDelegate eh, Type argstype)
|
2001-11-25 00:25:47 +00:00
|
|
|
{
|
|
|
|
_key = _NextKey++;
|
|
|
|
_obj = obj;
|
|
|
|
_handler = eh;
|
2002-07-16 23:14:35 +00:00
|
|
|
_argstype = argstype;
|
2001-11-25 00:25:47 +00:00
|
|
|
_Instances [_key] = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|