[Mono-list] Re: System.Drawing (libart, gdkpixbuf)

Miguel de Icaza miguel@ximian.com
07 Apr 2002 09:24:21 -0400


Hello Christian,

   It was great meeting you at GUADEC.  I think we should have had a
Mono BOF, but it was too late by the time I thought of it ;-(

   Anyways, here are my thoughts:

	* gdk-pixbuf is a generic image loader that loads an image
	  and leaves it into an RGB buffer.  It hides all the details
	  about what image file format is being loaded.

	* Libart is a general framework for rendering RGB/RGBA buffers
	  into RGB buffers and rendering postscript-like paths into
	  RGB/RGBA buffers.

   So we want to use gdk-pixbuf as the image loader for the image
classes, and then we need operations to render that into the windowing
system (Gtk+, MacOS, etc).  But notice how there is very little
dependnecies in Gdk-pixbuf on gtk, and libart has none.

   They are pretty independent from a windowing system (gdk-pixbuf comes
with some "helper" routines for rendering data into a pixmap and to load
pixmaps into RGB buffers).

   A few things to keep in mind:

	* gdk-pixbuf can be used to load images for Gtk+, MacOS X and 	 
Windows, it should be pretty portable, although we might need
	  in the future to back-port some new features from Gtk head. 
	  Lets talk to Federico about this, and get a status report.

	* Libart is probably only going to be used with X11, as the
	  MacOS X provides the same features in Quartz, and Win32
	  *probably* has that in GDI+.  If not, we should use libart
	  in Win32 as well (or for older Windows systems).

* Directory Layout

   My suggestion is to have:

	System.Drawing 	(assembly directory)
		System.Drawing.Blah
			Common code for "Blah"
			Stubs for "Blah" to ease ports.

		Gtk
			System.Drawing.Blah.
				Gtk ports of "System.Drawing.Blah"
		MacOS
			System.Drawing.Blah
				MacOS ports of "System.Drawing.Blah"
		Win32
			System.Drawing.Blah
				Win32 ports of "System.Drawing.Blah"

    Then we use nant targets to include/exclude the right set of files
to create the assembly.

* Open questions:

    I believe that the graphics contexts that are used to render can
accept either libart-like rendering operations and X11-like rendering
operations.  This complicates matters, but I am not sure.  Someone needs
to investigate this.
			
Miguel.