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;
|
|
|
|
protected EventHandler _handler;
|
|
|
|
protected int _key;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// SignalCallback Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// Initializes instance data.
|
|
|
|
/// </remarks>
|
|
|
|
|
2001-11-25 17:06:27 +00:00
|
|
|
public SignalCallback (GLib.Object obj, EventHandler eh)
|
2001-11-25 00:25:47 +00:00
|
|
|
{
|
|
|
|
_key = _NextKey++;
|
|
|
|
_obj = obj;
|
|
|
|
_handler = eh;
|
|
|
|
_Instances [_key] = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|