Re: GNOME spreadsheet work in progress

>  Yes, it uses the libgtkmmdraw that was announced on gtk-list recently. Jon
>  had some concerns about the speed of a Tk-like canvas for some of the
>  things he wanted to do - the overhead of the objects might be too much. 
>  I'm sure he can explain it better. More importantly we hadn't decided to
>  do Gnome-- at the time so it wasn't an option. 

I have not done any formal comparisons of speed differences between
the Tk canvas and the GnomeCanvas, but on my few informal tests, the
GnomeCanvas seems to be quite a bit faster.  It may be due to several

	- It does not have to do any interpreter work.

	- It supports a hierarchical organization of items, and that
          includes the bounding boxes of the items/groups.  So the
          very-frequently-run "point in item" function is not run on
          an item unless its parent group's bounding box contains the
          point.  So even if you have many objects, as long as they
          are organized in a nice hierarchy, it will be fast.

	- Gtk signal emission is pretty fast; I assume it is faster
          than the Tk binding system.

Then again, I do not know about Jon's requirements :-)  I'd like to
hear about them, as I'd like the canvas to be as general-purpose a
display engine as possible.

>  I will have to look at the Canvas in more detail, and think about how a
>  C++ wrapper would look. Is it possible to put the Canvas in "raw mode" and
>  just draw on it directly?

A C++ wrapper would look pretty much like the current Gtk-- wrappers
over Gtk.  Canvas items are just Gtk objects, so I guess they would
work the same way.  I don't know what you mean by a raw mode, could
you please explain?

I have some plans for the canvas.  I intend to modify Raph's
high-quality, alpha-blended, antialiased GtkCaanvas to have an API
similar to that of the GnomeCanvas.  I've talked to Raph about it, and
he thinks that this is a good idea.  This would make some interesting
things possible.

I still have to write the "output to Postscript" functionality for the
GnomeCanvas.  I intend to have an "output" method for the canvas
items, so that you could do something like

	item->output ("postscript", "");

It wouldn't be exactly like that, but you get the idea.  Another
interesting possibility is to write some bridge code between the
GnomeCanvas and the high-quality GtkCaanvas, so you could even do

	item->output ("bridge_to_gtk_caanvas", some_gtk_caanvas);

This would be cool for programs based on the canvas, such as the
spreadsheet and the presentations program.  You could work most of the
time on the fast, low-display-quality GnomeCanvas, and then switch
from time to time to a slower, high-quality GtkCaanvas.  It would be
nice for previewing and such.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]