372e7ef7de
* codegen/defs-parse.pl (get_sighandler): gen the helper class. arg passing and return value handling need beefing up still. * glib/SignalArgs.cs : New arg passing/ return value handling class. * glib/SignalCallback.cs (dtor): kill, this will be gen'd in the subclasses. (ctor): prune down to two params. svn path=/trunk/gtk-sharp/; revision=1438
51 lines
1.1 KiB
C#
51 lines
1.1 KiB
C#
// 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>
|
|
|
|
public SignalCallback (GLib.Object obj, EventHandler eh)
|
|
{
|
|
_key = _NextKey++;
|
|
_obj = obj;
|
|
_handler = eh;
|
|
_Instances [_key] = this;
|
|
}
|
|
|
|
}
|
|
}
|