2001-09-19 02:04:57 +00:00
|
|
|
// ObjectManager.cs - GObject class wrapper helper implementation
|
|
|
|
//
|
|
|
|
// Author: Bob Smith <bob@thestuff.net>
|
|
|
|
//
|
|
|
|
// (c) 2001 Bob Smith
|
|
|
|
|
2001-09-19 11:37:15 +00:00
|
|
|
namespace GLib {
|
2001-09-19 02:04:57 +00:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
2001-09-19 11:37:15 +00:00
|
|
|
/*
|
2001-09-19 02:04:57 +00:00
|
|
|
public class ObjectManager {
|
2001-09-19 11:37:15 +00:00
|
|
|
public ObjectManager(IntPtr o, Object go)
|
2001-09-19 02:04:57 +00:00
|
|
|
{
|
2001-09-19 04:47:48 +00:00
|
|
|
if (o == null || go -- null) throw new ArgumentNullException ();
|
|
|
|
_gobj = go;
|
|
|
|
_gobj.gh = GCHandle.Alloc (this, GCHandleType.Pinned);
|
|
|
|
Glib.Object.g_object_set_data_full(o, "gobject#-object-manager",
|
|
|
|
gh.AddrOfPinnedObject (), new DestroyNotify(DestroyNotifyEvent));
|
2001-09-19 02:04:57 +00:00
|
|
|
|
|
|
|
}
|
2001-09-19 04:47:48 +00:00
|
|
|
public Glib.Object gobj;
|
2001-09-19 02:04:57 +00:00
|
|
|
|
2001-09-19 11:37:15 +00:00
|
|
|
protected delegate void DestroyNotify (IntPtr data);
|
|
|
|
|
2001-09-19 02:04:57 +00:00
|
|
|
private void DestroyNotifyEvent (IntPtr data)
|
|
|
|
{
|
2001-09-19 04:47:48 +00:00
|
|
|
gobj.gh.Free();
|
|
|
|
_gobj = null;
|
2001-09-19 02:04:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2001-09-19 11:37:15 +00:00
|
|
|
*/
|
2001-09-19 02:04:57 +00:00
|
|
|
}
|