[Gtk-sharp-list] Patches: Gdk.Rectangle/Gdk.Drawable and System.Drawing.Rectangle

Moritz Balz verteiler@mbalz.de
Mon, 20 Oct 2003 23:17:58 +0200


This is a multi-part message in MIME format.
--------------050505040701090603090505
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

attached are two patches that add overloaded methods in .custom files to
make the use of System.Drawing.Rectangle (instead of Gdk.Rectangle)
possible in
- Gdk.Rectangle constructor
- Gdk.Drawable.DrawRectangle method

I'd like to be able to use System.Drawing.Rectangle in Gdk 'cause ist
seems a bit more sophisticated than Gdk.Rectangle. If you think this is
a good idea I'd be happy to see this patches go in.

Uh ... it's the first time I used the diff tool. If something is wrong
please let me know.

Moritz

--------------050505040701090603090505
Content-Type: text/plain;
 name="Drawable.custom.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Drawable.custom.diff"

--- /mnt/eigenes2/Quellcodes/Mono/gtk-sharp/gdk/Drawable.custom	2003-08-24 18:42:09.000000000 +0200
+++ Drawable.custom	2003-10-20 18:47:01.000000000 +0200
@@ -20,6 +20,11 @@
 	gdk_draw_rectangle(Handle, gc.Handle, filled, area.x, area.y, area.width, area.height);
 }
 
+public void DrawRectangle(Gdk.GC gc, bool filled, System.Drawing.Rectangle area)
+{
+	gdk_draw_rectangle(Handle, gc.Handle, filled, area.X, area.Y, area.Width, area.Height));
+}
+
 [DllImport("libgdk-win32-2.0-0.dll")]
 static extern void gdk_draw_polygon(IntPtr raw, IntPtr gc, int filled, Gdk.Point[] points, int npoints);
 


--------------050505040701090603090505
Content-Type: text/plain;
 name="Rectangle.custom.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="Rectangle.custom.diff"

--- /mnt/eigenes2/Quellcodes/Mono/gtk-sharp/gdk/Rectangle.custom	2003-03-19 16:16:31.000000000 +0100
+++ Rectangle.custom	2003-10-20 18:48:22.000000000 +0200
@@ -29,3 +29,10 @@
 	this.height = height;
 }
 
+public Rectangle (System.Drawing.Rectangle rect)
+{
+	this.x = rect.X;
+	this.y = rect.Y;
+	this.width = rect.Width;
+	this.height = rect.Height;
+}


--------------050505040701090603090505--