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-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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|