[Gtk-sharp-list] broken bindings.

Larry Ewing lewing@ximian.com
Thu, 17 Jun 2004 23:53:29 -0500


--=-qHS2yAlbAGbd1Z6jZoaI
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This one doesn't include a typo.

--Larry

On Thu, 2004-06-17 at 23:47 -0500, Larry Ewing wrote:
> So in the last couple of days I've run into some seriously broken
> bindings.  I hear things are supposed to be api frozen but the
> CanvasItem and Pixdata methods are basically useless without this patch.
> The polygon change just seems reasonable if the freeze is already
> broken.
> 
> --Larry

--=-qHS2yAlbAGbd1Z6jZoaI
Content-Disposition: attachment; filename=api.patch
Content-Type: text/plain; name=api.patch; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Index: ChangeLog
===================================================================
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.864
diff -u -p -r1.864 ChangeLog
--- ChangeLog	15 Jun 2004 13:38:43 -0000	1.864
+++ ChangeLog	18 Jun 2004 05:47:55 -0000
@@ -1,3 +1,20 @@
+2004-06-17  Larry Ewing  <lewing@ximian.com>
+
+	* gdk/Makefile.am (sources): add Pixdata.custom
+
+	* gdk/Drawable.custom: make filled be a boolean.
+
+	* gdk/Pixdata.custom: add new file to fix Serialize.
+
+	* gnome/CanvasItem.custom: remove the incorrect custom bindings.
+
+	* gnome/Gnome.metadata: stop hiding the AffineRelative and
+	AffineAbsolute the generator gets them right they are not out
+	params.
+
+	* gdk/Gdk.metadata: mark the Pixdata byte stream as and array hide
+	the broken serialize method.
+
 2004-06-15  Mike Kestner  <mkestner@ximian.com>
 
 	* gtk/Gtk.metadata : hide the button_new_from_stock ctor.
Index: gdk/Drawable.custom
===================================================================
RCS file: /cvs/public/gtk-sharp/gdk/Drawable.custom,v
retrieving revision 1.9
diff -u -p -r1.9 Drawable.custom
--- gdk/Drawable.custom	15 Mar 2004 20:13:30 -0000	1.9
+++ gdk/Drawable.custom	18 Jun 2004 05:47:55 -0000
@@ -11,9 +11,9 @@ public void DrawRectangle(Gdk.GC gc, boo
 }
 
 [DllImport("libgdk-win32-2.0-0.dll")]
-static extern void gdk_draw_polygon(IntPtr raw, IntPtr gc, int filled, Gdk.Point[] points, int npoints);
+static extern void gdk_draw_polygon(IntPtr raw, IntPtr gc, bool filled, Gdk.Point[] points, int npoints);
 
-public void DrawPolygon(Gdk.GC gc, int filled, Gdk.Point[] points)
+public void DrawPolygon(Gdk.GC gc, bool filled, Gdk.Point[] points)
 {
 	gdk_draw_polygon(Handle, gc.Handle, filled, points, points.Length);
 }
@@ -42,4 +42,4 @@ internal static extern IntPtr gdk_x11_dr
 
 		return o;
 	}
-#endif
\ No newline at end of file
+#endif
Index: gdk/Gdk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gdk/Gdk.metadata,v
retrieving revision 1.30
diff -u -p -r1.30 Gdk.metadata
--- gdk/Gdk.metadata	14 Jun 2004 20:25:50 -0000	1.30
+++ gdk/Gdk.metadata	18 Jun 2004 05:47:55 -0000
@@ -99,6 +99,8 @@
   <attr path="/api/namespace/struct[@cname='GdkEventSetting']" name="hidden">1</attr>
   <attr path="/api/namespace/struct[@cname='GdkEventVisibility']" name="hidden">1</attr>
   <attr path="/api/namespace/struct[@cname='GdkEventWindowState']" name="hidden">1</attr>
+  <attr path="/api/namespace/struct[@cname='GdkPixdata']/method[@name='Deserialize']/*/*[@name='stream']" name="array">1</attr>
+  <attr path="/api/namespace/struct[@cname='GdkPixdata']/method[@name='Serialize']" name="hidden">1</attr>
   <attr path="/api/namespace/struct[@cname='GdkPixmapObject']" name="hidden">1</attr>
   <attr path="/api/namespace/struct[@cname='GdkRegion']" name="opaque">1</attr>
   <attr path="/api/namespace/struct[@cname='GdkRegion']/method[@name='GetRectangles']" name="hidden">1</attr>
Index: gdk/Makefile.am
===================================================================
RCS file: /cvs/public/gtk-sharp/gdk/Makefile.am,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile.am
--- gdk/Makefile.am	11 Jun 2004 18:19:38 -0000	1.14
+++ gdk/Makefile.am	18 Jun 2004 05:47:55 -0000
@@ -50,6 +50,7 @@ customs = 			\
 	Global.custom		\
 	Pixbuf.custom		\
 	PixbufLoader.custom	\
+	Pixdata.custom		\
 	Point.custom		\
 	Rectangle.custom	\
 	Region.custom		\
Index: gdk/Pixdata.custom
===================================================================
RCS file: gdk/Pixdata.custom
diff -N gdk/Pixdata.custom
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gdk/Pixdata.custom	18 Jun 2004 05:47:55 -0000
@@ -0,0 +1,16 @@
+// Pixdata.Custom 
+//
+// (C) 2004 Novell, Inc.
+
+	[DllImport("libgdk_pixbuf-2.0-0.dll")]
+	static extern IntPtr gdk_pixdata_serialize (ref Gdk.Pixdata raw, out uint len);
+	
+	public byte [] Serialize () {
+		uint len;
+		IntPtr raw_ret = gdk_pixdata_serialize (ref this, out len);
+
+		byte [] data = new byte [len];
+		Marshal.Copy (raw_ret, data, 0, (int)len);
+		
+		return data;
+	}	
Index: gnome/CanvasItem.custom
===================================================================
RCS file: /cvs/public/gtk-sharp/gnome/CanvasItem.custom,v
retrieving revision 1.13
diff -u -p -r1.13 CanvasItem.custom
--- gnome/CanvasItem.custom	12 Jun 2004 00:18:05 -0000	1.13
+++ gnome/CanvasItem.custom	18 Jun 2004 05:47:55 -0000
@@ -26,22 +26,6 @@
                 }
 
 		[DllImport("gnomecanvas-2")]
-		static extern void gnome_canvas_item_affine_relative(IntPtr raw, double[] affine);
-
-		public void AffineRelative (out double[] affine) {
-                        affine = new double [6];
-			gnome_canvas_item_affine_relative(Handle, affine);
-		}
-
-		[DllImport("gnomecanvas-2")]
-		static extern void gnome_canvas_item_affine_absolute(IntPtr raw, double[] affine);
-
-		public void AffineAbsolute (out double[] affine) {
-                        affine = new double [6];
-			gnome_canvas_item_affine_absolute(Handle, affine);
-		}
-
-		[DllImport("gnomecanvas-2")]
 		static extern void gnome_canvas_item_i2c_affine(IntPtr raw, double[] affine);
 
 		public void I2cAffine(out double[] affine) {
Index: gnome/Gnome.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/gnome/Gnome.metadata,v
retrieving revision 1.15
diff -u -p -r1.15 Gnome.metadata
--- gnome/Gnome.metadata	8 May 2004 02:50:28 -0000	1.15
+++ gnome/Gnome.metadata	18 Jun 2004 05:47:55 -0000
@@ -37,8 +37,6 @@
   <attr path="/api/namespace/object[@cname='GnomeCanvas']/method[@name='W2cAffine']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GnomeCanvasClipgroup']/property[@name='Wind']" name="type">ArtWindRule</attr>
   <attr path="/api/namespace/object[@cname='GnomeCanvasItem']/constructor[@cname='gnome_canvas_item_new']" name="hidden">1</attr>
-  <attr path="/api/namespace/object[@cname='GnomeCanvasItem']/method[@name='AffineAbsolute']" name="hidden">1</attr>
-  <attr path="/api/namespace/object[@cname='GnomeCanvasItem']/method[@name='AffineRelative']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GnomeCanvasItem']/method[@name='Construct']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@cname='GnomeCanvasItem']/method[@name='GetBounds']/*/*[@type='double*']" name="pass_as">out</attr>
   <attr path="/api/namespace/object[@cname='GnomeCanvasItem']/method[@name='I2cAffine']" name="hidden">1</attr>

--=-qHS2yAlbAGbd1Z6jZoaI--