d33dd8a15f
* gconf, sample/gconf: Added. * glue/combo.c: This was never added, add it now. * configure.in, makefile, sample/Makefile.in: Build new gconf bindings if gnome is enabled. svn path=/trunk/gtk-sharp/; revision=8389
37 lines
942 B
C#
37 lines
942 B
C#
namespace GConf
|
|
{
|
|
using System;
|
|
using System.Collections;
|
|
|
|
internal delegate void NotifyFuncNative (IntPtr client_ptr, uint id, IntPtr entry_ptr, IntPtr user_data);
|
|
|
|
internal class NotifyWrapper
|
|
{
|
|
static ArrayList refs = new ArrayList ();
|
|
NotifyEventHandler notify;
|
|
NotifyFuncNative native;
|
|
|
|
void NotifyCB (IntPtr client_ptr, uint id, IntPtr entry_ptr, IntPtr user_data)
|
|
{
|
|
Client client = new Client (client_ptr);
|
|
_Entry entry = new _Entry (entry_ptr);
|
|
Value val = new Value (entry.ValuePtr);
|
|
val.Managed = false;
|
|
notify (client, new NotifyEventArgs (entry.Key, val.Get ()));
|
|
}
|
|
|
|
public NotifyWrapper (NotifyEventHandler notify)
|
|
{
|
|
this.notify = notify;
|
|
this.native = new NotifyFuncNative (this.NotifyCB);
|
|
}
|
|
|
|
public static NotifyFuncNative Wrap (NotifyEventHandler notify)
|
|
{
|
|
NotifyWrapper wrapper = new NotifyWrapper (notify);
|
|
refs.Add (wrapper);
|
|
return wrapper.native;
|
|
}
|
|
}
|
|
}
|
|
|