public GSourceFuncWrapper(GLib.GSourceFunc managed) { this.managed = managed; if (managed != null) { NativeDelegate = new GSourceFuncNative(NativeCallback); } }
public void SendToMainloopAsync(GLib.GSourceFunc func) { GLibSharp.GSourceFuncWrapper func_wrapper = new GLibSharp.GSourceFuncWrapper(func); IntPtr user_data; GLib.DestroyNotify notify; if (func == null) { user_data = IntPtr.Zero; notify = null; } else { user_data = (IntPtr)GCHandle.Alloc(func_wrapper); notify = GLib.DestroyHelper.NotifyHandler; } g_io_scheduler_job_send_to_mainloop_async(Handle, func_wrapper.NativeDelegate, user_data, notify); }
public bool SendToMainloop(GLib.GSourceFunc func) { GLibSharp.GSourceFuncWrapper func_wrapper = new GLibSharp.GSourceFuncWrapper(func); IntPtr user_data; GLib.DestroyNotify notify; if (func == null) { user_data = IntPtr.Zero; notify = null; } else { user_data = (IntPtr)GCHandle.Alloc(func_wrapper); notify = GLib.DestroyHelper.NotifyHandler; } bool raw_ret = g_io_scheduler_job_send_to_mainloop(Handle, func_wrapper.NativeDelegate, user_data, notify); bool ret = raw_ret; return(ret); }
public static uint AddTimeoutSeconds(int priority, uint interval, GLib.GSourceFunc function) { GLibSharp.GSourceFuncWrapper function_wrapper = new GLibSharp.GSourceFuncWrapper(function); IntPtr data; GLib.DestroyNotify notify; if (function == null) { data = IntPtr.Zero; notify = null; } else { data = (IntPtr)GCHandle.Alloc(function_wrapper); notify = GLib.DestroyHelper.NotifyHandler; } uint raw_ret = gdk_threads_add_timeout_seconds_full(priority, interval, function_wrapper.NativeDelegate, data, notify); uint ret = raw_ret; return(ret); }
public GSourceFuncWrapper (GLib.GSourceFunc managed) { this.managed = managed; if (managed != null) NativeDelegate = new GSourceFuncNative (NativeCallback); }
public void AttachSource(GLib.Source source, GLib.GSourceFunc cb) { GLibSharp.GSourceFuncWrapper cb_wrapper = new GLibSharp.GSourceFuncWrapper(cb); g_task_attach_source(Handle, source == null ? IntPtr.Zero : source.Handle, cb_wrapper.NativeDelegate); }