static void OverrideSkipAsync(GLib.GType gtype, SkipAsyncNativeDelegate callback)
 {
     unsafe {
         IntPtr *raw_ptr = (IntPtr *)(((long)gtype.GetClassPtr()) + (long)class_abi.GetFieldOffset("skip_async"));
         *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate)callback);
     }
 }
Esempio n. 2
0
        private void InternalSkipAsync(ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
        {
            SkipAsyncNativeDelegate unmanaged = class_abi.BaseOverride <SkipAsyncNativeDelegate>(this.LookupGType(), "skip_async");

            if (unmanaged == null)
            {
                return;
            }

            GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
            cb_wrapper.PersistUntilCalled();
            unmanaged(this.Handle, new UIntPtr(count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
        private void InternalSkipAsync(ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
        {
            SkipAsyncNativeDelegate unmanaged = null;

            unsafe {
                IntPtr *raw_ptr = (IntPtr *)(((long)this.LookupGType().GetThresholdType().GetClassPtr()) + (long)class_abi.GetFieldOffset("skip_async"));
                unmanaged = (SkipAsyncNativeDelegate)Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SkipAsyncNativeDelegate));
            }
            if (unmanaged == null)
            {
                return;
            }

            GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper(cb);
            cb_wrapper.PersistUntilCalled();
            unmanaged(this.Handle, new UIntPtr(count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
        }
Esempio n. 4
0
		static void OverrideSkipAsync (GLib.GType gtype, SkipAsyncNativeDelegate callback)
		{
			GInputStreamClass class_iface = GetClassStruct (gtype, false);
			class_iface.SkipAsync = callback;
			OverrideClassStruct (gtype, class_iface);
		}