// GtkSharp.Boxed.cs - Base class for deriving marshallable structures. // // Author: Mike Kestner // // (c) 2001-2002 Mike Kestner namespace GLib { using System; /// /// Boxed Class /// /// /// /// An abstract base class to derive structures and marshal them. /// public class Boxed { object obj; IntPtr raw; /// /// Boxed Constructor /// /// /// /// Constructs a Boxed type from a raw ref. /// public Boxed (object o) { this.obj = o; } public Boxed (IntPtr ptr) { this.raw = ptr; } /// /// Handle Property /// /// /// /// Gets a marshallable IntPtr. /// public virtual IntPtr Handle { get { return raw; } set { raw = value; } } public static explicit operator System.IntPtr (Boxed boxed) { return boxed.Handle; } public virtual object Obj { get { return obj; } set { obj = value; } } } }