145 lines
5.2 KiB
C#
145 lines
5.2 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 ZlibCompressor : GLib.Object, GLib.IConverter {
|
|
|
|
public ZlibCompressor (IntPtr raw) : base(raw) {}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate IntPtr d_g_zlib_compressor_new(int format, int level);
|
|
static d_g_zlib_compressor_new g_zlib_compressor_new = FuncLoader.LoadFunction<d_g_zlib_compressor_new>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_zlib_compressor_new"));
|
|
|
|
public ZlibCompressor (GLib.ZlibCompressorFormat format, int level) : base (IntPtr.Zero)
|
|
{
|
|
if (GetType () != typeof (ZlibCompressor)) {
|
|
var vals = new List<GLib.Value> ();
|
|
var names = new List<string> ();
|
|
names.Add ("format");
|
|
vals.Add (new GLib.Value (format));
|
|
names.Add ("level");
|
|
vals.Add (new GLib.Value (level));
|
|
CreateNativeObject (names.ToArray (), vals.ToArray ());
|
|
return;
|
|
}
|
|
Raw = g_zlib_compressor_new((int) format, level);
|
|
}
|
|
|
|
[GLib.Property ("format")]
|
|
public GLib.ZlibCompressorFormat Format {
|
|
get {
|
|
GLib.Value val = GetProperty ("format");
|
|
GLib.ZlibCompressorFormat ret = (GLib.ZlibCompressorFormat) (Enum) val;
|
|
val.Dispose ();
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[GLib.Property ("level")]
|
|
public int Level {
|
|
get {
|
|
GLib.Value val = GetProperty ("level");
|
|
int ret = (int) val;
|
|
val.Dispose ();
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate IntPtr d_g_zlib_compressor_get_file_info(IntPtr raw);
|
|
static d_g_zlib_compressor_get_file_info g_zlib_compressor_get_file_info = FuncLoader.LoadFunction<d_g_zlib_compressor_get_file_info>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_zlib_compressor_get_file_info"));
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate void d_g_zlib_compressor_set_file_info(IntPtr raw, IntPtr file_info);
|
|
static d_g_zlib_compressor_set_file_info g_zlib_compressor_set_file_info = FuncLoader.LoadFunction<d_g_zlib_compressor_set_file_info>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_zlib_compressor_set_file_info"));
|
|
|
|
[GLib.Property ("file-info")]
|
|
public GLib.FileInfo FileInfo {
|
|
get {
|
|
IntPtr raw_ret = g_zlib_compressor_get_file_info(Handle);
|
|
GLib.FileInfo ret = GLib.Object.GetObject(raw_ret) as GLib.FileInfo;
|
|
return ret;
|
|
}
|
|
set {
|
|
g_zlib_compressor_set_file_info(Handle, value == null ? IntPtr.Zero : value.Handle);
|
|
}
|
|
}
|
|
|
|
|
|
// 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 (GLib.Object.class_abi.Fields);
|
|
|
|
return _class_abi;
|
|
}
|
|
}
|
|
|
|
|
|
// End of the ABI representation.
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate IntPtr d_g_zlib_compressor_get_type();
|
|
static d_g_zlib_compressor_get_type g_zlib_compressor_get_type = FuncLoader.LoadFunction<d_g_zlib_compressor_get_type>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_zlib_compressor_get_type"));
|
|
|
|
public static new GLib.GType GType {
|
|
get {
|
|
IntPtr raw_ret = g_zlib_compressor_get_type();
|
|
GLib.GType ret = new GLib.GType(raw_ret);
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate int d_g_converter_convert(IntPtr raw, IntPtr inbuf, UIntPtr inbuf_size, IntPtr outbuf, UIntPtr outbuf_size, int flags, out UIntPtr bytes_read, out UIntPtr bytes_written, out IntPtr error);
|
|
static d_g_converter_convert g_converter_convert = FuncLoader.LoadFunction<d_g_converter_convert>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_converter_convert"));
|
|
|
|
public GLib.ConverterResult Convert(IntPtr inbuf, ulong inbuf_size, IntPtr outbuf, ulong outbuf_size, GLib.ConverterFlags flags, out ulong bytes_read, out ulong bytes_written) {
|
|
UIntPtr native_bytes_read;
|
|
UIntPtr native_bytes_written;
|
|
IntPtr error = IntPtr.Zero;
|
|
int raw_ret = g_converter_convert(Handle, inbuf, new UIntPtr (inbuf_size), outbuf, new UIntPtr (outbuf_size), (int) flags, out native_bytes_read, out native_bytes_written, out error);
|
|
GLib.ConverterResult ret = (GLib.ConverterResult) raw_ret;
|
|
bytes_read = (ulong) native_bytes_read;
|
|
bytes_written = (ulong) native_bytes_written;
|
|
if (error != IntPtr.Zero) throw new GLib.GException (error);
|
|
return ret;
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate void d_g_converter_reset(IntPtr raw);
|
|
static d_g_converter_reset g_converter_reset = FuncLoader.LoadFunction<d_g_converter_reset>(FuncLoader.GetProcAddress(GLibrary.Load(Library.Gio), "g_converter_reset"));
|
|
|
|
public void Reset() {
|
|
g_converter_reset(Handle);
|
|
}
|
|
|
|
|
|
// 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 (GLib.Object.abi_info.Fields);
|
|
|
|
return _abi_info;
|
|
}
|
|
}
|
|
|
|
|
|
// End of the ABI representation.
|
|
|
|
#endregion
|
|
}
|
|
}
|