905 lines
37 KiB
C#
905 lines
37 KiB
C#
|
|
// This file was generated by the Gtk# code generator.
|
||
|
|
// Any changes made will be lost if regenerated.
|
||
|
|
|
||
|
|
namespace GLib {
|
||
|
|
|
||
|
|
using System;
|
||
|
|
using System.Collections;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.Runtime.InteropServices;
|
||
|
|
using static GLib.AbiStructExtension;
|
||
|
|
|
||
|
|
#region Autogenerated code
|
||
|
|
public partial class InputStream : GLib.Object {
|
||
|
|
|
||
|
|
public InputStream (IntPtr raw) : base(raw) {}
|
||
|
|
|
||
|
|
protected InputStream() : base(IntPtr.Zero)
|
||
|
|
{
|
||
|
|
CreateNativeObject (Array.Empty<string> (), Array.Empty<GLib.Value> ());
|
||
|
|
}
|
||
|
|
|
||
|
|
static ReadFnNativeDelegate ReadFn_cb_delegate;
|
||
|
|
static ReadFnNativeDelegate ReadFnVMCallback {
|
||
|
|
get {
|
||
|
|
if (ReadFn_cb_delegate == null)
|
||
|
|
ReadFn_cb_delegate = new ReadFnNativeDelegate (ReadFn_cb);
|
||
|
|
return ReadFn_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideReadFn (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideReadFn (gtype, ReadFnVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideReadFn (GLib.GType gtype, ReadFnNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("read_fn"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr ReadFnNativeDelegate (IntPtr inst, IntPtr buffer, UIntPtr count, IntPtr cancellable, out IntPtr error);
|
||
|
|
|
||
|
|
static IntPtr ReadFn_cb (IntPtr inst, IntPtr buffer, UIntPtr count, IntPtr cancellable, out IntPtr error)
|
||
|
|
{
|
||
|
|
error = IntPtr.Zero;
|
||
|
|
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
long __result;
|
||
|
|
__result = __obj.OnReadFn (buffer, (ulong) count, GLib.Object.GetObject(cancellable) as GLib.Cancellable);
|
||
|
|
return new IntPtr (__result);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||
|
|
// NOTREACHED: above call does not return.
|
||
|
|
throw;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideReadFn")]
|
||
|
|
protected virtual long OnReadFn (IntPtr buffer, ulong count, GLib.Cancellable cancellable)
|
||
|
|
{
|
||
|
|
return InternalReadFn (buffer, count, cancellable);
|
||
|
|
}
|
||
|
|
|
||
|
|
private long InternalReadFn (IntPtr buffer, ulong count, GLib.Cancellable cancellable)
|
||
|
|
{
|
||
|
|
ReadFnNativeDelegate unmanaged = class_abi.BaseOverride<ReadFnNativeDelegate>(this.LookupGType(), "read_fn");
|
||
|
|
if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
|
||
|
|
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr __result = unmanaged (this.Handle, buffer, new UIntPtr (count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
return (long) __result;
|
||
|
|
}
|
||
|
|
|
||
|
|
static SkipNativeDelegate Skip_cb_delegate;
|
||
|
|
static SkipNativeDelegate SkipVMCallback {
|
||
|
|
get {
|
||
|
|
if (Skip_cb_delegate == null)
|
||
|
|
Skip_cb_delegate = new SkipNativeDelegate (Skip_cb);
|
||
|
|
return Skip_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideSkip (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideSkip (gtype, SkipVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideSkip (GLib.GType gtype, SkipNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("skip"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr SkipNativeDelegate (IntPtr inst, UIntPtr count, IntPtr cancellable, out IntPtr error);
|
||
|
|
|
||
|
|
static IntPtr Skip_cb (IntPtr inst, UIntPtr count, IntPtr cancellable, out IntPtr error)
|
||
|
|
{
|
||
|
|
error = IntPtr.Zero;
|
||
|
|
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
long __result;
|
||
|
|
__result = __obj.OnSkip ((ulong) count, GLib.Object.GetObject(cancellable) as GLib.Cancellable);
|
||
|
|
return new IntPtr (__result);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||
|
|
// NOTREACHED: above call does not return.
|
||
|
|
throw;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideSkip")]
|
||
|
|
protected virtual long OnSkip (ulong count, GLib.Cancellable cancellable)
|
||
|
|
{
|
||
|
|
return InternalSkip (count, cancellable);
|
||
|
|
}
|
||
|
|
|
||
|
|
private long InternalSkip (ulong count, GLib.Cancellable cancellable)
|
||
|
|
{
|
||
|
|
SkipNativeDelegate unmanaged = class_abi.BaseOverride<SkipNativeDelegate>(this.LookupGType(), "skip");
|
||
|
|
if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
|
||
|
|
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr __result = unmanaged (this.Handle, new UIntPtr (count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
return (long) __result;
|
||
|
|
}
|
||
|
|
|
||
|
|
static CloseFnNativeDelegate CloseFn_cb_delegate;
|
||
|
|
static CloseFnNativeDelegate CloseFnVMCallback {
|
||
|
|
get {
|
||
|
|
if (CloseFn_cb_delegate == null)
|
||
|
|
CloseFn_cb_delegate = new CloseFnNativeDelegate (CloseFn_cb);
|
||
|
|
return CloseFn_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideCloseFn (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideCloseFn (gtype, CloseFnVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideCloseFn (GLib.GType gtype, CloseFnNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close_fn"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool CloseFnNativeDelegate (IntPtr inst, IntPtr cancellable, out IntPtr error);
|
||
|
|
|
||
|
|
static bool CloseFn_cb (IntPtr inst, IntPtr cancellable, out IntPtr error)
|
||
|
|
{
|
||
|
|
error = IntPtr.Zero;
|
||
|
|
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
bool __result;
|
||
|
|
__result = __obj.OnCloseFn (GLib.Object.GetObject(cancellable) as GLib.Cancellable);
|
||
|
|
return __result;
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||
|
|
// NOTREACHED: above call does not return.
|
||
|
|
throw;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideCloseFn")]
|
||
|
|
protected virtual bool OnCloseFn (GLib.Cancellable cancellable)
|
||
|
|
{
|
||
|
|
return InternalCloseFn (cancellable);
|
||
|
|
}
|
||
|
|
|
||
|
|
private bool InternalCloseFn (GLib.Cancellable cancellable)
|
||
|
|
{
|
||
|
|
CloseFnNativeDelegate unmanaged = class_abi.BaseOverride<CloseFnNativeDelegate>(this.LookupGType(), "close_fn");
|
||
|
|
if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
|
||
|
|
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool __result = unmanaged (this.Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
return __result;
|
||
|
|
}
|
||
|
|
|
||
|
|
static ReadAsyncNativeDelegate ReadAsync_cb_delegate;
|
||
|
|
static ReadAsyncNativeDelegate ReadAsyncVMCallback {
|
||
|
|
get {
|
||
|
|
if (ReadAsync_cb_delegate == null)
|
||
|
|
ReadAsync_cb_delegate = new ReadAsyncNativeDelegate (ReadAsync_cb);
|
||
|
|
return ReadAsync_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideReadAsync (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideReadAsync (gtype, ReadAsyncVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideReadAsync (GLib.GType gtype, ReadAsyncNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("read_async"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void ReadAsyncNativeDelegate (IntPtr inst, IntPtr buffer, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
|
||
|
|
static void ReadAsync_cb (IntPtr inst, IntPtr buffer, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
GLibSharp.AsyncReadyCallbackInvoker cb_invoker = new GLibSharp.AsyncReadyCallbackInvoker (cb, user_data);
|
||
|
|
__obj.OnReadAsync (buffer, (ulong) count, io_priority, GLib.Object.GetObject(cancellable) as GLib.Cancellable, cb_invoker.Handler);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideReadAsync")]
|
||
|
|
protected virtual void OnReadAsync (IntPtr buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
|
||
|
|
{
|
||
|
|
InternalReadAsync (buffer, count, io_priority, cancellable, cb);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InternalReadAsync (IntPtr buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
|
||
|
|
{
|
||
|
|
ReadAsyncNativeDelegate unmanaged = class_abi.BaseOverride<ReadAsyncNativeDelegate>(this.LookupGType(), "read_async");
|
||
|
|
if (unmanaged == null) return;
|
||
|
|
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
unmanaged (this.Handle, buffer, new UIntPtr (count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
static ReadFinishNativeDelegate ReadFinish_cb_delegate;
|
||
|
|
static ReadFinishNativeDelegate ReadFinishVMCallback {
|
||
|
|
get {
|
||
|
|
if (ReadFinish_cb_delegate == null)
|
||
|
|
ReadFinish_cb_delegate = new ReadFinishNativeDelegate (ReadFinish_cb);
|
||
|
|
return ReadFinish_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideReadFinish (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideReadFinish (gtype, ReadFinishVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideReadFinish (GLib.GType gtype, ReadFinishNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("read_finish"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr ReadFinishNativeDelegate (IntPtr inst, IntPtr result, out IntPtr error);
|
||
|
|
|
||
|
|
static IntPtr ReadFinish_cb (IntPtr inst, IntPtr result, out IntPtr error)
|
||
|
|
{
|
||
|
|
error = IntPtr.Zero;
|
||
|
|
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
long __result;
|
||
|
|
__result = __obj.OnReadFinish (GLib.AsyncResultAdapter.GetObject (result, false));
|
||
|
|
return new IntPtr (__result);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||
|
|
// NOTREACHED: above call does not return.
|
||
|
|
throw;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideReadFinish")]
|
||
|
|
protected virtual long OnReadFinish (GLib.IAsyncResult result)
|
||
|
|
{
|
||
|
|
return InternalReadFinish (result);
|
||
|
|
}
|
||
|
|
|
||
|
|
private long InternalReadFinish (GLib.IAsyncResult result)
|
||
|
|
{
|
||
|
|
ReadFinishNativeDelegate unmanaged = class_abi.BaseOverride<ReadFinishNativeDelegate>(this.LookupGType(), "read_finish");
|
||
|
|
if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
|
||
|
|
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr __result = unmanaged (this.Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
return (long) __result;
|
||
|
|
}
|
||
|
|
|
||
|
|
static SkipAsyncNativeDelegate SkipAsync_cb_delegate;
|
||
|
|
static SkipAsyncNativeDelegate SkipAsyncVMCallback {
|
||
|
|
get {
|
||
|
|
if (SkipAsync_cb_delegate == null)
|
||
|
|
SkipAsync_cb_delegate = new SkipAsyncNativeDelegate (SkipAsync_cb);
|
||
|
|
return SkipAsync_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideSkipAsync (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideSkipAsync (gtype, SkipAsyncVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
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(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void SkipAsyncNativeDelegate (IntPtr inst, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
|
||
|
|
static void SkipAsync_cb (IntPtr inst, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
GLibSharp.AsyncReadyCallbackInvoker cb_invoker = new GLibSharp.AsyncReadyCallbackInvoker (cb, user_data);
|
||
|
|
__obj.OnSkipAsync ((ulong) count, io_priority, GLib.Object.GetObject(cancellable) as GLib.Cancellable, cb_invoker.Handler);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideSkipAsync")]
|
||
|
|
protected virtual void OnSkipAsync (ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
|
||
|
|
{
|
||
|
|
InternalSkipAsync (count, io_priority, cancellable, cb);
|
||
|
|
}
|
||
|
|
|
||
|
|
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);
|
||
|
|
}
|
||
|
|
|
||
|
|
static SkipFinishNativeDelegate SkipFinish_cb_delegate;
|
||
|
|
static SkipFinishNativeDelegate SkipFinishVMCallback {
|
||
|
|
get {
|
||
|
|
if (SkipFinish_cb_delegate == null)
|
||
|
|
SkipFinish_cb_delegate = new SkipFinishNativeDelegate (SkipFinish_cb);
|
||
|
|
return SkipFinish_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideSkipFinish (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideSkipFinish (gtype, SkipFinishVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideSkipFinish (GLib.GType gtype, SkipFinishNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("skip_finish"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr SkipFinishNativeDelegate (IntPtr inst, IntPtr result, out IntPtr error);
|
||
|
|
|
||
|
|
static IntPtr SkipFinish_cb (IntPtr inst, IntPtr result, out IntPtr error)
|
||
|
|
{
|
||
|
|
error = IntPtr.Zero;
|
||
|
|
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
long __result;
|
||
|
|
__result = __obj.OnSkipFinish (GLib.AsyncResultAdapter.GetObject (result, false));
|
||
|
|
return new IntPtr (__result);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||
|
|
// NOTREACHED: above call does not return.
|
||
|
|
throw;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideSkipFinish")]
|
||
|
|
protected virtual long OnSkipFinish (GLib.IAsyncResult result)
|
||
|
|
{
|
||
|
|
return InternalSkipFinish (result);
|
||
|
|
}
|
||
|
|
|
||
|
|
private long InternalSkipFinish (GLib.IAsyncResult result)
|
||
|
|
{
|
||
|
|
SkipFinishNativeDelegate unmanaged = class_abi.BaseOverride<SkipFinishNativeDelegate>(this.LookupGType(), "skip_finish");
|
||
|
|
if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
|
||
|
|
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr __result = unmanaged (this.Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
return (long) __result;
|
||
|
|
}
|
||
|
|
|
||
|
|
static CloseAsyncNativeDelegate CloseAsync_cb_delegate;
|
||
|
|
static CloseAsyncNativeDelegate CloseAsyncVMCallback {
|
||
|
|
get {
|
||
|
|
if (CloseAsync_cb_delegate == null)
|
||
|
|
CloseAsync_cb_delegate = new CloseAsyncNativeDelegate (CloseAsync_cb);
|
||
|
|
return CloseAsync_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideCloseAsync (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideCloseAsync (gtype, CloseAsyncVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideCloseAsync (GLib.GType gtype, CloseAsyncNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close_async"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void CloseAsyncNativeDelegate (IntPtr inst, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
|
||
|
|
static void CloseAsync_cb (IntPtr inst, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data)
|
||
|
|
{
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
GLibSharp.AsyncReadyCallbackInvoker cb_invoker = new GLibSharp.AsyncReadyCallbackInvoker (cb, user_data);
|
||
|
|
__obj.OnCloseAsync (io_priority, GLib.Object.GetObject(cancellable) as GLib.Cancellable, cb_invoker.Handler);
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideCloseAsync")]
|
||
|
|
protected virtual void OnCloseAsync (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
|
||
|
|
{
|
||
|
|
InternalCloseAsync (io_priority, cancellable, cb);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InternalCloseAsync (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb)
|
||
|
|
{
|
||
|
|
CloseAsyncNativeDelegate unmanaged = class_abi.BaseOverride<CloseAsyncNativeDelegate>(this.LookupGType(), "close_async");
|
||
|
|
if (unmanaged == null) return;
|
||
|
|
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
unmanaged (this.Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
static CloseFinishNativeDelegate CloseFinish_cb_delegate;
|
||
|
|
static CloseFinishNativeDelegate CloseFinishVMCallback {
|
||
|
|
get {
|
||
|
|
if (CloseFinish_cb_delegate == null)
|
||
|
|
CloseFinish_cb_delegate = new CloseFinishNativeDelegate (CloseFinish_cb);
|
||
|
|
return CloseFinish_cb_delegate;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideCloseFinish (GLib.GType gtype)
|
||
|
|
{
|
||
|
|
OverrideCloseFinish (gtype, CloseFinishVMCallback);
|
||
|
|
}
|
||
|
|
|
||
|
|
static void OverrideCloseFinish (GLib.GType gtype, CloseFinishNativeDelegate callback)
|
||
|
|
{
|
||
|
|
unsafe {
|
||
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close_finish"));
|
||
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate(callback);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool CloseFinishNativeDelegate (IntPtr inst, IntPtr result, out IntPtr error);
|
||
|
|
|
||
|
|
static bool CloseFinish_cb (IntPtr inst, IntPtr result, out IntPtr error)
|
||
|
|
{
|
||
|
|
error = IntPtr.Zero;
|
||
|
|
|
||
|
|
try {
|
||
|
|
InputStream __obj = GLib.Object.GetObject (inst, false) as InputStream;
|
||
|
|
bool __result;
|
||
|
|
__result = __obj.OnCloseFinish (GLib.AsyncResultAdapter.GetObject (result, false));
|
||
|
|
return __result;
|
||
|
|
} catch (Exception e) {
|
||
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
||
|
|
// NOTREACHED: above call does not return.
|
||
|
|
throw;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[GLib.DefaultSignalHandler(Type=typeof(GLib.InputStream), ConnectionMethod="OverrideCloseFinish")]
|
||
|
|
protected virtual bool OnCloseFinish (GLib.IAsyncResult result)
|
||
|
|
{
|
||
|
|
return InternalCloseFinish (result);
|
||
|
|
}
|
||
|
|
|
||
|
|
private bool InternalCloseFinish (GLib.IAsyncResult result)
|
||
|
|
{
|
||
|
|
CloseFinishNativeDelegate unmanaged = class_abi.BaseOverride<CloseFinishNativeDelegate>(this.LookupGType(), "close_finish");
|
||
|
|
if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");
|
||
|
|
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool __result = unmanaged (this.Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
return __result;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// Internal representation of the wrapped structure ABI.
|
||
|
|
static GLib.AbiStruct _class_abi = null;
|
||
|
|
static public unsafe new GLib.AbiStruct class_abi {
|
||
|
|
get {
|
||
|
|
if (_class_abi == null)
|
||
|
|
_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{
|
||
|
|
new GLib.AbiField("read_fn"
|
||
|
|
, GLib.Object.class_abi.Fields
|
||
|
|
, (uint) sizeof( IntPtr ) // read_fn
|
||
|
|
, null
|
||
|
|
, "skip"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("skip"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // skip
|
||
|
|
, "read_fn"
|
||
|
|
, "close_fn"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("close_fn"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // close_fn
|
||
|
|
, "skip"
|
||
|
|
, "read_async"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("read_async"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // read_async
|
||
|
|
, "close_fn"
|
||
|
|
, "read_finish"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("read_finish"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // read_finish
|
||
|
|
, "read_async"
|
||
|
|
, "skip_async"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("skip_async"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // skip_async
|
||
|
|
, "read_finish"
|
||
|
|
, "skip_finish"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("skip_finish"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // skip_finish
|
||
|
|
, "skip_async"
|
||
|
|
, "close_async"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("close_async"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // close_async
|
||
|
|
, "skip_finish"
|
||
|
|
, "close_finish"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("close_finish"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // close_finish
|
||
|
|
, "close_async"
|
||
|
|
, "_g_reserved1"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("_g_reserved1"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // _g_reserved1
|
||
|
|
, "close_finish"
|
||
|
|
, "_g_reserved2"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("_g_reserved2"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // _g_reserved2
|
||
|
|
, "_g_reserved1"
|
||
|
|
, "_g_reserved3"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("_g_reserved3"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // _g_reserved3
|
||
|
|
, "_g_reserved2"
|
||
|
|
, "_g_reserved4"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("_g_reserved4"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // _g_reserved4
|
||
|
|
, "_g_reserved3"
|
||
|
|
, "_g_reserved5"
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
new GLib.AbiField("_g_reserved5"
|
||
|
|
, -1
|
||
|
|
, (uint) sizeof( IntPtr ) // _g_reserved5
|
||
|
|
, "_g_reserved4"
|
||
|
|
, null
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
});
|
||
|
|
|
||
|
|
return _class_abi;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// End of the ABI representation.
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_input_stream_clear_pending(IntPtr raw);
|
||
|
|
static d_g_input_stream_clear_pending g_input_stream_clear_pending = FuncLoader.LoadFunction<d_g_input_stream_clear_pending>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_clear_pending"));
|
||
|
|
|
||
|
|
public void ClearPending() {
|
||
|
|
g_input_stream_clear_pending(Handle);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_close(IntPtr raw, IntPtr cancellable, out IntPtr error);
|
||
|
|
static d_g_input_stream_close g_input_stream_close = FuncLoader.LoadFunction<d_g_input_stream_close>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_close"));
|
||
|
|
|
||
|
|
public unsafe bool Close(GLib.Cancellable cancellable) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool raw_ret = g_input_stream_close(Handle, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_input_stream_close_async(IntPtr raw, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
static d_g_input_stream_close_async g_input_stream_close_async = FuncLoader.LoadFunction<d_g_input_stream_close_async>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_close_async"));
|
||
|
|
|
||
|
|
public void CloseAsync(int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) {
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
g_input_stream_close_async(Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_close_finish(IntPtr raw, IntPtr result, out IntPtr error);
|
||
|
|
static d_g_input_stream_close_finish g_input_stream_close_finish = FuncLoader.LoadFunction<d_g_input_stream_close_finish>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_close_finish"));
|
||
|
|
|
||
|
|
public unsafe bool CloseFinish(GLib.IAsyncResult result) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool raw_ret = g_input_stream_close_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_get_type();
|
||
|
|
static d_g_input_stream_get_type g_input_stream_get_type = FuncLoader.LoadFunction<d_g_input_stream_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_get_type"));
|
||
|
|
|
||
|
|
public static new GLib.GType GType {
|
||
|
|
get {
|
||
|
|
IntPtr raw_ret = g_input_stream_get_type();
|
||
|
|
GLib.GType ret = new GLib.GType(raw_ret);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_has_pending(IntPtr raw);
|
||
|
|
static d_g_input_stream_has_pending g_input_stream_has_pending = FuncLoader.LoadFunction<d_g_input_stream_has_pending>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_has_pending"));
|
||
|
|
|
||
|
|
public bool HasPending {
|
||
|
|
get {
|
||
|
|
bool raw_ret = g_input_stream_has_pending(Handle);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_is_closed(IntPtr raw);
|
||
|
|
static d_g_input_stream_is_closed g_input_stream_is_closed = FuncLoader.LoadFunction<d_g_input_stream_is_closed>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_is_closed"));
|
||
|
|
|
||
|
|
public bool IsClosed {
|
||
|
|
get {
|
||
|
|
bool raw_ret = g_input_stream_is_closed(Handle);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_read(IntPtr raw, byte[] buffer, UIntPtr count, IntPtr cancellable, out IntPtr error);
|
||
|
|
static d_g_input_stream_read g_input_stream_read = FuncLoader.LoadFunction<d_g_input_stream_read>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read"));
|
||
|
|
|
||
|
|
public unsafe long Read(byte[] buffer, ulong count, GLib.Cancellable cancellable) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr raw_ret = g_input_stream_read(Handle, buffer, new UIntPtr (count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
long ret = (long) raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_read_all(IntPtr raw, byte[] buffer, UIntPtr count, out UIntPtr bytes_read, IntPtr cancellable, out IntPtr error);
|
||
|
|
static d_g_input_stream_read_all g_input_stream_read_all = FuncLoader.LoadFunction<d_g_input_stream_read_all>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_all"));
|
||
|
|
|
||
|
|
public unsafe bool ReadAll(byte[] buffer, ulong count, out ulong bytes_read, GLib.Cancellable cancellable) {
|
||
|
|
UIntPtr native_bytes_read;
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool raw_ret = g_input_stream_read_all(Handle, buffer, new UIntPtr (count), out native_bytes_read, cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
bytes_read = (ulong) native_bytes_read;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_input_stream_read_all_async(IntPtr raw, IntPtr buffer, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
static d_g_input_stream_read_all_async g_input_stream_read_all_async = FuncLoader.LoadFunction<d_g_input_stream_read_all_async>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_all_async"));
|
||
|
|
|
||
|
|
public void ReadAllAsync(IntPtr buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) {
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
g_input_stream_read_all_async(Handle, buffer, new UIntPtr (count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_read_all_finish(IntPtr raw, IntPtr result, out UIntPtr bytes_read, out IntPtr error);
|
||
|
|
static d_g_input_stream_read_all_finish g_input_stream_read_all_finish = FuncLoader.LoadFunction<d_g_input_stream_read_all_finish>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_all_finish"));
|
||
|
|
|
||
|
|
public unsafe bool ReadAllFinish(GLib.IAsyncResult result, out ulong bytes_read) {
|
||
|
|
UIntPtr native_bytes_read;
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool raw_ret = g_input_stream_read_all_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out native_bytes_read, out error);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
bytes_read = (ulong) native_bytes_read;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_input_stream_read_async(IntPtr raw, byte[] buffer, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
static d_g_input_stream_read_async g_input_stream_read_async = FuncLoader.LoadFunction<d_g_input_stream_read_async>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_async"));
|
||
|
|
|
||
|
|
public void ReadAsync(byte[] buffer, ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) {
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
g_input_stream_read_async(Handle, buffer, new UIntPtr (count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_read_bytes(IntPtr raw, UIntPtr count, IntPtr cancellable, out IntPtr error);
|
||
|
|
static d_g_input_stream_read_bytes g_input_stream_read_bytes = FuncLoader.LoadFunction<d_g_input_stream_read_bytes>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_bytes"));
|
||
|
|
|
||
|
|
public unsafe GLib.Bytes ReadBytes(ulong count, GLib.Cancellable cancellable) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr raw_ret = g_input_stream_read_bytes(Handle, new UIntPtr (count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
GLib.Bytes ret = new GLib.Bytes(raw_ret);
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_input_stream_read_bytes_async(IntPtr raw, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
static d_g_input_stream_read_bytes_async g_input_stream_read_bytes_async = FuncLoader.LoadFunction<d_g_input_stream_read_bytes_async>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_bytes_async"));
|
||
|
|
|
||
|
|
public void ReadBytesAsync(ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) {
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
g_input_stream_read_bytes_async(Handle, new UIntPtr (count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_read_bytes_finish(IntPtr raw, IntPtr result, out IntPtr error);
|
||
|
|
static d_g_input_stream_read_bytes_finish g_input_stream_read_bytes_finish = FuncLoader.LoadFunction<d_g_input_stream_read_bytes_finish>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_bytes_finish"));
|
||
|
|
|
||
|
|
public unsafe GLib.Bytes ReadBytesFinish(GLib.IAsyncResult result) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr raw_ret = g_input_stream_read_bytes_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
GLib.Bytes ret = new GLib.Bytes(raw_ret);
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_read_finish(IntPtr raw, IntPtr result, out IntPtr error);
|
||
|
|
static d_g_input_stream_read_finish g_input_stream_read_finish = FuncLoader.LoadFunction<d_g_input_stream_read_finish>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_read_finish"));
|
||
|
|
|
||
|
|
public unsafe long ReadFinish(GLib.IAsyncResult result) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr raw_ret = g_input_stream_read_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
long ret = (long) raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate bool d_g_input_stream_set_pending(IntPtr raw, out IntPtr error);
|
||
|
|
static d_g_input_stream_set_pending g_input_stream_set_pending = FuncLoader.LoadFunction<d_g_input_stream_set_pending>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_set_pending"));
|
||
|
|
|
||
|
|
public unsafe bool SetPending() {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
bool raw_ret = g_input_stream_set_pending(Handle, out error);
|
||
|
|
bool ret = raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_skip(IntPtr raw, UIntPtr count, IntPtr cancellable, out IntPtr error);
|
||
|
|
static d_g_input_stream_skip g_input_stream_skip = FuncLoader.LoadFunction<d_g_input_stream_skip>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_skip"));
|
||
|
|
|
||
|
|
public unsafe long Skip(ulong count, GLib.Cancellable cancellable) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr raw_ret = g_input_stream_skip(Handle, new UIntPtr (count), cancellable == null ? IntPtr.Zero : cancellable.Handle, out error);
|
||
|
|
long ret = (long) raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate void d_g_input_stream_skip_async(IntPtr raw, UIntPtr count, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data);
|
||
|
|
static d_g_input_stream_skip_async g_input_stream_skip_async = FuncLoader.LoadFunction<d_g_input_stream_skip_async>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_skip_async"));
|
||
|
|
|
||
|
|
public void SkipAsync(ulong count, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) {
|
||
|
|
GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb);
|
||
|
|
cb_wrapper.PersistUntilCalled ();
|
||
|
|
g_input_stream_skip_async(Handle, new UIntPtr (count), io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero);
|
||
|
|
}
|
||
|
|
|
||
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
||
|
|
delegate IntPtr d_g_input_stream_skip_finish(IntPtr raw, IntPtr result, out IntPtr error);
|
||
|
|
static d_g_input_stream_skip_finish g_input_stream_skip_finish = FuncLoader.LoadFunction<d_g_input_stream_skip_finish>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_input_stream_skip_finish"));
|
||
|
|
|
||
|
|
public unsafe long SkipFinish(GLib.IAsyncResult result) {
|
||
|
|
IntPtr error = IntPtr.Zero;
|
||
|
|
IntPtr raw_ret = g_input_stream_skip_finish(Handle, result == null ? IntPtr.Zero : ((result is GLib.Object) ? (result as GLib.Object).Handle : (result as GLib.AsyncResultAdapter).Handle), out error);
|
||
|
|
long ret = (long) raw_ret;
|
||
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// Internal representation of the wrapped structure ABI.
|
||
|
|
static GLib.AbiStruct _abi_info = null;
|
||
|
|
static public unsafe new GLib.AbiStruct abi_info {
|
||
|
|
get {
|
||
|
|
if (_abi_info == null)
|
||
|
|
_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{
|
||
|
|
new GLib.AbiField("priv"
|
||
|
|
, GLib.Object.abi_info.Fields
|
||
|
|
, (uint) sizeof( IntPtr ) // priv
|
||
|
|
, null
|
||
|
|
, null
|
||
|
|
, (uint) sizeof(IntPtr)
|
||
|
|
, 0
|
||
|
|
),
|
||
|
|
});
|
||
|
|
|
||
|
|
return _abi_info;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// End of the ABI representation.
|
||
|
|
|
||
|
|
#endregion
|
||
|
|
}
|
||
|
|
}
|