// 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 IOStream : GLib.Object { public IOStream (IntPtr raw) : base(raw) {} protected IOStream() : base(IntPtr.Zero) { CreateNativeObject (Array.Empty (), Array.Empty ()); } [GLib.Property ("closed")] public bool Closed { get { GLib.Value val = GetProperty ("closed"); bool ret = (bool) val; val.Dispose (); return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_io_stream_get_input_stream(IntPtr raw); static d_g_io_stream_get_input_stream g_io_stream_get_input_stream = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_get_input_stream")); [GLib.Property ("input-stream")] public GLib.InputStream InputStream { get { IntPtr raw_ret = g_io_stream_get_input_stream(Handle); GLib.InputStream ret = GLib.Object.GetObject(raw_ret) as GLib.InputStream; return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_io_stream_get_output_stream(IntPtr raw); static d_g_io_stream_get_output_stream g_io_stream_get_output_stream = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_get_output_stream")); [GLib.Property ("output-stream")] public GLib.OutputStream OutputStream { get { IntPtr raw_ret = g_io_stream_get_output_stream(Handle); GLib.OutputStream ret = GLib.Object.GetObject(raw_ret) as GLib.OutputStream; return ret; } } static GetInputStreamNativeDelegate GetInputStream_cb_delegate; static GetInputStreamNativeDelegate GetInputStreamVMCallback { get { if (GetInputStream_cb_delegate == null) GetInputStream_cb_delegate = new GetInputStreamNativeDelegate (GetInputStream_cb); return GetInputStream_cb_delegate; } } static void OverrideGetInputStream (GLib.GType gtype) { OverrideGetInputStream (gtype, GetInputStreamVMCallback); } static void OverrideGetInputStream (GLib.GType gtype, GetInputStreamNativeDelegate callback) { unsafe { IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_input_stream")); *raw_ptr = Marshal.GetFunctionPointerForDelegate(callback); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr GetInputStreamNativeDelegate (IntPtr inst); static IntPtr GetInputStream_cb (IntPtr inst) { try { IOStream __obj = GLib.Object.GetObject (inst, false) as IOStream; GLib.InputStream __result; __result = __obj.OnGetInputStream (); return __result == null ? IntPtr.Zero : __result.Handle; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [GLib.DefaultSignalHandler(Type=typeof(GLib.IOStream), ConnectionMethod="OverrideGetInputStream")] protected virtual GLib.InputStream OnGetInputStream () { return InternalGetInputStream (); } private GLib.InputStream InternalGetInputStream () { GetInputStreamNativeDelegate unmanaged = class_abi.BaseOverride(this.LookupGType(), "get_input_stream"); if (unmanaged == null) return null; IntPtr __result = unmanaged (this.Handle); return GLib.Object.GetObject(__result) as GLib.InputStream; } static GetOutputStreamNativeDelegate GetOutputStream_cb_delegate; static GetOutputStreamNativeDelegate GetOutputStreamVMCallback { get { if (GetOutputStream_cb_delegate == null) GetOutputStream_cb_delegate = new GetOutputStreamNativeDelegate (GetOutputStream_cb); return GetOutputStream_cb_delegate; } } static void OverrideGetOutputStream (GLib.GType gtype) { OverrideGetOutputStream (gtype, GetOutputStreamVMCallback); } static void OverrideGetOutputStream (GLib.GType gtype, GetOutputStreamNativeDelegate callback) { unsafe { IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_output_stream")); *raw_ptr = Marshal.GetFunctionPointerForDelegate(callback); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr GetOutputStreamNativeDelegate (IntPtr inst); static IntPtr GetOutputStream_cb (IntPtr inst) { try { IOStream __obj = GLib.Object.GetObject (inst, false) as IOStream; GLib.OutputStream __result; __result = __obj.OnGetOutputStream (); return __result == null ? IntPtr.Zero : __result.Handle; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [GLib.DefaultSignalHandler(Type=typeof(GLib.IOStream), ConnectionMethod="OverrideGetOutputStream")] protected virtual GLib.OutputStream OnGetOutputStream () { return InternalGetOutputStream (); } private GLib.OutputStream InternalGetOutputStream () { GetOutputStreamNativeDelegate unmanaged = class_abi.BaseOverride(this.LookupGType(), "get_output_stream"); if (unmanaged == null) return null; IntPtr __result = unmanaged (this.Handle); return GLib.Object.GetObject(__result) as GLib.OutputStream; } 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 { IOStream __obj = GLib.Object.GetObject (inst, false) as IOStream; 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.IOStream), ConnectionMethod="OverrideCloseFn")] protected virtual bool OnCloseFn (GLib.Cancellable cancellable) { return InternalCloseFn (cancellable); } private bool InternalCloseFn (GLib.Cancellable cancellable) { CloseFnNativeDelegate unmanaged = class_abi.BaseOverride(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 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 { IOStream __obj = GLib.Object.GetObject (inst, false) as IOStream; 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.IOStream), 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(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 { IOStream __obj = GLib.Object.GetObject (inst, false) as IOStream; 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.IOStream), ConnectionMethod="OverrideCloseFinish")] protected virtual bool OnCloseFinish (GLib.IAsyncResult result) { return InternalCloseFinish (result); } private bool InternalCloseFinish (GLib.IAsyncResult result) { CloseFinishNativeDelegate unmanaged = class_abi.BaseOverride(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{ new GLib.AbiField("get_input_stream" , GLib.Object.class_abi.Fields , (uint) sizeof( IntPtr ) // get_input_stream , null , "get_output_stream" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("get_output_stream" , -1 , (uint) sizeof( IntPtr ) // get_output_stream , "get_input_stream" , "close_fn" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("close_fn" , -1 , (uint) sizeof( IntPtr ) // close_fn , "get_output_stream" , "close_async" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("close_async" , -1 , (uint) sizeof( IntPtr ) // close_async , "close_fn" , "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" , "_g_reserved6" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("_g_reserved6" , -1 , (uint) sizeof( IntPtr ) // _g_reserved6 , "_g_reserved5" , "_g_reserved7" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("_g_reserved7" , -1 , (uint) sizeof( IntPtr ) // _g_reserved7 , "_g_reserved6" , "_g_reserved8" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("_g_reserved8" , -1 , (uint) sizeof( IntPtr ) // _g_reserved8 , "_g_reserved7" , "_g_reserved9" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("_g_reserved9" , -1 , (uint) sizeof( IntPtr ) // _g_reserved9 , "_g_reserved8" , "_g_reserved10" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("_g_reserved10" , -1 , (uint) sizeof( IntPtr ) // _g_reserved10 , "_g_reserved9" , null , (uint) sizeof(IntPtr) , 0 ), }); return _class_abi; } } // End of the ABI representation. [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_io_stream_clear_pending(IntPtr raw); static d_g_io_stream_clear_pending g_io_stream_clear_pending = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_clear_pending")); public void ClearPending() { g_io_stream_clear_pending(Handle); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_io_stream_close(IntPtr raw, IntPtr cancellable, out IntPtr error); static d_g_io_stream_close g_io_stream_close = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_close")); public unsafe bool Close(GLib.Cancellable cancellable) { IntPtr error = IntPtr.Zero; bool raw_ret = g_io_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_io_stream_close_async(IntPtr raw, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data); static d_g_io_stream_close_async g_io_stream_close_async = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_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_io_stream_close_async(Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_io_stream_close_finish(IntPtr raw, IntPtr result, out IntPtr error); static d_g_io_stream_close_finish g_io_stream_close_finish = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_close_finish")); public unsafe bool CloseFinish(GLib.IAsyncResult result) { IntPtr error = IntPtr.Zero; bool raw_ret = g_io_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_io_stream_get_type(); static d_g_io_stream_get_type g_io_stream_get_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_get_type")); public static new GLib.GType GType { get { IntPtr raw_ret = g_io_stream_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_io_stream_has_pending(IntPtr raw); static d_g_io_stream_has_pending g_io_stream_has_pending = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_has_pending")); public bool HasPending { get { bool raw_ret = g_io_stream_has_pending(Handle); bool ret = raw_ret; return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_io_stream_is_closed(IntPtr raw); static d_g_io_stream_is_closed g_io_stream_is_closed = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_is_closed")); public bool IsClosed { get { bool raw_ret = g_io_stream_is_closed(Handle); bool ret = raw_ret; return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_io_stream_set_pending(IntPtr raw, out IntPtr error); static d_g_io_stream_set_pending g_io_stream_set_pending = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_set_pending")); public unsafe bool SetPending() { IntPtr error = IntPtr.Zero; bool raw_ret = g_io_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 void d_g_io_stream_splice_async(IntPtr raw, IntPtr stream2, int flags, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data); static d_g_io_stream_splice_async g_io_stream_splice_async = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_splice_async")); public void SpliceAsync(GLib.IOStream stream2, GLib.IOStreamSpliceFlags flags, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) { GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb); cb_wrapper.PersistUntilCalled (); g_io_stream_splice_async(Handle, stream2 == null ? IntPtr.Zero : stream2.Handle, (int) flags, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_io_stream_splice_finish(IntPtr result, out IntPtr error); static d_g_io_stream_splice_finish g_io_stream_splice_finish = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_io_stream_splice_finish")); public static unsafe bool SpliceFinish(GLib.IAsyncResult result) { IntPtr error = IntPtr.Zero; bool raw_ret = g_io_stream_splice_finish(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; } // 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{ 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 } }