// 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 TlsConnection : GLib.IOStream { public TlsConnection (IntPtr raw) : base(raw) {} protected TlsConnection() : base(IntPtr.Zero) { CreateNativeObject (Array.Empty (), Array.Empty ()); } [GLib.Property ("base-io-stream")] public GLib.IOStream BaseIoStream { get { GLib.Value val = GetProperty ("base-io-stream"); GLib.IOStream ret = (GLib.IOStream) val; val.Dispose (); return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_tls_connection_get_use_system_certdb(IntPtr raw); static d_g_tls_connection_get_use_system_certdb g_tls_connection_get_use_system_certdb = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_use_system_certdb")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_tls_connection_set_use_system_certdb(IntPtr raw, bool use_system_certdb); static d_g_tls_connection_set_use_system_certdb g_tls_connection_set_use_system_certdb = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_set_use_system_certdb")); [Obsolete] [GLib.Property ("use-system-certdb")] public bool UseSystemCertdb { get { bool raw_ret = g_tls_connection_get_use_system_certdb(Handle); bool ret = raw_ret; return ret; } set { g_tls_connection_set_use_system_certdb(Handle, value); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_tls_connection_get_database(IntPtr raw); static d_g_tls_connection_get_database g_tls_connection_get_database = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_database")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_tls_connection_set_database(IntPtr raw, IntPtr database); static d_g_tls_connection_set_database g_tls_connection_set_database = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_set_database")); [GLib.Property ("database")] public GLib.TlsDatabase Database { get { IntPtr raw_ret = g_tls_connection_get_database(Handle); GLib.TlsDatabase ret = GLib.Object.GetObject(raw_ret) as GLib.TlsDatabase; return ret; } set { g_tls_connection_set_database(Handle, value == null ? IntPtr.Zero : value.Handle); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_tls_connection_get_interaction(IntPtr raw); static d_g_tls_connection_get_interaction g_tls_connection_get_interaction = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_interaction")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_tls_connection_set_interaction(IntPtr raw, IntPtr interaction); static d_g_tls_connection_set_interaction g_tls_connection_set_interaction = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_set_interaction")); [GLib.Property ("interaction")] public GLib.TlsInteraction Interaction { get { IntPtr raw_ret = g_tls_connection_get_interaction(Handle); GLib.TlsInteraction ret = GLib.Object.GetObject(raw_ret) as GLib.TlsInteraction; return ret; } set { g_tls_connection_set_interaction(Handle, value == null ? IntPtr.Zero : value.Handle); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_tls_connection_get_require_close_notify(IntPtr raw); static d_g_tls_connection_get_require_close_notify g_tls_connection_get_require_close_notify = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_require_close_notify")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_tls_connection_set_require_close_notify(IntPtr raw, bool require_close_notify); static d_g_tls_connection_set_require_close_notify g_tls_connection_set_require_close_notify = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_set_require_close_notify")); [GLib.Property ("require-close-notify")] public bool RequireCloseNotify { get { bool raw_ret = g_tls_connection_get_require_close_notify(Handle); bool ret = raw_ret; return ret; } set { g_tls_connection_set_require_close_notify(Handle, value); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate int d_g_tls_connection_get_rehandshake_mode(IntPtr raw); static d_g_tls_connection_get_rehandshake_mode g_tls_connection_get_rehandshake_mode = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_rehandshake_mode")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_tls_connection_set_rehandshake_mode(IntPtr raw, int mode); static d_g_tls_connection_set_rehandshake_mode g_tls_connection_set_rehandshake_mode = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_set_rehandshake_mode")); [GLib.Property ("rehandshake-mode")] public GLib.TlsRehandshakeMode RehandshakeMode { get { int raw_ret = g_tls_connection_get_rehandshake_mode(Handle); GLib.TlsRehandshakeMode ret = (GLib.TlsRehandshakeMode) raw_ret; return ret; } set { g_tls_connection_set_rehandshake_mode(Handle, (int) value); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_tls_connection_get_certificate(IntPtr raw); static d_g_tls_connection_get_certificate g_tls_connection_get_certificate = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_certificate")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_g_tls_connection_set_certificate(IntPtr raw, IntPtr certificate); static d_g_tls_connection_set_certificate g_tls_connection_set_certificate = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_set_certificate")); [GLib.Property ("certificate")] public GLib.TlsCertificate Certificate { get { IntPtr raw_ret = g_tls_connection_get_certificate(Handle); GLib.TlsCertificate ret = GLib.Object.GetObject(raw_ret) as GLib.TlsCertificate; return ret; } set { g_tls_connection_set_certificate(Handle, value == null ? IntPtr.Zero : value.Handle); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_tls_connection_get_peer_certificate(IntPtr raw); static d_g_tls_connection_get_peer_certificate g_tls_connection_get_peer_certificate = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_peer_certificate")); [GLib.Property ("peer-certificate")] public GLib.TlsCertificate PeerCertificate { get { IntPtr raw_ret = g_tls_connection_get_peer_certificate(Handle); GLib.TlsCertificate ret = GLib.Object.GetObject(raw_ret) as GLib.TlsCertificate; return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate int d_g_tls_connection_get_peer_certificate_errors(IntPtr raw); static d_g_tls_connection_get_peer_certificate_errors g_tls_connection_get_peer_certificate_errors = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_peer_certificate_errors")); [GLib.Property ("peer-certificate-errors")] public GLib.TlsCertificateFlags PeerCertificateErrors { get { int raw_ret = g_tls_connection_get_peer_certificate_errors(Handle); GLib.TlsCertificateFlags ret = (GLib.TlsCertificateFlags) raw_ret; return ret; } } [GLib.Signal("accept-certificate")] public event GLib.AcceptCertificateHandler AcceptCertificate { add { this.AddSignalHandler ("accept-certificate", value, typeof (GLib.AcceptCertificateArgs)); } remove { this.RemoveSignalHandler ("accept-certificate", value); } } static AcceptCertificateNativeDelegate AcceptCertificate_cb_delegate; static AcceptCertificateNativeDelegate AcceptCertificateVMCallback { get { if (AcceptCertificate_cb_delegate == null) AcceptCertificate_cb_delegate = new AcceptCertificateNativeDelegate (AcceptCertificate_cb); return AcceptCertificate_cb_delegate; } } static void OverrideAcceptCertificate (GLib.GType gtype) { OverrideAcceptCertificate (gtype, AcceptCertificateVMCallback); } static void OverrideAcceptCertificate (GLib.GType gtype, AcceptCertificateNativeDelegate callback) { unsafe { IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("accept_certificate")); *raw_ptr = Marshal.GetFunctionPointerForDelegate(callback); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool AcceptCertificateNativeDelegate (IntPtr inst, IntPtr peer_cert, int errors); static bool AcceptCertificate_cb (IntPtr inst, IntPtr peer_cert, int errors) { try { TlsConnection __obj = GLib.Object.GetObject (inst, false) as TlsConnection; bool __result; __result = __obj.OnAcceptCertificate (GLib.Object.GetObject(peer_cert) as GLib.TlsCertificate, (GLib.TlsCertificateFlags) errors); return __result; } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, true); // NOTREACHED: above call does not return. throw; } } [GLib.DefaultSignalHandler(Type=typeof(GLib.TlsConnection), ConnectionMethod="OverrideAcceptCertificate")] protected virtual bool OnAcceptCertificate (GLib.TlsCertificate peer_cert, GLib.TlsCertificateFlags errors) { return InternalAcceptCertificate (peer_cert, errors); } private bool InternalAcceptCertificate (GLib.TlsCertificate peer_cert, GLib.TlsCertificateFlags errors) { AcceptCertificateNativeDelegate unmanaged = class_abi.BaseOverride(this.LookupGType(), "accept_certificate"); if (unmanaged == null) return false; bool __result = unmanaged (this.Handle, peer_cert == null ? IntPtr.Zero : peer_cert.Handle, (int) errors); return __result; } static HandshakeNativeDelegate Handshake_cb_delegate; static HandshakeNativeDelegate HandshakeVMCallback { get { if (Handshake_cb_delegate == null) Handshake_cb_delegate = new HandshakeNativeDelegate (Handshake_cb); return Handshake_cb_delegate; } } static void OverrideHandshake (GLib.GType gtype) { OverrideHandshake (gtype, HandshakeVMCallback); } static void OverrideHandshake (GLib.GType gtype, HandshakeNativeDelegate callback) { unsafe { IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("handshake")); *raw_ptr = Marshal.GetFunctionPointerForDelegate(callback); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool HandshakeNativeDelegate (IntPtr inst, IntPtr cancellable, out IntPtr error); static bool Handshake_cb (IntPtr inst, IntPtr cancellable, out IntPtr error) { error = IntPtr.Zero; try { TlsConnection __obj = GLib.Object.GetObject (inst, false) as TlsConnection; bool __result; __result = __obj.OnHandshake (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.TlsConnection), ConnectionMethod="OverrideHandshake")] protected virtual bool OnHandshake (GLib.Cancellable cancellable) { return InternalHandshake (cancellable); } private bool InternalHandshake (GLib.Cancellable cancellable) { HandshakeNativeDelegate unmanaged = class_abi.BaseOverride(this.LookupGType(), "handshake"); 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 HandshakeAsyncNativeDelegate HandshakeAsync_cb_delegate; static HandshakeAsyncNativeDelegate HandshakeAsyncVMCallback { get { if (HandshakeAsync_cb_delegate == null) HandshakeAsync_cb_delegate = new HandshakeAsyncNativeDelegate (HandshakeAsync_cb); return HandshakeAsync_cb_delegate; } } static void OverrideHandshakeAsync (GLib.GType gtype) { OverrideHandshakeAsync (gtype, HandshakeAsyncVMCallback); } static void OverrideHandshakeAsync (GLib.GType gtype, HandshakeAsyncNativeDelegate callback) { unsafe { IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("handshake_async")); *raw_ptr = Marshal.GetFunctionPointerForDelegate(callback); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void HandshakeAsyncNativeDelegate (IntPtr inst, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data); static void HandshakeAsync_cb (IntPtr inst, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data) { try { TlsConnection __obj = GLib.Object.GetObject (inst, false) as TlsConnection; GLibSharp.AsyncReadyCallbackInvoker cb_invoker = new GLibSharp.AsyncReadyCallbackInvoker (cb, user_data); __obj.OnHandshakeAsync (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.TlsConnection), ConnectionMethod="OverrideHandshakeAsync")] protected virtual void OnHandshakeAsync (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) { InternalHandshakeAsync (io_priority, cancellable, cb); } private void InternalHandshakeAsync (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) { HandshakeAsyncNativeDelegate unmanaged = class_abi.BaseOverride(this.LookupGType(), "handshake_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 HandshakeFinishNativeDelegate HandshakeFinish_cb_delegate; static HandshakeFinishNativeDelegate HandshakeFinishVMCallback { get { if (HandshakeFinish_cb_delegate == null) HandshakeFinish_cb_delegate = new HandshakeFinishNativeDelegate (HandshakeFinish_cb); return HandshakeFinish_cb_delegate; } } static void OverrideHandshakeFinish (GLib.GType gtype) { OverrideHandshakeFinish (gtype, HandshakeFinishVMCallback); } static void OverrideHandshakeFinish (GLib.GType gtype, HandshakeFinishNativeDelegate callback) { unsafe { IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("handshake_finish")); *raw_ptr = Marshal.GetFunctionPointerForDelegate(callback); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool HandshakeFinishNativeDelegate (IntPtr inst, IntPtr result, out IntPtr error); static bool HandshakeFinish_cb (IntPtr inst, IntPtr result, out IntPtr error) { error = IntPtr.Zero; try { TlsConnection __obj = GLib.Object.GetObject (inst, false) as TlsConnection; bool __result; __result = __obj.OnHandshakeFinish (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.TlsConnection), ConnectionMethod="OverrideHandshakeFinish")] protected virtual bool OnHandshakeFinish (GLib.IAsyncResult result) { return InternalHandshakeFinish (result); } private bool InternalHandshakeFinish (GLib.IAsyncResult result) { HandshakeFinishNativeDelegate unmanaged = class_abi.BaseOverride(this.LookupGType(), "handshake_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("accept_certificate" , GLib.IOStream.class_abi.Fields , (uint) sizeof( IntPtr ) // accept_certificate , null , "handshake" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("handshake" , -1 , (uint) sizeof( IntPtr ) // handshake , "accept_certificate" , "handshake_async" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("handshake_async" , -1 , (uint) sizeof( IntPtr ) // handshake_async , "handshake" , "handshake_finish" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("handshake_finish" , -1 , (uint) sizeof( IntPtr ) // handshake_finish , "handshake_async" , "padding" , (uint) sizeof(IntPtr) , 0 ), new GLib.AbiField("padding" , -1 , (uint) sizeof( IntPtr ) * 8 // padding , "handshake_finish" , null , (uint) sizeof(IntPtr) , 0 ), }); return _class_abi; } } // End of the ABI representation. [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_tls_connection_emit_accept_certificate(IntPtr raw, IntPtr peer_cert, int errors); static d_g_tls_connection_emit_accept_certificate g_tls_connection_emit_accept_certificate = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_emit_accept_certificate")); public bool EmitAcceptCertificate(GLib.TlsCertificate peer_cert, GLib.TlsCertificateFlags errors) { bool raw_ret = g_tls_connection_emit_accept_certificate(Handle, peer_cert == null ? IntPtr.Zero : peer_cert.Handle, (int) errors); bool ret = raw_ret; return ret; } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_g_tls_connection_get_type(); static d_g_tls_connection_get_type g_tls_connection_get_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_get_type")); public static new GLib.GType GType { get { IntPtr raw_ret = g_tls_connection_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_tls_connection_handshake(IntPtr raw, IntPtr cancellable, out IntPtr error); static d_g_tls_connection_handshake g_tls_connection_handshake = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_handshake")); public unsafe bool Handshake(GLib.Cancellable cancellable) { IntPtr error = IntPtr.Zero; bool raw_ret = g_tls_connection_handshake(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_tls_connection_handshake_async(IntPtr raw, int io_priority, IntPtr cancellable, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data); static d_g_tls_connection_handshake_async g_tls_connection_handshake_async = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_handshake_async")); public void HandshakeAsync(int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback cb) { GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb); cb_wrapper.PersistUntilCalled (); g_tls_connection_handshake_async(Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, cb_wrapper.NativeDelegate, IntPtr.Zero); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_g_tls_connection_handshake_finish(IntPtr raw, IntPtr result, out IntPtr error); static d_g_tls_connection_handshake_finish g_tls_connection_handshake_finish = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_tls_connection_handshake_finish")); public unsafe bool HandshakeFinish(GLib.IAsyncResult result) { IntPtr error = IntPtr.Zero; bool raw_ret = g_tls_connection_handshake_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; } // 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.IOStream.abi_info.Fields , (uint) sizeof( IntPtr ) // priv , null , null , (uint) sizeof(IntPtr) , 0 ), }); return _abi_info; } } // End of the ABI representation. #endregion } }