// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace GtkSource { using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using static GLib.AbiStructExtension; #region Autogenerated code public partial class FileSaver : GLib.Object { public FileSaver (IntPtr raw) : base(raw) {} [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_new(IntPtr buffer, IntPtr file); static d_gtk_source_file_saver_new gtk_source_file_saver_new = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_new")); public FileSaver (GtkSource.Buffer buffer, GtkSource.File file) : base (IntPtr.Zero) { if (GetType () != typeof (FileSaver)) { var vals = new List (); var names = new List (); if (buffer != null) { names.Add ("buffer"); vals.Add (new GLib.Value (buffer)); } if (file != null) { names.Add ("file"); vals.Add (new GLib.Value (file)); } CreateNativeObject (names.ToArray (), vals.ToArray ()); return; } Raw = gtk_source_file_saver_new(buffer == null ? IntPtr.Zero : buffer.Handle, file == null ? IntPtr.Zero : file.Handle); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_new_with_target(IntPtr buffer, IntPtr file, IntPtr target_location); static d_gtk_source_file_saver_new_with_target gtk_source_file_saver_new_with_target = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_new_with_target")); public FileSaver (GtkSource.Buffer buffer, GtkSource.File file, GLib.IFile target_location) : base (IntPtr.Zero) { if (GetType () != typeof (FileSaver)) { var vals = new List (); var names = new List (); if (buffer != null) { names.Add ("buffer"); vals.Add (new GLib.Value (buffer)); } if (file != null) { names.Add ("file"); vals.Add (new GLib.Value (file)); } CreateNativeObject (names.ToArray (), vals.ToArray ()); return; } Raw = gtk_source_file_saver_new_with_target(buffer == null ? IntPtr.Zero : buffer.Handle, file == null ? IntPtr.Zero : file.Handle, target_location == null ? IntPtr.Zero : ((target_location is GLib.Object) ? (target_location as GLib.Object).Handle : (target_location as GLib.FileAdapter).Handle)); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_get_buffer(IntPtr raw); static d_gtk_source_file_saver_get_buffer gtk_source_file_saver_get_buffer = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_buffer")); [GLib.Property ("buffer")] public GtkSource.Buffer Buffer { get { IntPtr raw_ret = gtk_source_file_saver_get_buffer(Handle); GtkSource.Buffer ret = GLib.Object.GetObject(raw_ret) as GtkSource.Buffer; return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_get_file(IntPtr raw); static d_gtk_source_file_saver_get_file gtk_source_file_saver_get_file = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_file")); [GLib.Property ("file")] public GtkSource.File File { get { IntPtr raw_ret = gtk_source_file_saver_get_file(Handle); GtkSource.File ret = GLib.Object.GetObject(raw_ret) as GtkSource.File; return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_get_location(IntPtr raw); static d_gtk_source_file_saver_get_location gtk_source_file_saver_get_location = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_location")); [GLib.Property ("location")] public GLib.IFile Location { get { IntPtr raw_ret = gtk_source_file_saver_get_location(Handle); GLib.IFile ret = GLib.FileAdapter.GetObject (raw_ret, false); return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_get_encoding(IntPtr raw); static d_gtk_source_file_saver_get_encoding gtk_source_file_saver_get_encoding = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_encoding")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_gtk_source_file_saver_set_encoding(IntPtr raw, IntPtr encoding); static d_gtk_source_file_saver_set_encoding gtk_source_file_saver_set_encoding = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_set_encoding")); [GLib.Property ("encoding")] public GtkSource.Encoding Encoding { get { IntPtr raw_ret = gtk_source_file_saver_get_encoding(Handle); GtkSource.Encoding ret = raw_ret == IntPtr.Zero ? null : (GtkSource.Encoding) GLib.Opaque.GetOpaque (raw_ret, typeof (GtkSource.Encoding), false); return ret; } set { gtk_source_file_saver_set_encoding(Handle, value == null ? IntPtr.Zero : value.Handle); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate int d_gtk_source_file_saver_get_newline_type(IntPtr raw); static d_gtk_source_file_saver_get_newline_type gtk_source_file_saver_get_newline_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_newline_type")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_gtk_source_file_saver_set_newline_type(IntPtr raw, int newline_type); static d_gtk_source_file_saver_set_newline_type gtk_source_file_saver_set_newline_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_set_newline_type")); [GLib.Property ("newline-type")] public GtkSource.NewlineType NewlineType { get { int raw_ret = gtk_source_file_saver_get_newline_type(Handle); GtkSource.NewlineType ret = (GtkSource.NewlineType) raw_ret; return ret; } set { gtk_source_file_saver_set_newline_type(Handle, (int) value); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate int d_gtk_source_file_saver_get_compression_type(IntPtr raw); static d_gtk_source_file_saver_get_compression_type gtk_source_file_saver_get_compression_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_compression_type")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_gtk_source_file_saver_set_compression_type(IntPtr raw, int compression_type); static d_gtk_source_file_saver_set_compression_type gtk_source_file_saver_set_compression_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_set_compression_type")); [GLib.Property ("compression-type")] public GtkSource.CompressionType CompressionType { get { int raw_ret = gtk_source_file_saver_get_compression_type(Handle); GtkSource.CompressionType ret = (GtkSource.CompressionType) raw_ret; return ret; } set { gtk_source_file_saver_set_compression_type(Handle, (int) value); } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate int d_gtk_source_file_saver_get_flags(IntPtr raw); static d_gtk_source_file_saver_get_flags gtk_source_file_saver_get_flags = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_flags")); [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_gtk_source_file_saver_set_flags(IntPtr raw, int flags); static d_gtk_source_file_saver_set_flags gtk_source_file_saver_set_flags = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_set_flags")); [GLib.Property ("flags")] public GtkSource.FileSaverFlags Flags { get { int raw_ret = gtk_source_file_saver_get_flags(Handle); GtkSource.FileSaverFlags ret = (GtkSource.FileSaverFlags) raw_ret; return ret; } set { gtk_source_file_saver_set_flags(Handle, (int) value); } } // 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("padding" , GLib.Object.class_abi.Fields , (uint) sizeof( IntPtr ) * 10 // padding , null , null , (uint) sizeof(IntPtr) , 0 ), }); return _class_abi; } } // End of the ABI representation. [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate int d_gtk_source_file_saver_error_quark(); static d_gtk_source_file_saver_error_quark gtk_source_file_saver_error_quark = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_error_quark")); public static int ErrorQuark() { int raw_ret = gtk_source_file_saver_error_quark(); int ret = raw_ret; return ret; } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate IntPtr d_gtk_source_file_saver_get_type(); static d_gtk_source_file_saver_get_type gtk_source_file_saver_get_type = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_get_type")); public static new GLib.GType GType { get { IntPtr raw_ret = gtk_source_file_saver_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate void d_gtk_source_file_saver_save_async(IntPtr raw, int io_priority, IntPtr cancellable, GLibSharp.FileProgressCallbackNative progress_callback, IntPtr progress_callback_data, GLib.DestroyNotify progress_callback_notify, GLibSharp.AsyncReadyCallbackNative cb, IntPtr user_data); static d_gtk_source_file_saver_save_async gtk_source_file_saver_save_async = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_save_async")); public void SaveAsync(int io_priority, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, GLib.DestroyNotify progress_callback_notify, GLib.AsyncReadyCallback cb) { GLibSharp.FileProgressCallbackWrapper progress_callback_wrapper = new GLibSharp.FileProgressCallbackWrapper (progress_callback); GLibSharp.AsyncReadyCallbackWrapper cb_wrapper = new GLibSharp.AsyncReadyCallbackWrapper (cb); cb_wrapper.PersistUntilCalled (); gtk_source_file_saver_save_async(Handle, io_priority, cancellable == null ? IntPtr.Zero : cancellable.Handle, progress_callback_wrapper.NativeDelegate, IntPtr.Zero, progress_callback_notify, cb_wrapper.NativeDelegate, IntPtr.Zero); } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] delegate bool d_gtk_source_file_saver_save_finish(IntPtr raw, IntPtr result, out IntPtr error); static d_gtk_source_file_saver_save_finish gtk_source_file_saver_save_finish = FuncLoader.LoadFunction(FuncLoader.GetProcAddress(GLibrary.Load(Library.GtkSource), "gtk_source_file_saver_save_finish")); public unsafe bool SaveFinish(GLib.IAsyncResult result) { IntPtr error = IntPtr.Zero; bool raw_ret = gtk_source_file_saver_save_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; } static FileSaver () { GtkSharp.GtkSourceSharp.ObjectManager.Initialize (); } // 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 } }