Undo functionality for DiaCanvas2
---------------------------------

Well... You're happy hacking on some diagram and *oops* you made a mistake...
Yes, you want to undo that error... In the canvas...

Undo functionality is a must for todays computing requirements.

The easierst way to add undo functionality is to store the information in
( object, "property", value ) tuples.

Object: The object that should be set the undo property
Property: A string describing the property
Value: The value that should be set to the property as GValue

Using the property system of the GObject is the most generic way to get and set properties.

The canvas will hold a stack of undo information. Per set of undo information
multiple values are normally changed (for example: one DiaVariable may change
multiple DiaVariable's if it is part of some constraint).


The interface will look like this:

/* Store a variable on the stack */
void dia_canvas_preserve (DiaCanvas*, GObject*, const char*, gpointer, FreeFunc)

void dia_canvas_undo_pop (DiaCanvas*)
void dia_canvas_undo_push (DiaCanvas*, const char* optional_comment)

/* Redo last undo change: */
void dia_canvas_redo_pop (DiaCanvas*)

void dia_canvas_set_undo_stack_depth (DiaCanvas*, guint depth)
guint dia_canvas_get_undo_stack_depth (DiaCanvas*)

DiaCanvasItems will just call dia_canvas_preserve() to store their variable.
On an undo event, the canvas will set all properties that are in the undo list
in reverse order. 

The Undo structure will look like this:
DiaCanvas
  `-- undo_stack (GSList*)
        +-- undo_entity (GArray*)
	|     +-- ( object, "property", val )
	|     +-- ( obj2, "add_point", GValue::boxed [ {0.0, 0.0 } ] )
	|     `-- ...
	+-- undo_entity (pushed by dia_canvas_undo_push())
	|     +-- ( var, "strength", GValue -> DIA_STRENGTH_WEAK )
	|     `-- ...
	`-- ...

The same thing for the redo stack. Only you can not add items to the redo
stack.

NOTE: if the value is a GObject, it is refcounted (default behavior of GValue)!

