2002-01-17 00:26:46 +00:00
|
|
|
// GtkSharp.Boxed.cs - Base class for deriving marshallable structures.
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
|
|
|
// (c) 2001-2002 Mike Kestner
|
|
|
|
|
2002-05-02 21:57:41 +00:00
|
|
|
namespace GLib {
|
2002-01-17 00:26:46 +00:00
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Boxed Class
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
|
|
|
/// An abstract base class to derive structures and marshal them.
|
|
|
|
/// </remarks>
|
|
|
|
|
2002-07-26 06:08:52 +00:00
|
|
|
public class Boxed {
|
2002-07-30 23:02:12 +00:00
|
|
|
object obj;
|
|
|
|
IntPtr raw;
|
2002-01-17 00:26:46 +00:00
|
|
|
|
2002-02-19 19:46:44 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Boxed Constructor
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
2002-05-02 21:57:41 +00:00
|
|
|
/// Constructs a Boxed type from a raw ref.
|
2002-02-19 19:46:44 +00:00
|
|
|
/// </remarks>
|
|
|
|
|
2002-07-26 06:08:52 +00:00
|
|
|
public Boxed (object o)
|
2002-02-19 19:46:44 +00:00
|
|
|
{
|
2003-02-14 01:16:05 +00:00
|
|
|
this.obj = o;
|
2002-07-30 23:02:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Boxed (IntPtr ptr)
|
|
|
|
{
|
|
|
|
this.raw = ptr;
|
2002-02-19 19:46:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
2002-05-02 21:57:41 +00:00
|
|
|
/// Handle Property
|
2002-02-19 19:46:44 +00:00
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
2002-05-02 21:57:41 +00:00
|
|
|
/// Gets a marshallable IntPtr.
|
2002-02-19 19:46:44 +00:00
|
|
|
/// </remarks>
|
2002-07-30 23:02:12 +00:00
|
|
|
public virtual IntPtr Handle {
|
2002-05-02 21:57:41 +00:00
|
|
|
get {
|
|
|
|
return raw;
|
|
|
|
}
|
2002-06-21 Rachel Hestilow <hestilow@ximian.com>
* generator/ClassBase.cs: New base class for classes and interfaces.
* generator/InterfaceGen.cs: Inherit from ClassBase, generate declarations.
* generator/ObjectGen.cs: Move half of this into ClassBase.
* generator/Method.cs: Turn all applicable Get/Set functions into .NET
accessors. Remove redundant == overload and move into Equals, as
it was confusing "!= null".
* generator/Parameters.cs: Alter signature creation to accept "is_set"
option, add support for variable arguments. Add properties "Count",
"IsVarArgs", "VAType".
* generator/Ctor.cs: Fixup for changes in Parameters (indenting,
signature creation).
* generator/Signal.cs: Support generating declarations.
* generator/SymbolTable: Change GetObjectGen to GetClassGen.
* glib/IWrapper.cs: Move "Handle" declaration to here, so
both classes and interfaces can benefit from it.
* glib/Object.cs: Inherit from IWrapper.cs
* parser/Metadata.pm: Support attribute changes on constructors,
methods, signals, and paramater lists.
* parser/gapi2xml.pl: Parse init funcs for interfaces. Ignore "_"
functions here.
* parser/gapi_pp.pl: Remove boxed_type_register check, as it will
be caught in the init funcs.
* parser/Atk.metadata: Added.
* parser/Gtk.metadata: Add all needed signal/method collision
renames. Rename GtkEditable.Editable accessors to IsEditable,
as .NET does not like accessors with the same name as their
declaring type. Tag TreeStore constructor as varargs.
* samples/ButtonApp.cs: s/EmitAdd/Add.
* samples/Menu.cs: s/EmitAdd/Add, s/Activate/Activated.
svn path=/trunk/gtk-sharp/; revision=5394
2002-06-21 17:15:19 +00:00
|
|
|
set {
|
|
|
|
raw = value;
|
|
|
|
}
|
2002-02-19 19:46:44 +00:00
|
|
|
}
|
2002-07-30 23:02:12 +00:00
|
|
|
|
|
|
|
public static explicit operator System.IntPtr (Boxed boxed) {
|
|
|
|
return boxed.Handle;
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual object Obj {
|
|
|
|
get {
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
obj = value;
|
|
|
|
}
|
|
|
|
}
|
2002-01-17 00:26:46 +00:00
|
|
|
}
|
|
|
|
}
|