From 14168176c273a79ba7932b22d45fd977c2e22f6a Mon Sep 17 00:00:00 2001
From: Mike Kestner <mkestner@gmail.com>
Date: Sat, 29 May 2004 15:32:34 +0000
Subject: [PATCH] 2004-05-29  Mike Kestner  <mkestner@ximian.com>

	* gnome/CanvasItem.custom : for OnUpdate, Art.SVP can be NULL
	so treat it as an IntPtr with Zero checks and manual marshaling.

svn path=/trunk/gtk-sharp/; revision=28442
---
 ChangeLog               | 5 +++++
 gnome/CanvasItem.custom | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 47f071741..2d62bbd4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-29  Mike Kestner  <mkestner@ximian.com>
+
+	* gnome/CanvasItem.custom : for OnUpdate, Art.SVP can be NULL
+	so treat it as an IntPtr with Zero checks and manual marshaling.
+
 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
 
 	* gtk/CellRenderer.custom: fix GetSize_cb, cell_area can be NULL
diff --git a/gnome/CanvasItem.custom b/gnome/CanvasItem.custom
index f336c81b2..00fb80e74 100644
--- a/gnome/CanvasItem.custom
+++ b/gnome/CanvasItem.custom
@@ -182,15 +182,20 @@
 		[DllImport("gnomesharpglue")]
 		static extern void gnomesharp_canvas_item_override_update (GLib.GType gtype, UpdateDelegate cb);
 
-		delegate void UpdateDelegate (IntPtr item, IntPtr affine_ptr, ref Art.SVP clip_path, int flags);
+		delegate void UpdateDelegate (IntPtr item, IntPtr affine_ptr, IntPtr clip_path, int flags);
 
                 static UpdateDelegate UpdateCallback;
 
-                static void Update_cb (IntPtr item, IntPtr affine_ptr, ref Art.SVP clip_path, int flags)
+                static void Update_cb (IntPtr item, IntPtr affine_ptr, IntPtr clip_path_handle, int flags)
                 {
                         CanvasItem obj = GLib.Object.GetObject (item, false) as CanvasItem;
 			double[] affine = new double [6];
 			Marshal.Copy (affine_ptr, affine, 0, 6);
+			Art.SVP clip_path;
+			if (clip_path_handle == IntPtr.Zero)
+				clip_path = Art.SVP.Zero;
+			else
+				clip_path = (Art.SVP) Marshal.PtrToStructure (clip_path_handle, typeof(Art.SVP));
                         obj.OnUpdate (affine, ref clip_path, flags);
                 }