Re: Undo framework



On Fri, Sep 21, 2007 at 05:51:26PM +0100, Iain * wrote:
> Hi,
> 
> I've had an undo framework in Marlin for years now, but recently
> people have been using it in other things (notably Ross in Tasks - ok,
> actually, he's the only one) and we discussed suggesting this for
> inclusion in GTK at some point in the future. QT4[1] and Cocoa[2] both
> have very similar frameworks. Attached are the header files.

The concept sounds good, and while your implementation looks clean,
I'd rather not see it go into gtk in it's current form.

1) As you point out we've all had undo/redo implementations for
   several years.  If we're going to do this, let's skip a
   generation and support transaction logging rather than just
   picking a best of breed version of the existing code.
   It's something I've been meaning to add to gnumeric [1] for
   several years.  The goal is to support a transaction file akin to
   VIM's .swp.  Doing this properly with permissioning for the
   transact file isn't code that should get replicated in each app.

2) Undo/Redo methods aren't sufficient.  We've found it necessary to
   differentiate Redo and Repeat sometimes.  In addition, having
   written dozens of these objects it feels like the design isn't
   quite right.  There have many instances that required
   pre-validation.  Code that is tightly coupled with the
   implementation, and should logically live in the same place.

3) Gtk seems like the right place for widgets to display the
   undo/redo stack.  However, the core of the functionality seems
   non-gui.  Something that would belong wherever we chose to put
   GDocument.  To date that type of code has been migrating out of
   gnumeric and into goffice.  If there is interest, we could
   collaborate on the next generation of this in there and rename to
   'libgdocument' or somesuch.

[1] http://svn.gnome.org/viewcvs/gnumeric/trunk/src/commands.c?view=markup



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