[Mono-winforms-list] System.Drawing implementation issues.

Miguel de Icaza miguel@ximian.com
21 Sep 2003 20:18:13 -0400


   Currently we have two System.Drawing implementations, and depending
on the kind of application running we pick one of them: the Cairo-based
implementation and the Wine-based implementation.

   If Windows.Forms is initialized, we set a flag to use the Wine-based
implementation, if not, we use the Cairo-based one.   This is the state
of each implementation:

	* Wine implementation: works directly with Wine, so rendering
	  for Windows.Forms apps just works.  The problem is that Wine
	  lacks a GDI+ implementation, so some of the most advanced
	  rendering features are not available, and will require us
	  to reimplement lots of it, or work with the Wine team to 
	  implement GDI+.

	* The Cairo implementation has the most future, as it is a
	  complete engine for doing the kind of 2d graphics that System.
	  Drawing is.  

    The main problem we have today is that we have to maintain two
implementations of it, and the way this is done is rather cumbersome to
maintain: a front-end class that acts as the proxy (Pen, Brush, etc) an
interface that defines the contract between the backends and the
front-end, and the backends themselves.   This is a lot of complexity
that I would like to avoid.

     The question to the Wine experts in the list is whether it is
possible to just use Cairo for everything and have it work nicely with
Wine to avoid the duplication of work.