Re: Undo and Redo
- From: Paul Davis <paul linuxaudiosystems com>
- To: Jonathon Jongsma <jonathon jongsma gmail com>
- Cc: Arthur Maciel <arthurmaciel gmail com>, gtkmm-list gnome org
- Subject: Re: Undo and Redo
- Date: Mon, 05 Feb 2007 10:31:39 -0500
undo/redo is potentially a *very* complex thing to implement,
particularly if you want to be able to serialize it so that the
undo/redo state can be reloaded across program instances.
however, if you ignore that "detail", several years ago I and another
gtkmm/sigc++ enthusiast came up with what we considered a very elegant
undo/redo system that stores all "UndoableActions" using
sigc::signal<void> (i.e. a functor that can be called with no
arguments). by using sigc::bind, you can attach anything to the functor
that you need.
if your code is going to be released under the GPL, please feel free to
look at:
http://subversion.ardour.org/svn/ardour2/trunk/libs/pbd/undo.cc
http://subversion.ardour.org/svn/ardour2/trunk/libs/pbd/pbd/undo.h
http://subversion.ardour.org/svn/ardour2/trunk/libs/pbd/pbd/command.h
and lots more stuff in
http://subversion.ardour.org/svn/ardour2/trunk/libs/pbd/
the code has become more complex since we added serialization, but the
general idea should be fairly plain to see.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]