Re: GNOME spreadsheet work in progress

On Fri, 17 Jul 1998, Federico Mena Quintero wrote:
> 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 looked at the canvas and it may well work for us, though at this point
I'm not sure it's worth starting over (not that we are near completion
anyway, and conceivably the Canvas will save time in the long run). The
only code I do not understand at all is the Gtk argument mechanism you use
in the item implementations, I guess it might be simple enough if I looked
at the relevant part of the Gtk source. 

Would we be able to do things like this:

 - scatter plots, this can be a couple hundred or even thousand markers,
    splattered all over the screen. They come in colors and shapes to 
    distinguish different data. Can an item be mostly transparent and let
    other items show through?

 - Select an area with rubberbanding and zoom in on that area (it isn't
    clear to me looking at the canvas how you'd do this). 
 - Have the rubberband communicate with the plot items. i.e., if you're
   selecting a curve, you want one dimension of the rubberband to be 
   "automatic" and conform to the extents of the curve, and the other
   is user-controlled.

I have to say the testgnome demo is quite impressive. I will show it to
Jon on Monday.

> 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?

For some reason I remembered the canvas items not being GtkObjects, which
would have made them harder to wrap. Since they're GtkObjects I guess the
existing Gtk-- stuff will work just fine.

By raw mode I mean drawing directly on the canvas rather than via an item.
I guess creating a new item is the way to do this, which is fine as long
as it can be done quickly in C++. However if requires writing a GtkObject
that is pretty painful if it has to be done for every type of plot.

What we have now is an enhanced DrawingArea with a backing pixmap and a
bunch of convenience wrappers around Gdk to draw to it; then we have
objects which simply draw axes, plots, lines, etc. to this directly.  The
DrawingBuffer handles expose events by refreshing areas from the pixmap. 
It is essentially a much simpler kind of canvas, but then I'm implementing
zooming and the equivalent of CanvasItem outside of it.
One trivial thing I'm doing now I notice the canvas doesn't permit is
grabbing the pointer with the "confine" option on while rubberbanding;
this confines the pointer to a single plot if there are multiple plots. It
would be nice to allow passing in that argument, and trivial to do. 

It looks like the canvas would get us some nice things for free like hit
detection, object management, and zooming (now) and postscript (later). It
also has the virtue of being in the standard Gnome library and maintained
by someone else. ;-) The bad thing is that it would cost some time right
now because we'd have to learn how to use it and how to write our own
items, and then re-do some code. We have also been using Gtk 1.0 up to
now. So I don't know what we'll do. 

On another note, if you can stand a tangent on the end of an already-long
mail, I think it would be really neat if the Canvas could make itself into
a text file and then reconstitute. Each object could have stringify and
unstringify (serialize?) methods. Then you could load and save in
GnomeCanvas format and have a GnomeCanvas viewer. 

A simple page layout application could be done by adding editing
functionality to each item type and writing a much enhanced text item. A
vector drawing program is the same application, in my view, with a
slightly different set of possible objects to draw. And a presentations
program just organizes and displays slides made in either of those
applications and maybe links some of the text to a presentation outline or
paper.  The plot program could save plots in this format, and then they
could be edited or used in the other applications.

There's really no reason that Word, Publisher, Illustrator, Excel, etc.
all offer lame page-editing capabilities when it could be delegated to a
single specialized application. Similarly, there's no reason for each app
to have postscript generation and print preview when they could all get
that free with GnomeCanvas. 

So I'm hoping someone will be inspired to do that. :-) Basically create or
copy from somewhere a standard document format for a coordinate space full
of hierarchically structured objects and layered objects. My pipe dream of
the day.


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