mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
2004-03-16 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : don't gen a Signals hash per class. * generator/Signal.cs : gen checks for [ConnectBefore]. * generator/SignalHandler.cs : add connect_flags param to ctor. * glib/ConnectBeforeAttribute.cs : new attr * glib/Makefile.am : add new file * glib/Object.cs : add before/after hashes and EventLists * gnome/CanvasProxy.cs : use AfterSignals and AfterHandlers. svn path=/trunk/gtk-sharp/; revision=24157
This commit is contained in:
parent
5e03bca76f
commit
1a1f5e1702
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2004-03-16 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
|
* generator/ObjectGen.cs : don't gen a Signals hash per class.
|
||||||
|
* generator/Signal.cs : gen checks for [ConnectBefore].
|
||||||
|
* generator/SignalHandler.cs : add connect_flags param to ctor.
|
||||||
|
* glib/ConnectBeforeAttribute.cs : new attr
|
||||||
|
* glib/Makefile.am : add new file
|
||||||
|
* glib/Object.cs : add before/after hashes and EventLists
|
||||||
|
* gnome/CanvasProxy.cs : use AfterSignals and AfterHandlers.
|
||||||
|
|
||||||
2004-03-14 John Luke <jluke@cfl.rr.com>
|
2004-03-14 John Luke <jluke@cfl.rr.com>
|
||||||
|
|
||||||
* parser/gapi-fixup.in:
|
* parser/gapi-fixup.in:
|
||||||
|
@ -124,9 +124,7 @@ namespace GtkSharp.Generation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (has_sigs && Elem.HasAttribute("parent"))
|
if (has_sigs && Elem.HasAttribute("parent")) {
|
||||||
{
|
|
||||||
sw.WriteLine("\t\tprivate Hashtable Signals = new Hashtable();\n");
|
|
||||||
GenSignals (gen_info, null);
|
GenSignals (gen_info, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
//
|
//
|
||||||
// Author: Mike Kestner <mkestner@speakeasy.net>
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
||||||
//
|
//
|
||||||
// (c) 2001-2003 Mike Kestner, (c) 2003 Novell, Inc.
|
// (c) 2001-2003 Mike Kestner
|
||||||
|
// (c) 2003-2004 Novell, Inc.
|
||||||
|
|
||||||
namespace GtkSharp.Generation {
|
namespace GtkSharp.Generation {
|
||||||
|
|
||||||
@ -247,25 +248,50 @@ namespace GtkSharp.Generation {
|
|||||||
sw.Write("new ");
|
sw.Write("new ");
|
||||||
sw.WriteLine("event " + EventHandlerQualifiedName + " " + Name + " {");
|
sw.WriteLine("event " + EventHandlerQualifiedName + " " + Name + " {");
|
||||||
sw.WriteLine("\t\t\tadd {");
|
sw.WriteLine("\t\t\tadd {");
|
||||||
sw.WriteLine("\t\t\t\tif (EventList[" + cname + "] == null)");
|
sw.WriteLine("\t\t\t\tif (value.Method.GetCustomAttributes(typeof(GLib.ConnectBeforeAttribute), false).Length > 0) {");
|
||||||
sw.Write("\t\t\t\t\tSignals[" + cname + "] = new " + qual_marsh);
|
sw.WriteLine("\t\t\t\t\tConsole.WriteLine (\"Connecting before: " + Name + "\");");
|
||||||
|
sw.WriteLine("\t\t\t\t\tif (BeforeHandlers[" + cname + "] == null)");
|
||||||
|
sw.Write("\t\t\t\t\t\tBeforeSignals[" + cname + "] = new " + qual_marsh);
|
||||||
sw.Write("(this, Handle, " + cname + ", value, System.Type.GetType(\"" + EventArgsQualifiedName);
|
sw.Write("(this, Handle, " + cname + ", value, System.Type.GetType(\"" + EventArgsQualifiedName);
|
||||||
if (EventArgsQualifiedName != "System.EventArgs")
|
if (EventArgsQualifiedName != "System.EventArgs")
|
||||||
sw.Write("," + gen_info.AssemblyName);
|
sw.Write("," + gen_info.AssemblyName);
|
||||||
sw.WriteLine("\"));\n\t\t\t\telse");
|
sw.WriteLine("\"), 0);");
|
||||||
sw.WriteLine("\t\t\t\t\t((GtkSharp.SignalCallback) Signals [{0}]).AddDelegate (value);", cname);
|
sw.WriteLine("\t\t\t\t\telse");
|
||||||
sw.WriteLine("\t\t\t\tEventList.AddHandler(" + cname + ", value);");
|
sw.WriteLine("\t\t\t\t\t\t((GtkSharp.SignalCallback) BeforeSignals [{0}]).AddDelegate (value);", cname);
|
||||||
|
sw.WriteLine("\t\t\t\t\tBeforeHandlers.AddHandler(" + cname + ", value);");
|
||||||
|
sw.WriteLine("\t\t\t\t} else {");
|
||||||
|
sw.WriteLine("\t\t\t\t\tif (AfterHandlers[" + cname + "] == null)");
|
||||||
|
sw.Write("\t\t\t\t\t\tAfterSignals[" + cname + "] = new " + qual_marsh);
|
||||||
|
sw.Write("(this, Handle, " + cname + ", value, System.Type.GetType(\"" + EventArgsQualifiedName);
|
||||||
|
if (EventArgsQualifiedName != "System.EventArgs")
|
||||||
|
sw.Write("," + gen_info.AssemblyName);
|
||||||
|
sw.WriteLine("\"), 1);");
|
||||||
|
sw.WriteLine("\t\t\t\t\telse");
|
||||||
|
sw.WriteLine("\t\t\t\t\t\t((GtkSharp.SignalCallback) AfterSignals [{0}]).AddDelegate (value);", cname);
|
||||||
|
sw.WriteLine("\t\t\t\t\tAfterHandlers.AddHandler(" + cname + ", value);");
|
||||||
|
sw.WriteLine("\t\t\t\t}");
|
||||||
sw.WriteLine("\t\t\t}");
|
sw.WriteLine("\t\t\t}");
|
||||||
sw.WriteLine("\t\t\tremove {");
|
sw.WriteLine("\t\t\tremove {");
|
||||||
sw.WriteLine("\t\t\t\tEventList.RemoveHandler(" + cname + ", value);");
|
sw.WriteLine("\t\t\t\tGtkSharp.SignalCallback cb = null;");
|
||||||
sw.WriteLine("\t\t\t\tGtkSharp.SignalCallback cb = Signals [{0}] as GtkSharp.SignalCallback;", cname);
|
sw.WriteLine("\t\t\t\tSystem.ComponentModel.EventHandlerList event_list = null;");
|
||||||
|
sw.WriteLine("\t\t\t\tHashtable signals = null;");
|
||||||
|
sw.WriteLine("\t\t\t\tif (value.Method.GetCustomAttributes(typeof(GLib.ConnectBeforeAttribute), false).Length > 0) {");
|
||||||
|
sw.WriteLine("\t\t\t\t\tcb = BeforeSignals [{0}] as GtkSharp.SignalCallback;", cname);
|
||||||
|
sw.WriteLine("\t\t\t\t\tevent_list = BeforeHandlers;");
|
||||||
|
sw.WriteLine("\t\t\t\t\tsignals = BeforeSignals;");
|
||||||
|
sw.WriteLine("\t\t\t\t} else {");
|
||||||
|
sw.WriteLine("\t\t\t\t\tcb = AfterSignals [{0}] as GtkSharp.SignalCallback;", cname);
|
||||||
|
sw.WriteLine("\t\t\t\t\tevent_list = AfterHandlers;");
|
||||||
|
sw.WriteLine("\t\t\t\t\tsignals = AfterSignals;");
|
||||||
|
sw.WriteLine("\t\t\t\t}");
|
||||||
|
sw.WriteLine("\t\t\t\tevent_list.RemoveHandler(" + cname + ", value);");
|
||||||
sw.WriteLine("\t\t\t\tif (cb == null)");
|
sw.WriteLine("\t\t\t\tif (cb == null)");
|
||||||
sw.WriteLine("\t\t\t\t\treturn;");
|
sw.WriteLine("\t\t\t\t\treturn;");
|
||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
sw.WriteLine("\t\t\t\tcb.RemoveDelegate (value);");
|
sw.WriteLine("\t\t\t\tcb.RemoveDelegate (value);");
|
||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
sw.WriteLine("\t\t\t\tif (EventList[" + cname + "] == null) {");
|
sw.WriteLine("\t\t\t\tif (event_list[" + cname + "] == null) {");
|
||||||
sw.WriteLine("\t\t\t\t\tSignals.Remove(" + cname + ");");
|
sw.WriteLine("\t\t\t\t\tsignals.Remove(" + cname + ");");
|
||||||
sw.WriteLine("\t\t\t\t\tcb.Dispose ();");
|
sw.WriteLine("\t\t\t\t\tcb.Dispose ();");
|
||||||
sw.WriteLine("\t\t\t\t}");
|
sw.WriteLine("\t\t\t\t}");
|
||||||
sw.WriteLine("\t\t\t}");
|
sw.WriteLine("\t\t\t}");
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
// GtkSharp.Generation.SignalHandler.cs - The SignalHandler marshaling Class.
|
// GtkSharp.Generation.SignalHandler.cs - The SignalHandler marshaling Class.
|
||||||
//
|
//
|
||||||
// Author: Mike Kestner <mkestner@speakeasy.net>
|
// Author: Mike Kestner <mkestner@ximian.com>
|
||||||
//
|
//
|
||||||
// (c) 2002-2003 Mike Kestner
|
// (c) 2002-2003 Mike Kestner
|
||||||
|
// (c) 2004 Novell, Inc.
|
||||||
|
|
||||||
namespace GtkSharp.Generation {
|
namespace GtkSharp.Generation {
|
||||||
|
|
||||||
@ -184,14 +185,14 @@ namespace GtkSharp.Generation {
|
|||||||
sw.WriteLine(" int flags);");
|
sw.WriteLine(" int flags);");
|
||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
sw.Write("\t\tpublic " + Name + "(GLib.Object obj, IntPtr raw, ");
|
sw.Write("\t\tpublic " + Name + "(GLib.Object obj, IntPtr raw, ");
|
||||||
sw.WriteLine("string name, Delegate eh, Type argstype) : base(obj, eh, argstype)");
|
sw.WriteLine("string name, Delegate eh, Type argstype, int connect_flags) : base(obj, eh, argstype)");
|
||||||
sw.WriteLine("\t\t{");
|
sw.WriteLine("\t\t{");
|
||||||
sw.WriteLine("\t\t\tif (_Delegate == null) {");
|
sw.WriteLine("\t\t\tif (_Delegate == null) {");
|
||||||
sw.WriteLine("\t\t\t\t_Delegate = new " + DelegateName + "(" + CallbackName + ");");
|
sw.WriteLine("\t\t\t\t_Delegate = new " + DelegateName + "(" + CallbackName + ");");
|
||||||
sw.WriteLine("\t\t\t}");
|
sw.WriteLine("\t\t\t}");
|
||||||
sw.WriteLine("\t\t\t_raw = raw;");
|
sw.WriteLine("\t\t\t_raw = raw;");
|
||||||
sw.Write("\t\t\t_HandlerID = g_signal_connect_data(raw, name, ");
|
sw.Write("\t\t\t_HandlerID = g_signal_connect_data(raw, name, ");
|
||||||
sw.WriteLine("_Delegate, _key, new IntPtr(0), 1);");
|
sw.WriteLine("_Delegate, _key, new IntPtr(0), connect_flags);");
|
||||||
sw.WriteLine("\t\t}");
|
sw.WriteLine("\t\t}");
|
||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
sw.WriteLine("\t\t[DllImport(\"libgobject-2.0-0.dll\")]");
|
sw.WriteLine("\t\t[DllImport(\"libgobject-2.0-0.dll\")]");
|
||||||
|
15
glib/ConnectBeforeAttribute.cs
Normal file
15
glib/ConnectBeforeAttribute.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// ConnectBeforeAttribute.cs
|
||||||
|
//
|
||||||
|
// Author: Mike Kestner <mkestner@ximian.com>
|
||||||
|
//
|
||||||
|
// (C) 2004 Novell, Inc.
|
||||||
|
|
||||||
|
namespace GLib {
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public sealed class ConnectBeforeAttribute : Attribute
|
||||||
|
{
|
||||||
|
public ConnectBeforeAttribute () {}
|
||||||
|
}
|
||||||
|
}
|
@ -9,6 +9,7 @@ references =
|
|||||||
|
|
||||||
sources = \
|
sources = \
|
||||||
Boxed.cs \
|
Boxed.cs \
|
||||||
|
ConnectBeforeAttribute.cs \
|
||||||
DefaultSignalHandlerAttribute.cs \
|
DefaultSignalHandlerAttribute.cs \
|
||||||
DelegateWrapper.cs \
|
DelegateWrapper.cs \
|
||||||
EnumWrapper.cs \
|
EnumWrapper.cs \
|
||||||
|
201
glib/Object.cs
201
glib/Object.cs
@ -3,10 +3,8 @@
|
|||||||
// Authors: Mike Kestner <mkestner@speakeasy.net>
|
// Authors: Mike Kestner <mkestner@speakeasy.net>
|
||||||
//
|
//
|
||||||
// (c) 2001-2003 Mike Kestner
|
// (c) 2001-2003 Mike Kestner
|
||||||
//
|
// (c) 2004 Novell, Inc.
|
||||||
// TODO:
|
|
||||||
// Could remove `disposed' for a check if an object is on the dispose_queue_list.
|
|
||||||
//
|
|
||||||
namespace GLib {
|
namespace GLib {
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -15,28 +13,15 @@ namespace GLib {
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Object Class
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Wrapper class for GObject.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public class Object : IWrapper, IDisposable {
|
public class Object : IWrapper, IDisposable {
|
||||||
|
|
||||||
// Private class and instance members
|
|
||||||
IntPtr _obj;
|
IntPtr _obj;
|
||||||
EventHandlerList _events;
|
|
||||||
bool disposed = false;
|
bool disposed = false;
|
||||||
Hashtable data;
|
Hashtable data;
|
||||||
static Hashtable Objects = new Hashtable();
|
static Hashtable Objects = new Hashtable();
|
||||||
static Queue PendingDestroys = new Queue ();
|
static Queue PendingDestroys = new Queue ();
|
||||||
static bool idle_queued;
|
static bool idle_queued;
|
||||||
|
|
||||||
//
|
|
||||||
// The destructor is invoked by a thread
|
|
||||||
//
|
|
||||||
~Object ()
|
~Object ()
|
||||||
{
|
{
|
||||||
Dispose ();
|
Dispose ();
|
||||||
@ -67,16 +52,6 @@ namespace GLib {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Dispose Method
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Disposes of the raw object. Only override this if
|
|
||||||
/// the Raw object should not be unref'd when the object
|
|
||||||
/// is garbage collected.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public void Dispose ()
|
public void Dispose ()
|
||||||
{
|
{
|
||||||
if (disposed)
|
if (disposed)
|
||||||
@ -99,22 +74,6 @@ namespace GLib {
|
|||||||
[DllImport("libgobject-2.0-0.dll")]
|
[DllImport("libgobject-2.0-0.dll")]
|
||||||
static extern void g_object_ref (IntPtr raw);
|
static extern void g_object_ref (IntPtr raw);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// GetObject Shared Method
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Used to obtain a CLI typed object associated with a
|
|
||||||
/// given raw object pointer. This method is primarily
|
|
||||||
/// used to wrap object references that are returned
|
|
||||||
/// by either the signal system or raw class methods that
|
|
||||||
/// return GObject references.
|
|
||||||
/// </remarks>
|
|
||||||
///
|
|
||||||
/// <returns>
|
|
||||||
/// The wrapper instance.
|
|
||||||
/// </returns>
|
|
||||||
|
|
||||||
public static Object GetObject(IntPtr o, bool owned_ref)
|
public static Object GetObject(IntPtr o, bool owned_ref)
|
||||||
{
|
{
|
||||||
Object obj;
|
Object obj;
|
||||||
@ -166,16 +125,6 @@ namespace GLib {
|
|||||||
[DllImport("glibsharpglue")]
|
[DllImport("glibsharpglue")]
|
||||||
static extern IntPtr gtksharp_register_type (string name, IntPtr parent_type);
|
static extern IntPtr gtksharp_register_type (string name, IntPtr parent_type);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// RegisterGType Shared Method
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Shared method to register types with the GType system.
|
|
||||||
/// This method should be called from the class constructor
|
|
||||||
/// of subclasses.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public static GType RegisterGType (System.Type t)
|
public static GType RegisterGType (System.Type t)
|
||||||
{
|
{
|
||||||
System.Type parent = t.BaseType;
|
System.Type parent = t.BaseType;
|
||||||
@ -192,24 +141,8 @@ namespace GLib {
|
|||||||
return gtype;
|
return gtype;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Object Constructor
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Dummy constructor needed for derived classes.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
protected Object () {}
|
protected Object () {}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Object Constructor
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Creates an object from a raw object reference.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public Object (IntPtr raw)
|
public Object (IntPtr raw)
|
||||||
{
|
{
|
||||||
Raw = raw;
|
Raw = raw;
|
||||||
@ -218,30 +151,11 @@ namespace GLib {
|
|||||||
[DllImport("libgobject-2.0-0.dll")]
|
[DllImport("libgobject-2.0-0.dll")]
|
||||||
static extern IntPtr g_object_new (IntPtr gtype, IntPtr dummy);
|
static extern IntPtr g_object_new (IntPtr gtype, IntPtr dummy);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Object Constructor
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Creates an object from a specified GType.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
protected Object (GType gtype)
|
protected Object (GType gtype)
|
||||||
{
|
{
|
||||||
Raw = g_object_new (gtype.Val, IntPtr.Zero);
|
Raw = g_object_new (gtype.Val, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Raw Property
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// The raw GObject reference associated with this wrapper.
|
|
||||||
/// Only subclasses of Object can access this read/write
|
|
||||||
/// property. For public read-only access, use the
|
|
||||||
/// Handle property.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
protected virtual IntPtr Raw {
|
protected virtual IntPtr Raw {
|
||||||
get {
|
get {
|
||||||
return _obj;
|
return _obj;
|
||||||
@ -252,14 +166,6 @@ namespace GLib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// GType Property
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// The type associated with this object class.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
[DllImport("glibsharpglue")]
|
[DllImport("glibsharpglue")]
|
||||||
private static extern IntPtr gtksharp_get_type_id (IntPtr obj);
|
private static extern IntPtr gtksharp_get_type_id (IntPtr obj);
|
||||||
|
|
||||||
@ -278,14 +184,6 @@ namespace GLib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// GetGType Method
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Returns the GType of this object.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public GLib.GType GetGType () {
|
public GLib.GType GetGType () {
|
||||||
if (_obj == IntPtr.Zero)
|
if (_obj == IntPtr.Zero)
|
||||||
return GType.Invalid;
|
return GType.Invalid;
|
||||||
@ -293,60 +191,53 @@ namespace GLib {
|
|||||||
return new GLib.GType (gtksharp_get_type_id (_obj));
|
return new GLib.GType (gtksharp_get_type_id (_obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handle Property
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// The raw GObject reference associated with this object.
|
|
||||||
/// Subclasses can use Raw property for read/write
|
|
||||||
/// access.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public IntPtr Handle {
|
public IntPtr Handle {
|
||||||
get {
|
get {
|
||||||
return _obj;
|
return _obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
Hashtable before_signals;
|
||||||
/// EventList Property
|
protected Hashtable BeforeSignals {
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// A list object containing all the events for this
|
|
||||||
/// object indexed by the Gtk+ signal name.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
protected EventHandlerList EventList {
|
|
||||||
get {
|
get {
|
||||||
if (_events == null)
|
if (before_signals == null)
|
||||||
_events = new EventHandlerList ();
|
before_signals = new Hashtable ();
|
||||||
return _events;
|
return before_signals;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
Hashtable after_signals;
|
||||||
/// GetHashCode Method
|
protected Hashtable AfterSignals {
|
||||||
/// </summary>
|
get {
|
||||||
///
|
if (after_signals == null)
|
||||||
/// <remarks>
|
after_signals = new Hashtable ();
|
||||||
/// Calculates a hashing value.
|
return after_signals;
|
||||||
/// </remarks>
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EventHandlerList before_handlers;
|
||||||
|
protected EventHandlerList BeforeHandlers {
|
||||||
|
get {
|
||||||
|
if (before_handlers == null)
|
||||||
|
before_handlers = new EventHandlerList ();
|
||||||
|
return before_handlers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EventHandlerList after_handlers;
|
||||||
|
protected EventHandlerList AfterHandlers {
|
||||||
|
get {
|
||||||
|
if (after_handlers == null)
|
||||||
|
after_handlers = new EventHandlerList ();
|
||||||
|
return after_handlers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override int GetHashCode ()
|
public override int GetHashCode ()
|
||||||
{
|
{
|
||||||
return Handle.GetHashCode ();
|
return Handle.GetHashCode ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Data property
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Stores and Accesses arbitrary data on the Object.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public Hashtable Data {
|
public Hashtable Data {
|
||||||
get {
|
get {
|
||||||
if (data == null)
|
if (data == null)
|
||||||
@ -357,35 +248,17 @@ namespace GLib {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgobject-2.0-0.dll")]
|
[DllImport("libgobject-2.0-0.dll")]
|
||||||
static extern void g_object_get_property (
|
static extern void g_object_get_property (IntPtr obj, string name, IntPtr val);
|
||||||
IntPtr obj, string name, IntPtr val);
|
|
||||||
|
|
||||||
/// <summary>
|
protected void GetProperty (String name, GLib.Value val)
|
||||||
/// GetProperty Method
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Accesses a Value Property.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public void GetProperty (String name, GLib.Value val)
|
|
||||||
{
|
{
|
||||||
g_object_get_property (Raw, name, val.Handle);
|
g_object_get_property (Raw, name, val.Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("libgobject-2.0-0.dll")]
|
[DllImport("libgobject-2.0-0.dll")]
|
||||||
static extern void g_object_set_property (
|
static extern void g_object_set_property (IntPtr obj, string name, IntPtr val);
|
||||||
IntPtr obj, string name, IntPtr val);
|
|
||||||
|
|
||||||
/// <summary>
|
protected void SetProperty (String name, GLib.Value val)
|
||||||
/// SetProperty Method
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// <remarks>
|
|
||||||
/// Accesses a Value Property.
|
|
||||||
/// </remarks>
|
|
||||||
|
|
||||||
public void SetProperty (String name, GLib.Value val)
|
|
||||||
{
|
{
|
||||||
g_object_set_property (Raw, name, val.Handle);
|
g_object_set_property (Raw, name, val.Handle);
|
||||||
}
|
}
|
||||||
|
@ -22,71 +22,69 @@ namespace Gnome {
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
private Hashtable Signals = new Hashtable ();
|
|
||||||
|
|
||||||
public event UpdateHandler Update {
|
public event UpdateHandler Update {
|
||||||
add {
|
add {
|
||||||
if (EventList["update"] == null)
|
if (AfterHandlers["update"] == null)
|
||||||
Signals["update"] = new GtkSharp.voidObjectAffineSVPintSignal(this, Handle, "update", value, System.Type.GetType("EventArgs"));
|
AfterSignals["update"] = new GtkSharp.voidObjectAffineSVPintSignal(this, Handle, "update", value, System.Type.GetType("EventArgs"));
|
||||||
EventList.AddHandler("update", value);
|
AfterHandlers.AddHandler("update", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler ("update", value);
|
AfterHandlers.RemoveHandler ("update", value);
|
||||||
if (EventList ["update"] == null)
|
if (AfterHandlers ["update"] == null)
|
||||||
Signals.Remove ("update");
|
AfterSignals.Remove ("update");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler Realize {
|
public event EventHandler Realize {
|
||||||
add {
|
add {
|
||||||
if (EventList["realize"] == null)
|
if (AfterHandlers["realize"] == null)
|
||||||
Signals["realize"] = new GnomeSharp.voidObjectSignal(this, Handle, "realize", value, System.Type.GetType("EventArgs"));
|
AfterSignals["realize"] = new GnomeSharp.voidObjectSignal(this, Handle, "realize", value, System.Type.GetType("EventArgs"), 1);
|
||||||
EventList.AddHandler("realize", value);
|
AfterHandlers.AddHandler("realize", value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler("realize", value);
|
AfterHandlers.RemoveHandler("realize", value);
|
||||||
if (EventList["realize"] == null)
|
if (AfterHandlers["realize"] == null)
|
||||||
Signals.Remove("realize");
|
AfterSignals.Remove("realize");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler Unrealize {
|
public event EventHandler Unrealize {
|
||||||
add {
|
add {
|
||||||
if (EventList["unrealize"] == null)
|
if (AfterHandlers["unrealize"] == null)
|
||||||
Signals["unrealize"] = new GnomeSharp.voidObjectSignal(this, Handle, "unrealize", value, System.Type.GetType("EventArgs"));
|
AfterSignals["unrealize"] = new GnomeSharp.voidObjectSignal(this, Handle, "unrealize", value, System.Type.GetType("EventArgs"), 1);
|
||||||
EventList.AddHandler("unrealize", value);
|
AfterHandlers.AddHandler("unrealize", value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler("unrealize", value);
|
AfterHandlers.RemoveHandler("unrealize", value);
|
||||||
if (EventList["unrealize"] == null)
|
if (AfterHandlers["unrealize"] == null)
|
||||||
Signals.Remove("unrealize");
|
AfterSignals.Remove("unrealize");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler Map {
|
public event EventHandler Map {
|
||||||
add {
|
add {
|
||||||
if (EventList["map"] == null)
|
if (AfterHandlers["map"] == null)
|
||||||
Signals["map"] = new GnomeSharp.voidObjectSignal(this, Handle, "map", value, System.Type.GetType("EventArgs"));
|
AfterSignals["map"] = new GnomeSharp.voidObjectSignal(this, Handle, "map", value, System.Type.GetType("EventArgs"), 1);
|
||||||
EventList.AddHandler("map", value);
|
AfterHandlers.AddHandler("map", value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler("map", value);
|
AfterHandlers.RemoveHandler("map", value);
|
||||||
if (EventList["map"] == null)
|
if (AfterHandlers["map"] == null)
|
||||||
Signals.Remove("map");
|
AfterSignals.Remove("map");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public event EventHandler Unmap {
|
public event EventHandler Unmap {
|
||||||
add {
|
add {
|
||||||
if (EventList["unmap"] == null)
|
if (AfterHandlers["unmap"] == null)
|
||||||
Signals["unmap"] = new GnomeSharp.voidObjectSignal(this, Handle, "unmap", value, System.Type.GetType("EventArgs"));
|
AfterSignals["unmap"] = new GnomeSharp.voidObjectSignal(this, Handle, "unmap", value, System.Type.GetType("EventArgs"), 1);
|
||||||
EventList.AddHandler("unmap", value);
|
AfterHandlers.AddHandler("unmap", value);
|
||||||
}
|
}
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler("unmap", value);
|
AfterHandlers.RemoveHandler("unmap", value);
|
||||||
if (EventList["unmap"] == null)
|
if (AfterHandlers["unmap"] == null)
|
||||||
Signals.Remove("unmap");
|
AfterSignals.Remove("unmap");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,9 +94,9 @@ namespace Gnome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler ("coverage", value);
|
AfterHandlers.RemoveHandler ("coverage", value);
|
||||||
if (EventList ["coverage"] == null)
|
if (AfterHandlers ["coverage"] == null)
|
||||||
Signals.Remove ("coverage");
|
AfterSignals.Remove ("coverage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,9 +107,9 @@ namespace Gnome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler ("draw", value);
|
AfterHandlers.RemoveHandler ("draw", value);
|
||||||
if (EventList ["draw"] == null)
|
if (AfterHandlers ["draw"] == null)
|
||||||
Signals.Remove ("draw");
|
AfterSignals.Remove ("draw");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,9 +119,9 @@ namespace Gnome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler ("render", value);
|
AfterHandlers.RemoveHandler ("render", value);
|
||||||
if (EventList ["render"] == null)
|
if (AfterHandlers ["render"] == null)
|
||||||
Signals.Remove ("render");
|
AfterSignals.Remove ("render");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,9 +131,9 @@ namespace Gnome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler ("point", value);
|
AfterHandlers.RemoveHandler ("point", value);
|
||||||
if (EventList ["point"] == null)
|
if (AfterHandlers ["point"] == null)
|
||||||
Signals.Remove ("point");
|
AfterSignals.Remove ("point");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,9 +143,9 @@ namespace Gnome {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove {
|
remove {
|
||||||
EventList.RemoveHandler ("bounds", value);
|
AfterHandlers.RemoveHandler ("bounds", value);
|
||||||
if (EventList ["bounds"] == null)
|
if (AfterHandlers ["bounds"] == null)
|
||||||
Signals.Remove ("bounds");
|
AfterSignals.Remove ("bounds");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user