[gbrainy] Fixes error with rsvfg library: wrong type on the call
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy] Fixes error with rsvfg library: wrong type on the call
- Date: Sun, 14 Oct 2018 19:51:40 +0000 (UTC)
commit e9fc74214ad9450078762cc9b6ad38b214370fd4
Author: Jordi Mas <jmas softcatala org>
Date: Sun Oct 14 21:51:17 2018 +0200
Fixes error with rsvfg library: wrong type on the call
src/Core/Libraries/SVGImage.cs | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Libraries/SVGImage.cs b/src/Core/Libraries/SVGImage.cs
index b8cd23d..1c7a1ba 100644
--- a/src/Core/Libraries/SVGImage.cs
+++ b/src/Core/Libraries/SVGImage.cs
@@ -31,7 +31,7 @@ namespace gbrainy.Core.Libraries
static extern void rsvg_handle_render_cairo (IntPtr Rsvghandle, IntPtr cairo_t);
[DllImport("rsvg-2")]
- static extern IntPtr rsvg_handle_new_from_file (string file_name, out int error);
+ static extern IntPtr rsvg_handle_new_from_file (string file_name, out GError error);
[DllImport("rsvg-2")]
static extern void rsvg_handle_free (IntPtr handle);
@@ -40,7 +40,7 @@ namespace gbrainy.Core.Libraries
static extern void rsvg_handle_get_dimensions (IntPtr handle, ref RsvgDimensionData
dimension);
[DllImport("rsvg-2")]
- static extern IntPtr rsvg_handle_new_from_data (byte[] data, int len, out int error);
+ static extern IntPtr rsvg_handle_new_from_data (byte[] data, int len, out GError error);
[StructLayout(LayoutKind.Sequential)]
struct RsvgDimensionData
@@ -51,6 +51,13 @@ namespace gbrainy.Core.Libraries
public double ex;
}
+ struct GError
+ {
+ public int Domain;
+ public int Code;
+ public IntPtr Msg;
+ }
+
RsvgDimensionData dimension;
IntPtr handle;
@@ -59,7 +66,7 @@ namespace gbrainy.Core.Libraries
try {
byte[] array;
Stream stream;
- int error = 0;
+ GError error;
stream = _assembly.GetManifestResourceStream (resource);
array = new byte [stream.Length];
@@ -82,7 +89,7 @@ namespace gbrainy.Core.Libraries
public SVGImage (string file)
{
- int error = 0;
+ GError error;
dimension = new RsvgDimensionData ();
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]