mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-23 06:51:06 +00:00
2004-12-16 Tambet Ingo <tambet@ximian.com>
* glib/Opaque.cs : hold a weakref in the hash, not a strong ref. svn path=/trunk/gtk-sharp/; revision=37840
This commit is contained in:
parent
cf2596acf0
commit
256bc09aee
|
@ -1,3 +1,7 @@
|
|||
2004-12-16 Tambet Ingo <tambet@ximian.com>
|
||||
|
||||
* glib/Opaque.cs : hold a weakref in the hash, not a strong ref.
|
||||
|
||||
2004-12-15 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* gnome/Gnome.metadata : resolve a collision that was causing
|
||||
|
|
|
@ -133,66 +133,6 @@ class PrintSample
|
|||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="CheckbuttonNew" Deprecated="true">
|
||||
<MemberSignature Language="C#" Value="public static Gtk.Widget CheckbuttonNew (Gnome.PrintConfig config, out byte path, out byte label);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Gtk.Widget</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Gnome.PrintConfig" />
|
||||
<Parameter Name="path" Type="System.Byte&" RefType="out" />
|
||||
<Parameter Name="label" Type="System.Byte&" RefType="out" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<param name="config">a <see cref="T:Gnome.PrintConfig" /></param>
|
||||
<param name="path">a <see cref="T:System.Byte" /></param>
|
||||
<param name="label">a <see cref="T:System.Byte" /></param>
|
||||
<returns>a <see cref="T:Gtk.Widget" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="RadiobuttonNew" Deprecated="true">
|
||||
<MemberSignature Language="C#" Value="public static Gtk.Widget RadiobuttonNew (Gnome.PrintConfig config, out byte path, Gnome.PrintConfigOption options);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Gtk.Widget</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Gnome.PrintConfig" />
|
||||
<Parameter Name="path" Type="System.Byte&" RefType="out" />
|
||||
<Parameter Name="options" Type="Gnome.PrintConfigOption" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<param name="config">a <see cref="T:Gnome.PrintConfig" /></param>
|
||||
<param name="path">a <see cref="T:System.Byte" /></param>
|
||||
<param name="options">a <see cref="T:Gnome.PrintConfigOption" /></param>
|
||||
<returns>a <see cref="T:Gtk.Widget" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="WidgetNew" Deprecated="true">
|
||||
<MemberSignature Language="C#" Value="public static Gtk.Widget WidgetNew (Gnome.PrintConfig config, out byte path, Gnome.PrintWidgetType type);" />
|
||||
<MemberType>Method</MemberType>
|
||||
<ReturnValue>
|
||||
<ReturnType>Gtk.Widget</ReturnType>
|
||||
</ReturnValue>
|
||||
<Parameters>
|
||||
<Parameter Name="config" Type="Gnome.PrintConfig" />
|
||||
<Parameter Name="path" Type="System.Byte&" RefType="out" />
|
||||
<Parameter Name="type" Type="Gnome.PrintWidgetType" />
|
||||
</Parameters>
|
||||
<Docs>
|
||||
<summary>To be added</summary>
|
||||
<param name="config">a <see cref="T:Gnome.PrintConfig" /></param>
|
||||
<param name="path">a <see cref="T:System.Byte" /></param>
|
||||
<param name="type">a <see cref="T:System.Int32" /></param>
|
||||
<returns>a <see cref="T:Gtk.Widget" /></returns>
|
||||
<remarks>To be added</remarks>
|
||||
</Docs>
|
||||
</Member>
|
||||
<Member MemberName="Newpath">
|
||||
<MemberSignature Language="C#" Value="public static int Newpath (Gnome.PrintContext pc);" />
|
||||
<MemberType>Method</MemberType>
|
||||
|
@ -1339,4 +1279,4 @@ class PrintSample
|
|||
</Docs>
|
||||
</Member>
|
||||
</Members>
|
||||
</Type>
|
||||
</Type>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
// Copyright (c) 2001 Bob Smith
|
||||
// Copyright (c) 2001 Mike Kestner
|
||||
// Copyright (c) 2002 Rachel Hestilow
|
||||
// Copyright (c) 2004 Novell, Inc.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of version 2 of the Lesser GNU General
|
||||
|
@ -32,79 +33,35 @@ namespace GLib {
|
|||
|
||||
public class Opaque : IWrapper {
|
||||
|
||||
// Private class and instance members
|
||||
IntPtr _obj;
|
||||
static Hashtable Opaques = new Hashtable();
|
||||
|
||||
/// <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 opaque struct references.
|
||||
/// </remarks>
|
||||
///
|
||||
/// <returns>
|
||||
/// The wrapper instance.
|
||||
/// </returns>
|
||||
|
||||
public static Opaque GetOpaque(IntPtr o)
|
||||
{
|
||||
Opaque obj = (Opaque)Opaques[o];
|
||||
if (obj != null) return obj;
|
||||
return null; //FIXME: Call TypeParser here eventually.
|
||||
}
|
||||
WeakReference reference = (WeakReference) Opaques[(int)o];
|
||||
if (reference == null || !reference.IsAlive)
|
||||
return null;
|
||||
|
||||
return (Opaque) reference.Target;
|
||||
}
|
||||
|
||||
public Opaque () {}
|
||||
|
||||
/// <summary>
|
||||
/// Opaque Constructor
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>
|
||||
/// Creates an opaque wrapper from a raw object reference.
|
||||
/// </remarks>
|
||||
|
||||
public Opaque (IntPtr raw)
|
||||
{
|
||||
Raw = raw;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raw Property
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>
|
||||
/// The raw Opaque reference associated with this wrapper.
|
||||
/// Only subclasses of Opaque can access this read/write
|
||||
/// property. For public read-only access, use the
|
||||
/// Handle property.
|
||||
/// </remarks>
|
||||
|
||||
protected IntPtr Raw {
|
||||
get {
|
||||
return _obj;
|
||||
}
|
||||
set {
|
||||
Opaques [value] = this;
|
||||
Opaques [value] = new WeakReference (this);
|
||||
_obj = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle Property
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>
|
||||
/// The raw Opaque reference associated with this object.
|
||||
/// Subclasses can use Raw property for read/write
|
||||
/// access.
|
||||
/// </remarks>
|
||||
|
||||
public IntPtr Handle {
|
||||
get {
|
||||
return _obj;
|
||||
|
@ -119,14 +76,6 @@ namespace GLib {
|
|||
return (Handle == ((Opaque) o).Handle);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GetHashCode Method
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>
|
||||
/// Calculates a hashing value.
|
||||
/// </remarks>
|
||||
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return Handle.GetHashCode ();
|
||||
|
|
Loading…
Reference in a new issue