[Pipet Devel] GNOME canvas

J.W. Bizzaro bizzaro at bc.edu
Mon Dec 7 17:10:35 EST 1998

Guys, below is a description by Miguel de Icaza of the GNOME Canvas widget,
which is modeled after the Tk Canvas.  I think Konrad and Thomas will be
pleased that GTK/GNOME has a familiar component.  Jeff


GNOME provides a Canvas widget, patterned after Tk's excellent canvas. This
widget simplifies the programming of applications that need control over
graphical components. The most noticeable feature of the GNOME Canvas is that
it provides a flicker-free drawing area where high-level objects can be
inserted and manipulated. Basic zoom and scroll facilities are also a part of
the canvas. 

The high-level objects inserted into the canvas behave like regular widgets.
They can receive X events, they can grab the focus, and they can grab the
mouse just like a regular widget. As with their Tk counterparts, the GNOME
Canvas items can have their properties changed at runtime with a Tk-like
configuration mechanism. 

The GNOME Canvas ships with a number of items derived from the GnomeCanvasItem
object: lines, rectangles, ellipses, arrows, polylines and a generic widget
container to embed GTK+ widgets within a canvas. The Canvas framework is
designed to be very extensible. As proof of this extensibility, the GNOME
spreadsheet is implemented on top of the base canvas engine, with additional
functionality provided by spreadsheet-specific CanvasItems. 

Note that the current Canvas uses Gdk primitives (a thin wrapper over Xlib
primitives) to draw, so it is limited in the quality and range of special
effects that can be provided with it, which bring us to the next step in
Canvas technology. 

Raph Levien is working on an advanced rendering engine for the Canvas. It was
originally developed as a stand-alone widget within his Type1 outline font
editor, gfonted. As of the time of this writing, work on integrating the
engine into the Canvas is getting underway. 

Features of this engine include: 

      Anti-aliased rendering of all items 
      Alpha transparency 
      Items for vector and bezier paths 
      Items for RGB and RGB plus alpha images 
      Vector operations, including clip (intersect), union, difference and
stroke layout 
      PostScript Type1 font loading and rendering 

The engine's design goal is to support almost all of the PostScript imaging
model with the addition of alpha transparency. As such, it is expected to be
an excellent starting point for high-powered graphics applications. 

In spite of the ambitious goal of keeping the display up to date with entirely
anti-aliased and alpha-composited items, performance is surprisingly
good--comparable in fact to the Xlib-primitive-based canvas engine. 

His code is expected to be merged into the main Canvas sometime soon. 

J.W. Bizzaro                  Phone: 617-552-3905
Boston College                mailto:bizzaro at bc.edu
Department of Chemistry       http://www.uml.edu/Dept/Chem/Bizzaro/

More information about the Pipet-Devel mailing list