[Mono-bugs] [Bug 75997][Wis] New - Mono.Cairo 100% non-usable on win32.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Sep 6 06:26:27 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by idan at fastmail.fm.

http://bugzilla.ximian.com/show_bug.cgi?id=75997

--- shadow/75997	2005-09-06 06:26:27.000000000 -0400
+++ shadow/75997.tmp.32276	2005-09-06 06:26:27.000000000 -0400
@@ -0,0 +1,78 @@
+Bug#: 75997
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: WinXP, Mono 1.1.8.3/win32
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Mono.Cairo
+AssignedTo: hisham.mardambey at gmail.com                            
+ReportedBy: idan at fastmail.fm               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono.Cairo 100% non-usable on win32.
+
+Problem
+=======
+
+Mono.Cairo doesn't do the win32 dance.
+
+The reason for this is that Cairo.Graphics.SetTargetDrawable() wraps only 
+cairo_xlib_surface_create(), and not also cairo_win32_surface_create().
+
+There's also a set of "examples" in the win32 mono distribution which look
+like they will work, but they don't, as they try:
+
+[DllImport("libgdk-win32-2.0-0.dll")]
+static extern IntPtr gdk_x11_drawable_get_xdisplay (IntPtr raw);
+
+[DllImport("libgdk-win32-2.0-0.dll")]
+static extern IntPtr gdk_x11_drawable_get_xid (IntPtr raw);
+
+Obviously, these don't exist in libgdk-win32. Probably, they should be
+removed from the Mono/win32 distribution until they do work as they are
+misleading.
+
+
+What to do to fix the problem:
+==============================
+
+I don't understand why this isn't done via overloaded Cairo.Graphics
+constructors
+
+// create a win32 cairo.graphics
+public Graphics(IntPtr hdc) {...}
+
+// create a xlibs cairo.graphics
+public Graphics(IntPtr dpy, IntPtr drawable, IntPtr visual, int width, int
+height) {...}
+
+or even, via some static constructor
+
+public static Cairo.Graphics GetGraphicsWin32(IntPtr hdc) {...}
+etc... you get the idea. 
+
+There's no reason not to provide an overloaded SetTargetDrawable() function
+either, but it seems silly to do this for something that *must* happen at
+the time the class is instanced, if somebody actually wants to make use of
+the class. Seems sensible to do it via the constructor.
+
+The Alternate Solution
+======================
+
+I notice that there's a gdk function:
+gdk_cairo_create ()
+
+but then it depends if this function correctly senses which platform it's
+running on and calls the appropriate cairo_XXX_surface_create(). I've not
+yet taken a look at the sources for this.
+
+I'd be happy to take on this task, I think it's something I could
+contribute to, however I am going away for a week on business, so I will
+only be back to look at this on 14th sept.
+
+-Idan


More information about the mono-bugs mailing list