Re: Canvas shortcomings
- From: Martin Sevior <msevior mccubbin ph unimelb edu au>
- To: Owen Taylor <otaylor redhat com>
- Cc: Lauris Kaplinski <lauris ximian com>, Havoc Pennington <hp redhat com>, Gustavo João Alves Marques Carneiro <ee96090 fe up pt>, gnome-devel-list gnome org
- Subject: Re: Canvas shortcomings
- Date: Mon, 18 Jun 2001 15:24:20 +1000 (EST)
On Sun, 17 Jun 2001, Owen Taylor wrote:
> Whether you can get away with using GObject for the shape object or
> you have to use something simpler, I don't know. GObject creation is
> pretty fast now, and certainly could be sped up even more.
> > However I'm certainly open to counter examples that show it could be done.
> > Regarding the seperation between Model-View, I think what you really want
> > is just an interface layer between an application specific model and a
> > variety of rendering methods (GDK, PS whatever). The AbiWord project uses
> > such a layer which allows arbitary rendering backends to be plugged into a
> > consistent front end.
> > This is how we can support multiple Display systems (WIndows, QNX,
> > gdk,...) and is also how we print. We just open a new view on the Model
> > and render into a postscript or gnomeprint backend.
> > I also conjecture that doing this in C based API would be a challenge.
> Not really.
> You can look at GtkTextView / GtkTextBuffer.
> GtkTreeView / GtkListStore / GtkTreeStore
> In GTK+ head, for just a few examples of doing model/view in C. But
> this strays off of discussing a _rendering_ API, which has relevance
> only to the view.
> I think the concern is eventually having a consistent API for
> different types of rendering - not because you can't program around
> different interfaces - but primarily reduce the amount of learning for
> and work for the programmer.
> Learning how to program with GNOME shouldn't involve learning
> the Xlib, Postscript, and libart rendering models.
I fully agree. Since Havoc has explained how this could be done in C, I
think it should be possible to have a function:
gnome_canvas_draw( GnomeCanvas * myCanvas, Gtk_Generic_Graphics_Context *
Where gc is one of:
1. Standard gdk drawing context
2. Postscript context
3. PDF context
4. SVD Vector graphics context
5. Cool alpha bitmap graphics layer..
Or whatever else people might think of and want to code.
However one should be careful to remember that the Canvas, myCanvas,
itself may be just a view derived from a deeper model.
] [Thread Prev