// This file was generated by the Gtk# code generator. // Any changes made will be lost if regenerated. namespace Rsvg { using System; using System.Collections; using System.Runtime.InteropServices; #region Autogenerated code public class Handle : GLib.Object { public Handle(IntPtr raw) : base(raw) {} [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_new(); public Handle () : base (IntPtr.Zero) { if (GetType () != typeof (Handle)) { CreateNativeObject (new string [0], new GLib.Value[0]); return; } Raw = rsvg_handle_new(); } [DllImport("rsvg-2")] static extern unsafe IntPtr rsvg_handle_new_from_data(byte[] data, UIntPtr n_data, out IntPtr error); public unsafe Handle (byte[] data) : base (IntPtr.Zero) { if (GetType () != typeof (Handle)) { throw new InvalidOperationException ("Can't override this constructor."); } IntPtr error = IntPtr.Zero; Raw = rsvg_handle_new_from_data(data, new UIntPtr ((ulong) (data == null ? 0 : data.Length)), out error); if (error != IntPtr.Zero) throw new GLib.GException (error); } [DllImport("rsvg-2")] static extern unsafe IntPtr rsvg_handle_new_from_file(IntPtr file_name, out IntPtr error); public unsafe Handle (string file_name) : base (IntPtr.Zero) { if (GetType () != typeof (Handle)) { throw new InvalidOperationException ("Can't override this constructor."); } IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name); IntPtr error = IntPtr.Zero; Raw = rsvg_handle_new_from_file(native_file_name, out error); GLib.Marshaller.Free (native_file_name); if (error != IntPtr.Zero) throw new GLib.GException (error); } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_pixbuf(IntPtr raw); public Gdk.Pixbuf Pixbuf { get { IntPtr raw_ret = rsvg_handle_get_pixbuf(Handle); Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf; return ret; } } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_base_uri(IntPtr raw); [DllImport("rsvg-2")] static extern void rsvg_handle_set_base_uri(IntPtr raw, IntPtr base_uri); public string BaseUri { get { IntPtr raw_ret = rsvg_handle_get_base_uri(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } set { IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value); rsvg_handle_set_base_uri(Handle, native_value); GLib.Marshaller.Free (native_value); } } [DllImport("rsvg-2")] static extern void rsvg_handle_set_dpi(IntPtr raw, double dpi); public double Dpi { set { rsvg_handle_set_dpi(Handle, value); } } [DllImport("rsvg-2")] static extern unsafe bool rsvg_handle_write(IntPtr raw, byte[] buf, UIntPtr n_buf, out IntPtr error); public unsafe bool Write(byte[] buf) { IntPtr error = IntPtr.Zero; bool raw_ret = rsvg_handle_write(Handle, buf, new UIntPtr ((ulong) (buf == null ? 0 : buf.Length)), out error); bool ret = raw_ret; if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } [DllImport("rsvg-2")] static extern void rsvg_handle_render_cairo(IntPtr raw, IntPtr cr); public void RenderCairo(Cairo.Context cr) { rsvg_handle_render_cairo(Handle, cr == null ? IntPtr.Zero : cr.Handle); } [DllImport("rsvg-2")] static extern void rsvg_handle_set_size_callback(IntPtr raw, RsvgSharp.SizeFuncNative size_func, IntPtr user_data, GLib.DestroyNotify user_data_destroy); [Obsolete] public Rsvg.SizeFunc SizeCallback { set { RsvgSharp.SizeFuncWrapper value_wrapper = new RsvgSharp.SizeFuncWrapper (value); IntPtr user_data; GLib.DestroyNotify user_data_destroy; if (value == null) { user_data = IntPtr.Zero; user_data_destroy = null; } else { user_data = (IntPtr) GCHandle.Alloc (value_wrapper); user_data_destroy = GLib.DestroyHelper.NotifyHandler; } rsvg_handle_set_size_callback(Handle, value_wrapper.NativeDelegate, user_data, user_data_destroy); } } [DllImport("rsvg-2")] static extern void rsvg_handle_set_dpi_x_y(IntPtr raw, double dpi_x, double dpi_y); public void SetDpiXY(double dpi_x, double dpi_y) { rsvg_handle_set_dpi_x_y(Handle, dpi_x, dpi_y); } [DllImport("rsvg-2")] static extern void rsvg_handle_get_dimensions(IntPtr raw, IntPtr dimension_data); public Rsvg.DimensionData Dimensions { get { Rsvg.DimensionData dimension_data; IntPtr native_dimension_data = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Rsvg.DimensionData))); rsvg_handle_get_dimensions(Handle, native_dimension_data); dimension_data = Rsvg.DimensionData.New (native_dimension_data); Marshal.FreeHGlobal (native_dimension_data); return dimension_data; } } [DllImport("rsvg-2")] static extern unsafe bool rsvg_handle_close(IntPtr raw, out IntPtr error); public unsafe bool Close() { IntPtr error = IntPtr.Zero; bool raw_ret = rsvg_handle_close(Handle, out error); bool ret = raw_ret; if (error != IntPtr.Zero) throw new GLib.GException (error); return ret; } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_pixbuf_sub(IntPtr raw, IntPtr id); public Gdk.Pixbuf GetPixbufSub(string id) { IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup (id); IntPtr raw_ret = rsvg_handle_get_pixbuf_sub(Handle, native_id); Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf; GLib.Marshaller.Free (native_id); return ret; } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_desc(IntPtr raw); public string Desc { get { IntPtr raw_ret = rsvg_handle_get_desc(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_type(); public static new GLib.GType GType { get { IntPtr raw_ret = rsvg_handle_get_type(); GLib.GType ret = new GLib.GType(raw_ret); return ret; } } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_title(IntPtr raw); public string Title { get { IntPtr raw_ret = rsvg_handle_get_title(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } [DllImport("rsvg-2")] static extern void rsvg_handle_render_cairo_sub(IntPtr raw, IntPtr cr, IntPtr id); public void RenderCairoSub(Cairo.Context cr, string id) { IntPtr native_id = GLib.Marshaller.StringToPtrGStrdup (id); rsvg_handle_render_cairo_sub(Handle, cr == null ? IntPtr.Zero : cr.Handle, native_id); GLib.Marshaller.Free (native_id); } [DllImport("rsvg-2")] static extern IntPtr rsvg_handle_get_metadata(IntPtr raw); public string Metadata { get { IntPtr raw_ret = rsvg_handle_get_metadata(Handle); string ret = GLib.Marshaller.Utf8PtrToString (raw_ret); return ret; } } #endregion #region Customized extensions #line 1 "Handle.custom" // Rsvg.Handle.custom - Rsvg Handle class customizations // // Copyright (C) 2007 Novell, Inc. // // This code is inserted after the automatically generated code. // // This program is free software; you can redistribute it and/or // modify it under the terms of version 2 of the Lesser GNU General // Public License as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this program; if not, write to the // Free Software Foundation, Inc., 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. public unsafe bool Write (byte[] buf, ulong count) { IntPtr error; bool result = rsvg_handle_write (Handle, buf, new UIntPtr (count), out error); if (error != IntPtr.Zero) throw new GLib.GException (error); return result; } #endregion } }