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>
|
|
|
|
|
|
|
|
public abstract class Boxed {
|
|
|
|
|
2002-05-02 21:57:41 +00:00
|
|
|
private IntPtr raw;
|
2002-01-17 00:26:46 +00:00
|
|
|
|
2002-05-02 21:57:41 +00:00
|
|
|
public Boxed () : this (IntPtr.Zero) {}
|
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-05-02 21:57:41 +00:00
|
|
|
public Boxed (IntPtr raw)
|
2002-02-19 19:46:44 +00:00
|
|
|
{
|
2002-05-02 21:57:41 +00:00
|
|
|
this.raw = raw;
|
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-05-02 21:57:41 +00:00
|
|
|
public virtual IntPtr Handle {
|
|
|
|
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-01-17 00:26:46 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Raw Property
|
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
2002-05-02 21:57:41 +00:00
|
|
|
/// Gets or sets a marshallable IntPtr.
|
2002-01-17 00:26:46 +00:00
|
|
|
/// </remarks>
|
|
|
|
|
2002-02-19 19:46:44 +00:00
|
|
|
protected IntPtr Raw {
|
2002-01-17 00:26:46 +00:00
|
|
|
get {
|
2002-05-02 21:57:41 +00:00
|
|
|
return raw;
|
2002-01-17 00:26:46 +00:00
|
|
|
}
|
2002-02-19 19:46:44 +00:00
|
|
|
set {
|
2002-05-02 21:57:41 +00:00
|
|
|
raw = value;
|
2002-02-19 19:46:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
2002-05-02 21:57:41 +00:00
|
|
|
/// FromNative Method
|
2002-02-19 19:46:44 +00:00
|
|
|
/// </summary>
|
|
|
|
///
|
|
|
|
/// <remarks>
|
2002-05-02 21:57:41 +00:00
|
|
|
/// Gets a Boxed type from a raw IntPtr.
|
2002-02-19 19:46:44 +00:00
|
|
|
/// </remarks>
|
|
|
|
|
2002-05-02 21:57:41 +00:00
|
|
|
public static GLib.Boxed FromNative (IntPtr raw)
|
2002-01-17 00:26:46 +00:00
|
|
|
{
|
2002-05-02 21:57:41 +00:00
|
|
|
// FIXME:
|
2002-01-17 00:26:46 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|