aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/rsvg
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-19 16:10:32 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-03-01 05:08:23 +0100
commit70bcdc77ff42c74fcd8e6e7dffd4eb6b16f24f39 (patch)
tree3aca61b2a64d3d01c396a75d239934d902da3405 /src/rsvg
parent328c6d4eab1127cd9799540f253deda66060b68a (diff)
GtkCrowContainer test, functionnal, keyboard issue
Diffstat (limited to 'src/rsvg')
-rw-r--r--src/rsvg/DimensionData.cs32
-rw-r--r--src/rsvg/Global.cs41
-rw-r--r--src/rsvg/Handle.cs262
-rw-r--r--src/rsvg/Pixbuf.cs133
-rw-r--r--src/rsvg/RsvgSharp.SizeFuncNative.cs94
-rw-r--r--src/rsvg/SizeFunc.cs10
6 files changed, 572 insertions, 0 deletions
diff --git a/src/rsvg/DimensionData.cs b/src/rsvg/DimensionData.cs
new file mode 100644
index 00000000..20da1aab
--- /dev/null
+++ b/src/rsvg/DimensionData.cs
@@ -0,0 +1,32 @@
+// 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
+ [StructLayout(LayoutKind.Sequential)]
+ public struct DimensionData {
+
+ public int Width;
+ public int Height;
+ public double Em;
+ public double Ex;
+
+ public static Rsvg.DimensionData Zero = new Rsvg.DimensionData ();
+
+ public static Rsvg.DimensionData New(IntPtr raw) {
+ if (raw == IntPtr.Zero)
+ return Rsvg.DimensionData.Zero;
+ return (Rsvg.DimensionData) Marshal.PtrToStructure (raw, typeof (Rsvg.DimensionData));
+ }
+
+ private static GLib.GType GType {
+ get { return GLib.GType.Pointer; }
+ }
+#endregion
+ }
+}
diff --git a/src/rsvg/Global.cs b/src/rsvg/Global.cs
new file mode 100644
index 00000000..65917012
--- /dev/null
+++ b/src/rsvg/Global.cs
@@ -0,0 +1,41 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace Rsvg {
+
+ using System;
+ using System.Runtime.InteropServices;
+
+#region Autogenerated code
+ public class Global {
+
+ [DllImport("rsvg-2")]
+ static extern void rsvg_set_default_dpi_x_y(double dpi_x, double dpi_y);
+
+ public static void SetDefaultDpiXY(double dpi_x, double dpi_y) {
+ rsvg_set_default_dpi_x_y(dpi_x, dpi_y);
+ }
+
+ [DllImport("rsvg-2")]
+ static extern int rsvg_error_quark();
+
+ public static int ErrorQuark {
+ get {
+ int raw_ret = rsvg_error_quark();
+ int ret = raw_ret;
+ return ret;
+ }
+ }
+
+ [DllImport("rsvg-2")]
+ static extern void rsvg_set_default_dpi(double dpi);
+
+ public static double DefaultDpi {
+ set {
+ rsvg_set_default_dpi(value);
+ }
+ }
+
+#endregion
+ }
+}
diff --git a/src/rsvg/Handle.cs b/src/rsvg/Handle.cs
new file mode 100644
index 00000000..51eec1fb
--- /dev/null
+++ b/src/rsvg/Handle.cs
@@ -0,0 +1,262 @@
+// 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
+ }
+}
diff --git a/src/rsvg/Pixbuf.cs b/src/rsvg/Pixbuf.cs
new file mode 100644
index 00000000..690d454a
--- /dev/null
+++ b/src/rsvg/Pixbuf.cs
@@ -0,0 +1,133 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace Rsvg {
+
+ using System;
+ using System.Runtime.InteropServices;
+
+#region Autogenerated code
+ public class Pixbuf {
+
+ [DllImport("rsvg-2")]
+ static extern unsafe IntPtr rsvg_pixbuf_from_file(IntPtr file_name, out IntPtr error);
+
+ [Obsolete]
+ public static unsafe Gdk.Pixbuf FromFile(string file_name) {
+ IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
+ IntPtr error = IntPtr.Zero;
+ IntPtr raw_ret = rsvg_pixbuf_from_file(native_file_name, out error);
+ Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
+ GLib.Marshaller.Free (native_file_name);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
+ }
+
+ [DllImport("rsvg-2")]
+ static extern unsafe IntPtr rsvg_pixbuf_from_file_at_size(IntPtr file_name, int width, int height, out IntPtr error);
+
+ [Obsolete]
+ public static unsafe Gdk.Pixbuf FromFileAtSize(string file_name, int width, int height) {
+ IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
+ IntPtr error = IntPtr.Zero;
+ IntPtr raw_ret = rsvg_pixbuf_from_file_at_size(native_file_name, width, height, out error);
+ Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
+ GLib.Marshaller.Free (native_file_name);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
+ }
+
+ [DllImport("rsvg-2")]
+ static extern unsafe IntPtr rsvg_pixbuf_from_file_at_zoom(IntPtr file_name, double x_zoom, double y_zoom, out IntPtr error);
+
+ [Obsolete]
+ public static unsafe Gdk.Pixbuf FromFileAtZoom(string file_name, double x_zoom, double y_zoom) {
+ IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
+ IntPtr error = IntPtr.Zero;
+ IntPtr raw_ret = rsvg_pixbuf_from_file_at_zoom(native_file_name, x_zoom, y_zoom, out error);
+ Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
+ GLib.Marshaller.Free (native_file_name);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
+ }
+
+ [DllImport("rsvg-2")]
+ static extern unsafe IntPtr rsvg_pixbuf_from_file_at_zoom_with_max(IntPtr file_name, double x_zoom, double y_zoom, int max_width, int max_height, out IntPtr error);
+
+ [Obsolete]
+ public static unsafe Gdk.Pixbuf FromFileAtZoomWithMax(string file_name, double x_zoom, double y_zoom, int max_width, int max_height) {
+ IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
+ IntPtr error = IntPtr.Zero;
+ IntPtr raw_ret = rsvg_pixbuf_from_file_at_zoom_with_max(native_file_name, x_zoom, y_zoom, max_width, max_height, out error);
+ Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
+ GLib.Marshaller.Free (native_file_name);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
+ }
+
+ [DllImport("rsvg-2")]
+ static extern unsafe IntPtr rsvg_pixbuf_from_file_at_max_size(IntPtr file_name, int max_width, int max_height, out IntPtr error);
+
+ [Obsolete]
+ public static unsafe Gdk.Pixbuf FromFileAtMaxSize(string file_name, int max_width, int max_height) {
+ IntPtr native_file_name = GLib.Marshaller.StringToPtrGStrdup (file_name);
+ IntPtr error = IntPtr.Zero;
+ IntPtr raw_ret = rsvg_pixbuf_from_file_at_max_size(native_file_name, max_width, max_height, out error);
+ Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
+ GLib.Marshaller.Free (native_file_name);
+ if (error != IntPtr.Zero) throw new GLib.GException (error);
+ return ret;
+ }
+
+#endregion
+#region Customized extensions
+#line 1 "Pixbuf.custom"
+// Rsvg.Pixbuf.custom - Rsvg Pixbuf class customizations
+//
+// Author: John Luke <jluke@cfl.rr.com>
+//
+// Copyright (C) 2004 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 static Gdk.Pixbuf LoadFromResource (string resource)
+ {
+ if (resource == null)
+ throw new ArgumentNullException ("resource");
+
+ System.IO.Stream s = System.Reflection.Assembly.GetCallingAssembly ().GetManifestResourceStream (resource);
+ if (s == null)
+ throw new ArgumentException ("resource must be a valid resource name of 'assembly'.");
+
+ return LoadFromStream (s);
+ }
+
+ public static Gdk.Pixbuf LoadFromStream (System.IO.Stream input)
+ {
+ Handle loader = new Handle ();
+ byte [] buffer = new byte [8192];
+ int n;
+ while ((n = input.Read (buffer, 0, 8192)) != 0)
+ loader.Write (buffer, (uint) n);
+
+ loader.Close ();
+ return loader.Pixbuf;
+ }
+
+#endregion
+ }
+}
diff --git a/src/rsvg/RsvgSharp.SizeFuncNative.cs b/src/rsvg/RsvgSharp.SizeFuncNative.cs
new file mode 100644
index 00000000..43bf5b4e
--- /dev/null
+++ b/src/rsvg/RsvgSharp.SizeFuncNative.cs
@@ -0,0 +1,94 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace RsvgSharp {
+
+ using System;
+ using System.Runtime.InteropServices;
+
+#region Autogenerated code
+
+ internal delegate void SizeFuncNative(out int width, out int height, IntPtr user_data);
+
+ internal class SizeFuncInvoker {
+
+ SizeFuncNative native_cb;
+ IntPtr __data;
+ GLib.DestroyNotify __notify;
+
+ ~SizeFuncInvoker ()
+ {
+ if (__notify == null)
+ return;
+ __notify (__data);
+ }
+
+ internal SizeFuncInvoker (SizeFuncNative native_cb) : this (native_cb, IntPtr.Zero, null) {}
+
+ internal SizeFuncInvoker (SizeFuncNative native_cb, IntPtr data) : this (native_cb, data, null) {}
+
+ internal SizeFuncInvoker (SizeFuncNative native_cb, IntPtr data, GLib.DestroyNotify notify)
+ {
+ this.native_cb = native_cb;
+ __data = data;
+ __notify = notify;
+ }
+
+ internal Rsvg.SizeFunc Handler {
+ get {
+ return new Rsvg.SizeFunc(InvokeNative);
+ }
+ }
+
+ void InvokeNative (out int width, out int height)
+ {
+ native_cb (out width, out height, __data);
+ }
+ }
+
+ internal class SizeFuncWrapper {
+
+ public void NativeCallback (out int width, out int height, IntPtr user_data)
+ {
+ try {
+ managed (out width, out height);
+ if (release_on_call)
+ gch.Free ();
+ } catch (Exception e) {
+ GLib.ExceptionManager.RaiseUnhandledException (e, true);
+ // NOTREACHED: Above call does not return.
+ throw e;
+ }
+ }
+
+ bool release_on_call = false;
+ GCHandle gch;
+
+ public void PersistUntilCalled ()
+ {
+ release_on_call = true;
+ gch = GCHandle.Alloc (this);
+ }
+
+ internal SizeFuncNative NativeDelegate;
+ Rsvg.SizeFunc managed;
+
+ public SizeFuncWrapper (Rsvg.SizeFunc managed)
+ {
+ this.managed = managed;
+ if (managed != null)
+ NativeDelegate = new SizeFuncNative (NativeCallback);
+ }
+
+ public static Rsvg.SizeFunc GetManagedDelegate (SizeFuncNative native)
+ {
+ if (native == null)
+ return null;
+ SizeFuncWrapper wrapper = (SizeFuncWrapper) native.Target;
+ if (wrapper == null)
+ return null;
+ return wrapper.managed;
+ }
+ }
+#endregion
+}
diff --git a/src/rsvg/SizeFunc.cs b/src/rsvg/SizeFunc.cs
new file mode 100644
index 00000000..4c84738b
--- /dev/null
+++ b/src/rsvg/SizeFunc.cs
@@ -0,0 +1,10 @@
+// This file was generated by the Gtk# code generator.
+// Any changes made will be lost if regenerated.
+
+namespace Rsvg {
+
+ using System;
+
+ public delegate void SizeFunc(out int width, out int height);
+
+}