Code

New Class SPDocumentUndo created which takes care of c++fying some non SPDocument...
authorAbhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom>
Fri, 2 Jul 2010 12:35:42 +0000 (18:05 +0530)
committerAbhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom>
Fri, 2 Jul 2010 12:35:42 +0000 (18:05 +0530)
92 files changed:
src/arc-context.cpp
src/box3d-context.cpp
src/conn-avoid-ref.cpp
src/connector-context.cpp
src/console-output-undo-observer.cpp
src/console-output-undo-observer.h
src/desktop-events.cpp
src/dialogs/clonetiler.cpp
src/dialogs/export.cpp
src/dialogs/item-properties.cpp
src/dialogs/spellcheck.cpp
src/dialogs/text-edit.cpp
src/dialogs/xml-tree.cpp
src/display/canvas-grid.cpp
src/document-undo.cpp
src/document.cpp
src/document.h
src/draw-context.cpp
src/dropper-context.cpp
src/dyna-draw-context.cpp
src/eraser-context.cpp
src/extension/effect.cpp
src/extension/execution-env.cpp
src/extension/internal/gdkpixbuf-input.cpp
src/extension/internal/pdfinput/pdf-input.cpp
src/extension/system.cpp
src/file.cpp
src/flood-context.cpp
src/gradient-context.cpp
src/gradient-drag.cpp
src/interface.cpp
src/knot.cpp
src/knotholder.cpp
src/live_effects/lpe-knot.cpp
src/live_effects/parameter/path.cpp
src/path-chemistry.cpp
src/persp3d.cpp
src/rect-context.cpp
src/select-context.cpp
src/selection-chemistry.cpp
src/seltrans.cpp
src/sp-guide.cpp
src/sp-item-group.cpp
src/sp-namedview.cpp
src/spiral-context.cpp
src/splivarot.cpp
src/spray-context.cpp
src/star-context.cpp
src/text-chemistry.cpp
src/text-context.cpp
src/trace/trace.cpp
src/tweak-context.cpp
src/ui/context-menu.cpp
src/ui/dialog/align-and-distribute.cpp
src/ui/dialog/color-item.cpp
src/ui/dialog/document-properties.cpp
src/ui/dialog/filter-effects-dialog.cpp
src/ui/dialog/glyphs.cpp
src/ui/dialog/guides.cpp
src/ui/dialog/layer-properties.cpp
src/ui/dialog/layers.cpp
src/ui/dialog/livepatheffect-editor.cpp
src/ui/dialog/session-player.cpp
src/ui/dialog/svg-fonts-dialog.cpp
src/ui/dialog/swatches.cpp
src/ui/dialog/tile.cpp
src/ui/dialog/transformation.cpp
src/ui/dialog/undo-history.cpp
src/ui/tool/multi-path-manipulator.cpp
src/ui/tool/path-manipulator.cpp
src/ui/widget/color-picker.cpp
src/ui/widget/entity-entry.cpp
src/ui/widget/layer-selector.cpp
src/ui/widget/licensor.cpp
src/ui/widget/object-composite-settings.cpp
src/ui/widget/page-sizer.cpp
src/ui/widget/registered-widget.cpp
src/ui/widget/registered-widget.h
src/ui/widget/ruler.cpp
src/ui/widget/selected-style.cpp
src/ui/widget/tolerance-slider.cpp
src/vanishing-point.cpp
src/verbs.cpp
src/widgets/fill-style.cpp
src/widgets/gradient-toolbar.cpp
src/widgets/gradient-vector.cpp
src/widgets/select-toolbar.cpp
src/widgets/sp-attribute-widget.cpp
src/widgets/sp-xmlview-content.cpp
src/widgets/stroke-style.cpp
src/widgets/swatch-selector.cpp
src/widgets/toolbox.cpp

index ab3389ec6daebae542898b20626ce4b790e36679..2f70e16f361c519fc3fb1b5a0e90af4de5e82761 100644 (file)
@@ -500,7 +500,7 @@ static void sp_arc_finish(SPArcContext *ac)
         sp_canvas_end_forced_full_redraws(desktop->canvas);
 
         sp_desktop_selection(desktop)->set(ac->item);
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC,
+               SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC,
                          _("Create ellipse"));
 
         ac->item = NULL;
@@ -526,7 +526,7 @@ static void sp_arc_cancel(SPArcContext *ac)
 
     sp_canvas_end_forced_full_redraws(desktop->canvas);
 
-    sp_document_cancel(sp_desktop_document(desktop));
+    SPDocumentUndo::cancel(sp_desktop_document(desktop));
 }
 
 
index 5534aa4109187b45df4c6d2ae009b06b9d1f171d..88763e1835c5a7360395fcfb947575d0ac8ba6a0 100644 (file)
@@ -436,42 +436,42 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven
 
         case GDK_bracketright:
             persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::X, -180/snaps, MOD__ALT);
-            sp_document_done(document, SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
                              _("Change perspective (angle of PLs)"));
             ret = true;
             break;
 
         case GDK_bracketleft:
             persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::X, 180/snaps, MOD__ALT);
-            sp_document_done(document, SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
                              _("Change perspective (angle of PLs)"));
             ret = true;
             break;
 
         case GDK_parenright:
             persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Y, -180/snaps, MOD__ALT);
-            sp_document_done(document, SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
                              _("Change perspective (angle of PLs)"));
             ret = true;
             break;
 
         case GDK_parenleft:
             persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Y, 180/snaps, MOD__ALT);
-            sp_document_done(document, SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
                              _("Change perspective (angle of PLs)"));
             ret = true;
             break;
 
         case GDK_braceright:
             persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Z, -180/snaps, MOD__ALT);
-            sp_document_done(document, SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
                              _("Change perspective (angle of PLs)"));
             ret = true;
             break;
 
         case GDK_braceleft:
             persp3d_rotate_VP (document->getCurrentPersp3D(), Proj::Z, 180/snaps, MOD__ALT);
-            sp_document_done(document, SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done(document, SP_VERB_CONTEXT_3DBOX,
                              _("Change perspective (angle of PLs)"));
             ret = true;
             break;
@@ -667,7 +667,7 @@ static void sp_box3d_finish(Box3DContext *bc)
         sp_canvas_end_forced_full_redraws(desktop->canvas);
 
         sp_desktop_selection(desktop)->set(bc->item);
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX,
                          _("Create 3D box"));
 
         bc->item = NULL;
index 15cd97b28ca30419fb123bc2962fc3c99b15617a..70e0c38562aff65722356b4d35ee516c779bfbb5 100644 (file)
@@ -197,7 +197,7 @@ void SPAvoidRef::setConnectionPointsAttrUndoable(const gchar* value, const gchar
     sp_object_setAttribute( SP_OBJECT(item), "inkscape:connection-points", value, 0 );
     item->updateRepr();
     doc->ensure_up_to_date();
-    sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, action);
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR, action);
 }
 
 void SPAvoidRef::addConnectionPoint(ConnectionPoint &cp)
@@ -589,8 +589,8 @@ void init_avoided_shape_geometry(SPDesktop *desktop)
     // Don't count this as changes to the document,
     // it is basically just late initialisation.
     SPDocument *document = sp_desktop_document(desktop);
-    bool saved = sp_document_get_undo_sensitive(document);
-    sp_document_set_undo_sensitive(document, false);
+    bool saved = SPDocumentUndo::get_undo_sensitive(document);
+       SPDocumentUndo::set_undo_sensitive(document, false);
 
     bool initialised = false;
     GSList *items = get_avoided_items(NULL, desktop->currentRoot(), desktop,
@@ -604,7 +604,7 @@ void init_avoided_shape_geometry(SPDesktop *desktop)
     if (items) {
         g_slist_free(items);
     }
-    sp_document_set_undo_sensitive(document, saved);
+       SPDocumentUndo::set_undo_sensitive(document, saved);
 }
 
 
index 90b16fddd3b8ff4a2d2010033a4e6616dbfd623e..ff19c77499879137b5c0d79950e7c781cfcc342e 100644 (file)
@@ -1152,7 +1152,7 @@ connector_handle_key_press(SPConnectorContext *const cc, guint const keyval)
 
                     cc_connector_rerouting_finish(cc, NULL);
 
-                    sp_document_undo(doc);
+                    SPDocumentUndo::undo(doc);
 
                     cc->state = SP_CONNECTOR_CONTEXT_IDLE;
                     desktop->messageStack()->flash( Inkscape::NORMAL_MESSAGE,
@@ -1303,7 +1303,7 @@ cc_connector_rerouting_finish(SPConnectorContext *const cc, Geom::Point *const p
     cc->clickeditem->setHidden(false);
     sp_conn_reroute_path_immediate(SP_PATH(cc->clickeditem));
     cc->clickeditem->updateRepr();
-    sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR,
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR,
                      _("Reroute connector"));
     cc_set_active_conn(cc, cc->clickeditem);
 }
@@ -1477,7 +1477,7 @@ spcc_flush_white(SPConnectorContext *cc, SPCurve *gc)
 
     c->unref();
 
-    sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, _("Create connector"));
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR, _("Create connector"));
 }
 
 
@@ -1935,7 +1935,7 @@ void cc_selection_set_avoid(bool const set_avoid)
     char *event_desc = (set_avoid) ?
             _("Make connectors avoid selected objects") :
             _("Make connectors ignore selected objects");
-    sp_document_done(document, SP_VERB_CONTEXT_CONNECTOR, event_desc);
+    SPDocumentUndo::done(document, SP_VERB_CONTEXT_CONNECTOR, event_desc);
 }
 
 
index 84d8af3a8534d30dfde3e12a939c175384e2a631..9369b5db5e59f3978fea54354dd8eec53fc6d14e 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Inkscape::ConsoleOutputUndoObserver - observer for tracing calls to
- * sp_document_undo, sp_document_redo, sp_document_maybe_done
+ * SPDocumentUndo::undo, SPDocumentUndo::redo, SPDocumentUndo::maybe_done
  *
  * Authors:
  * David Yip <yipdw@alumni.rose-hulman.edu>
@@ -19,19 +19,19 @@ namespace Inkscape {
 void
 ConsoleOutputUndoObserver::notifyUndoEvent(Event* /*log*/)
 {
-    // g_message("notifyUndoEvent (sp_document_undo) called; log=%p\n", log->event);
+    // g_message("notifyUndoEvent (SPDocumentUndo::undo) called; log=%p\n", log->event);
 }
 
 void
 ConsoleOutputUndoObserver::notifyRedoEvent(Event* /*log*/)
 {
-    // g_message("notifyRedoEvent (sp_document_redo) called; log=%p\n", log->event);
+    // g_message("notifyRedoEvent (SPDocumentUndo::redo) called; log=%p\n", log->event);
 }
 
 void
 ConsoleOutputUndoObserver::notifyUndoCommitEvent(Event* /*log*/)
 {
-    //g_message("notifyUndoCommitEvent (sp_document_maybe_done) called; log=%p\n", log->event);
+    //g_message("notifyUndoCommitEvent (SPDocumentUndo::maybe_done) called; log=%p\n", log->event);
 }
 
 void
index 9b42cf033df133a8a9c587440cb849eb524da3e8..f8667d567bad1c718ed7b7827280635deb7a7d8b 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * Inkscape::ConsoleOutputUndoObserver - observer for tracing calls to
- * sp_document_undo, sp_document_redo, sp_document_maybe_done
+ * SPDocumentUndo::undo, SPDocumentUndo::redo, SPDocumentUndo::maybe_done
  *
  * Authors:
  * David Yip <yipdw@alumni.rose-hulman.edu>
index 810f501d7fe1bbf024161db08f6fa31b54d9e314..2046b95101aaca86b3c43e837fc9ec9673ded798 100644 (file)
@@ -185,7 +185,7 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge
                     sp_repr_set_point(repr, "position", from_2geom(event_dt));
                     SP_OBJECT_REPR(desktop->namedview)->appendChild(repr);
                     Inkscape::GC::release(repr);
-                    sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE,
+                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE,
                                      _("Create guide"));
                 }
                 desktop->set_coordinate_status(from_2geom(event_dt));
@@ -398,14 +398,14 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data)
                                 g_assert_not_reached();
                                 break;
                         }
-                        sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE,
+                        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE,
                                          _("Move guide"));
                     } else {
                         /* Undo movement of any attached shapes. */
                         sp_guide_moveto(*guide, guide->point_on_line, false);
                         sp_guide_set_normal(*guide, guide->normal_to_line, false);
                         sp_guide_remove(guide);
-                        sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE,
+                        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE,
                                      _("Delete guide"));
                     }
                     moved = false;
@@ -452,7 +452,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data)
                 {
                     SPDocument *doc = SP_OBJECT_DOCUMENT(guide);
                     sp_guide_remove(guide);
-                    sp_document_done(doc, SP_VERB_NONE, _("Delete guide"));
+                    SPDocumentUndo::done(doc, SP_VERB_NONE, _("Delete guide"));
                     ret = TRUE;
                     sp_event_context_discard_delayed_snap_event(desktop->event_context);
                     break;
index 8dd59425ae350b29774b31c3b243fbc62611a527..b1c1cf74a6ccc29523834e0b8b2dc6ead30aec7b 100644 (file)
@@ -993,7 +993,7 @@ clonetiler_unclump( GtkWidget */*widget*/, void * )
 
     g_slist_free (to_unclump);
 
-    sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_CLONETILER,
+    SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_CLONETILER,
                       _("Unclump tiled clones"));
 }
 
@@ -1046,7 +1046,7 @@ clonetiler_remove( GtkWidget */*widget*/, void *, bool do_undo = true )
     clonetiler_change_selection (NULL, selection, dlg);
 
     if (do_undo)
-        sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_CLONETILER,
+        SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_CLONETILER,
                           _("Delete tiled clones"));
 }
 
@@ -1510,7 +1510,7 @@ clonetiler_apply( GtkWidget */*widget*/, void * )
 
     desktop->clearWaitingCursor();
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER,
                      _("Create tiled clones"));
 }
 
index 6513813cc0e0ba49b151aec6860232c205573d3e..649918742e723a7e0c486bbd1ce606d7d41894bd 100644 (file)
@@ -1243,8 +1243,8 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
             bool modified = false;
             const gchar * temp_string;
 
-            bool saved = sp_document_get_undo_sensitive(doc);
-            sp_document_set_undo_sensitive(doc, false);
+            bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+                       SPDocumentUndo::set_undo_sensitive(doc, false);
 
             temp_string = repr->attribute("inkscape:export-filename");
             if (temp_string == NULL || strcmp(temp_string, filename_ext)) {
@@ -1261,7 +1261,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
                 sp_repr_set_svg_double(repr, "inkscape:export-ydpi", ydpi);
                 modified = true;
             }
-            sp_document_set_undo_sensitive(doc, saved);
+                       SPDocumentUndo::set_undo_sensitive(doc, saved);
 
             if (modified) {
                 doc->setModifiedSinceSave();
@@ -1273,8 +1273,8 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
             SPDocument * doc = SP_ACTIVE_DOCUMENT;
             bool modified = false;
 
-            bool saved = sp_document_get_undo_sensitive(doc);
-            sp_document_set_undo_sensitive(doc, false);
+            bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+                       SPDocumentUndo::set_undo_sensitive(doc, false);
             reprlst = sp_desktop_selection(SP_ACTIVE_DESKTOP)->reprList();
 
             for(; reprlst != NULL; reprlst = reprlst->next) {
@@ -1302,7 +1302,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base)
                     modified = true;
                 }
             }
-            sp_document_set_undo_sensitive(doc, saved);
+                       SPDocumentUndo::set_undo_sensitive(doc, saved);
 
             if (modified) {
                 doc->setModifiedSinceSave();
index abc45b44be8f22b97856c66a63b834e1edda1f02..8d2b15e4402e6dcfc864a7d9f3736029634c63f6 100644 (file)
@@ -398,7 +398,7 @@ sp_item_widget_sensitivity_toggled (GtkWidget *widget, SPWidget *spw)
 
     item->setLocked(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)));
 
-    sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
+    SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))? _("Lock object") : _("Unlock object"));
 
     gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE));
@@ -417,7 +417,7 @@ sp_item_widget_hidden_toggled(GtkWidget *widget, SPWidget *spw)
 
     item->setExplicitlyHidden(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
 
-    sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
+    SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
              gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))? _("Hide object") : _("Unhide object"));
 
     gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE));
@@ -450,7 +450,7 @@ sp_item_widget_label_changed( GtkWidget */*widget*/, SPWidget *spw )
         gtk_label_set_markup_with_mnemonic (GTK_LABEL (id_label), _("_Id"));
         SP_EXCEPTION_INIT (&ex);
         sp_object_setAttribute (SP_OBJECT (item), "id", id, &ex);
-        sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
+        SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
                                 _("Set object ID"));
     }
 
@@ -465,7 +465,7 @@ sp_item_widget_label_changed( GtkWidget */*widget*/, SPWidget *spw )
     SPObject *obj = (SPObject*)item;
     if (strcmp (label, obj->defaultLabel())) {
         obj->setLabel(label);
-        sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
+        SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
                                 _("Set object label"));
     }
 
@@ -473,7 +473,7 @@ sp_item_widget_label_changed( GtkWidget */*widget*/, SPWidget *spw )
     GtkWidget *w = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(spw), "title"));
     gchar *title = (gchar *)gtk_entry_get_text(GTK_ENTRY (w));
     if (obj->setTitle(title))
-        sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
+        SPDocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
                          _("Set object title"));
 
     /* Retrieve the description */
@@ -483,7 +483,7 @@ sp_item_widget_label_changed( GtkWidget */*widget*/, SPWidget *spw )
     gtk_text_buffer_get_bounds(buf, &start, &end);
     gchar *desc = gtk_text_buffer_get_text(buf, &start, &end, TRUE);
     if (obj->setDesc(desc))
-        sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
+        SPDocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
                          _("Set object description"));
     g_free(desc);
 
index 24890f8eb13d6c81aa5cc62ff88d0901240e32b3..5372a8bb5ee6c1aa802024754a3f303536324cba 100644 (file)
@@ -777,7 +777,7 @@ sp_spellcheck_accept (GObject *, GObject *dlg)
             // find the end of the word anew
             _end_w = _begin_w;
             _end_w.nextEndOfWord();
-            sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_TEXT,
+            SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_TEXT,
                               _("Fix spelling"));
         }
     }
index dc71de7c33006b297899efd9319e40e647500de4..ab0de514ad1445de86ab9070d67d4c5a6d52f867 100644 (file)
@@ -661,7 +661,7 @@ sp_text_edit_dialog_apply( GtkButton */*button*/, GtkWidget *dlg )
     }
 
     // complete the transaction
-    sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
                       _("Set text style"));
     gtk_widget_set_sensitive (apply, FALSE);
     sp_repr_css_attr_unref (css);
index c8644fef962ef2b3af6adddb79be4791f2d50f19..515b49360d20f1705764328647d8d57632cfe857 100644 (file)
@@ -870,10 +870,10 @@ void after_tree_move(GtkCTree */*tree*/,
     if (GTK_CTREE_ROW(node)->parent  == new_parent &&
         GTK_CTREE_ROW(node)->sibling == new_sibling)
     {
-        sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+        SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                          _("Drag XML subtree"));
     } else {
-        sp_document_cancel(current_document);
+        SPDocumentUndo::cancel(current_document);
     }
 }
 
@@ -1371,7 +1371,7 @@ void cmd_new_element_node(GtkObject */*object*/, gpointer /*data*/)
         set_tree_select(new_repr);
         set_dt_select(new_repr);
 
-        sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+        SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Create new element node"));
     }
 
@@ -1387,7 +1387,7 @@ void cmd_new_text_node(GtkObject */*object*/, gpointer /*data*/)
     Inkscape::XML::Node *text = xml_doc->createTextNode("");
     selected_repr->appendChild(text);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Create new text node"));
 
     set_tree_select(text);
@@ -1405,7 +1405,7 @@ void cmd_duplicate_node(GtkObject */*object*/, gpointer /*data*/)
     Inkscape::XML::Node *dup = selected_repr->duplicate(parent->document());
     parent->addChild(dup, selected_repr);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Duplicate node"));
 
     GtkCTreeNode *node = sp_xmlview_tree_get_repr_node(SP_XMLVIEW_TREE(tree), dup);
@@ -1422,7 +1422,7 @@ void cmd_delete_node(GtkObject */*object*/, gpointer /*data*/)
     g_assert(selected_repr != NULL);
     sp_repr_unparent(selected_repr);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      Q_("nodeAsInXMLinHistoryDialog|Delete node"));
 }
 
@@ -1440,7 +1440,7 @@ void cmd_delete_attr(GtkObject */*object*/, gpointer /*data*/)
         updated->updateRepr();
     }
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Delete attribute"));
 }
 
@@ -1469,7 +1469,7 @@ void cmd_set_attr(GtkObject */*object*/, gpointer /*data*/)
         updated->updateRepr();
     }
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Change attribute"));
 
     /* TODO: actually, the row won't have been created yet.  why? */
@@ -1499,7 +1499,7 @@ void cmd_raise_node(GtkObject */*object*/, gpointer /*data*/)
 
     parent->changeOrder(selected_repr, ref);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Raise node"));
 
     set_tree_select(selected_repr);
@@ -1516,7 +1516,7 @@ void cmd_lower_node(GtkObject */*object*/, gpointer /*data*/)
 
     parent->changeOrder(selected_repr, selected_repr->next());
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Lower node"));
 
     set_tree_select(selected_repr);
@@ -1546,7 +1546,7 @@ void cmd_indent_node(GtkObject */*object*/, gpointer /*data*/)
     parent->removeChild(repr);
     prev->addChild(repr, ref);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Indent node"));
     set_tree_select(repr);
     set_dt_select(repr);
@@ -1567,7 +1567,7 @@ void cmd_unindent_node(GtkObject */*object*/, gpointer /*data*/)
     parent->removeChild(repr);
     grandparent->addChild(repr, parent);
 
-    sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+    SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
                      _("Unindent node"));
     set_tree_select(repr);
     set_dt_select(repr);
index a79a6b610c1bc947b0ede5f7bf2c6d4007d86dec..7a21c19b824c228d010c04e4c4c75db6e047ab54 100644 (file)
@@ -255,7 +255,7 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, Gri
     repr->appendChild(newnode);
     Inkscape::GC::release(newnode);
 
-    sp_document_done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid"));
 }
 
 /*
index ee15e480f820d639196e9c8a404c0c19bd1243a9..280eea24317f6d2802bbbbd5a07fd6adaa2cf79a 100644 (file)
@@ -63,6 +63,7 @@
 #include "xml/repr.h"
 #include "document-private.h"
 #include "inkscape.h"
+//#include "document-undo.h"
 #include "debug/event-tracker.h"
 #include "debug/simple-event.h"
 #include "debug/timestamp.h"
@@ -85,7 +86,7 @@
         sp_document_set_undo_sensitive(document, saved);  \endverbatim
  */
 void
-sp_document_set_undo_sensitive (SPDocument *doc, bool sensitive)
+SPDocumentUndo::set_undo_sensitive (SPDocument *doc, bool sensitive)
 {
        g_assert (doc != NULL);
        g_assert (doc->priv != NULL);
@@ -112,7 +113,7 @@ sp_document_set_undo_sensitive (SPDocument *doc, bool sensitive)
  * the saved bools in a stack.  Perhaps this is why the above solution is better.
  */
 
-bool sp_document_get_undo_sensitive(SPDocument const *document) {
+bool SPDocumentUndo::get_undo_sensitive(SPDocument const *document) {
        g_assert(document != NULL);
        g_assert(document->priv != NULL);
 
@@ -120,13 +121,13 @@ bool sp_document_get_undo_sensitive(SPDocument const *document) {
 }
 
 void
-sp_document_done (SPDocument *doc, const unsigned int event_type, Glib::ustring event_description)
+SPDocumentUndo::done (SPDocument *doc, const unsigned int event_type, Glib::ustring event_description)
 {
-        sp_document_maybe_done (doc, NULL, event_type, event_description);
+        maybe_done (doc, NULL, event_type, event_description);
 }
 
 void
-sp_document_reset_key (Inkscape::Application */*inkscape*/, SPDesktop */*desktop*/, GtkObject *base)
+SPDocumentUndo::reset_key (Inkscape::Application */*inkscape*/, SPDesktop */*desktop*/, GtkObject *base)
 {
     SPDocument *doc = (SPDocument *) base;
     doc->actionkey = NULL;
@@ -165,7 +166,7 @@ public:
 }
 
 void
-sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int event_type,
+SPDocumentUndo::maybe_done (SPDocument *doc, const gchar *key, const unsigned int event_type,
                         Glib::ustring event_description)
 {
        g_assert (doc != NULL);
@@ -178,7 +179,7 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
 
        doc->ensure_up_to_date ();
 
-       sp_document_clear_redo (doc);
+       SPDocumentUndo::clear_redo (doc);
 
        Inkscape::XML::Event *log = sp_repr_coalesce_log (doc->priv->partial, sp_repr_commit_undoable (doc->rdoc));
        doc->priv->partial = NULL;
@@ -209,7 +210,7 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
 }
 
 void
-sp_document_cancel (SPDocument *doc)
+SPDocumentUndo::cancel (SPDocument *doc)
 {
        g_assert (doc != NULL);
        g_assert (doc->priv != NULL);
@@ -241,7 +242,7 @@ static void finish_incomplete_transaction(SPDocument &doc) {
 }
 
 gboolean
-sp_document_undo (SPDocument *doc)
+SPDocumentUndo::undo (SPDocument *doc)
 {
        using Inkscape::Debug::EventTracker;
        using Inkscape::Debug::SimpleEvent;
@@ -287,7 +288,7 @@ sp_document_undo (SPDocument *doc)
 }
 
 gboolean
-sp_document_redo (SPDocument *doc)
+SPDocumentUndo::redo (SPDocument *doc)
 {
        using Inkscape::Debug::EventTracker;
        using Inkscape::Debug::SimpleEvent;
@@ -333,7 +334,7 @@ sp_document_redo (SPDocument *doc)
 }
 
 void
-sp_document_clear_undo (SPDocument *doc)
+SPDocumentUndo::clear_undo (SPDocument *doc)
 {
         if (doc->priv->undo)
                 doc->priv->undoStackObservers.notifyClearUndoEvent();
@@ -351,7 +352,7 @@ sp_document_clear_undo (SPDocument *doc)
 }
 
 void
-sp_document_clear_redo (SPDocument *doc)
+SPDocumentUndo::clear_redo (SPDocument *doc)
 {
         if (doc->priv->redo)
                 doc->priv->undoStackObservers.notifyClearRedoEvent();
index 147c22b3c1dbd476a1399e139b94f67449836cbb..e68bc1f947bb46d7bc0d93d0b9dea223972e9179 100644 (file)
@@ -150,8 +150,8 @@ SPDocument::~SPDocument() {
             priv->partial = NULL;
         }
 
-        sp_document_clear_redo(this);
-        sp_document_clear_undo(this);
+               SPDocumentUndo::clear_redo(this);
+               SPDocumentUndo::clear_undo(this);
 
         if (root) {
             root->releaseReferences();
@@ -200,7 +200,7 @@ SPDocument::~SPDocument() {
 
     if (oldSignalsConnected) {
         g_signal_handlers_disconnect_by_func(G_OBJECT(INKSCAPE),
-                                             reinterpret_cast<gpointer>(sp_document_reset_key),
+                                             reinterpret_cast<gpointer>(SPDocumentUndo::reset_key),
                                              static_cast<gpointer>(this));
     } else {
         _selection_changed_connection.disconnect();
@@ -416,14 +416,14 @@ SPDocument::createDoc(Inkscape::XML::Document *rdoc,
         document->setCurrentPersp3DImpl(persp_impl);
     }
 
-    sp_document_set_undo_sensitive(document, true);
+       SPDocumentUndo::set_undo_sensitive(document, true);
 
     // reset undo key when selection changes, so that same-key actions on different objects are not coalesced
     if (!Inkscape::NSApplication::Application::getNewGui()) {
         g_signal_connect(G_OBJECT(INKSCAPE), "change_selection",
-                         G_CALLBACK(sp_document_reset_key), document);
+                         G_CALLBACK(SPDocumentUndo::reset_key), document);
         g_signal_connect(G_OBJECT(INKSCAPE), "activate_desktop",
-                         G_CALLBACK(sp_document_reset_key), document);
+                         G_CALLBACK(SPDocumentUndo::reset_key), document);
         document->oldSignalsConnected = true;
     } else {
         document->_selection_changed_connection = Inkscape::NSApplication::Editor::connectSelectionChanged (sigc::mem_fun (*document, &SPDocument::reset_key));
@@ -717,10 +717,10 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins)
     }
 }
 
-static void
-do_change_uri(SPDocument *const document, gchar const *const filename, bool const rebase)
+void
+SPDocument::do_change_uri(gchar const *const filename, bool const rebase)
 {
-    g_return_if_fail(document != NULL);
+    //g_return_if_fail(this != NULL);
 
     gchar *new_base;
     gchar *new_name;
@@ -739,32 +739,32 @@ do_change_uri(SPDocument *const document, gchar const *const filename, bool cons
     } else {
         new_uri = g_strdup_printf(_("Unnamed document %d"), ++doc_count);
         new_base = NULL;
-        new_name = g_strdup(document->uri);
+        new_name = g_strdup(this->uri);
     }
 
     // Update saveable repr attributes.
-    Inkscape::XML::Node *repr = sp_document_repr_root(document);
+    Inkscape::XML::Node *repr = sp_document_repr_root(this);
 
     // Changing uri in the document repr must not be not undoable.
-    bool const saved = sp_document_get_undo_sensitive(document);
-    sp_document_set_undo_sensitive(document, false);
+    bool const saved = SPDocumentUndo::get_undo_sensitive(this);
+       SPDocumentUndo::set_undo_sensitive(this, false);
 
     if (rebase) {
-        Inkscape::XML::rebase_hrefs(document, new_base, true);
+        Inkscape::XML::rebase_hrefs(this, new_base, true);
     }
 
-    repr->setAttribute("sodipodi:docname", document->name);
-    sp_document_set_undo_sensitive(document, saved);
+    repr->setAttribute("sodipodi:docname", this->name);
+       SPDocumentUndo::set_undo_sensitive(this, saved);
 
 
-    g_free(document->name);
-    g_free(document->base);
-    g_free(document->uri);
-    document->name = new_name;
-    document->base = new_base;
-    document->uri = new_uri;
+    g_free(this->name);
+    g_free(this->base);
+    g_free(this->uri);
+    this->name = new_name;
+    this->base = new_base;
+    this->uri = new_uri;
 
-    document->priv->uri_set_signal.emit(document->uri);
+    this->priv->uri_set_signal.emit(this->uri);
 }
 
 /**
@@ -776,9 +776,9 @@ do_change_uri(SPDocument *const document, gchar const *const filename, bool cons
  */
 void SPDocument::setUri(gchar const *filename)
 {
-    g_return_if_fail(this != NULL);
+    //g_return_if_fail(this != NULL);
 
-    do_change_uri(this, filename, false);
+    do_change_uri(filename, false);
 }
 
 /**
@@ -789,15 +789,15 @@ void SPDocument::setUri(gchar const *filename)
  */
 void SPDocument::change_uri_and_hrefs(gchar const *filename)
 {
-    g_return_if_fail(this != NULL);
+    //g_return_if_fail(this != NULL);
 
-    do_change_uri(this, filename, true);
+    do_change_uri(filename, true);
 }
 
 void
 SPDocument::resized_signal_emit(gdouble width, gdouble height)
 {
-    g_return_if_fail(this != NULL);
+    //g_return_if_fail(this != NULL);
 
     this->priv->resized_signal.emit(width, height);
 }
@@ -1005,12 +1005,12 @@ SPDocument::_updateDocument()
             SPItemCtx ctx;
             sp_document_setup_viewport (this, &ctx);
 
-            bool saved = sp_document_get_undo_sensitive(this);
-            sp_document_set_undo_sensitive(this, false);
+            bool saved = SPDocumentUndo::get_undo_sensitive(this);
+                       SPDocumentUndo::set_undo_sensitive(this, false);
 
             this->root->updateDisplay((SPCtx *)&ctx, 0);
 
-            sp_document_set_undo_sensitive(this, saved);
+                       SPDocumentUndo::set_undo_sensitive(this, saved);
         }
         this->_emitModified();
     }
@@ -1271,7 +1271,7 @@ find_group_at_point(unsigned int dkey, SPGroup *group, Geom::Point const p)
 
 GSList *SPDocument::items_in_box(unsigned int dkey, Geom::Rect const &box)
 {
-    g_return_val_if_fail(this != NULL, NULL);
+    //g_return_val_if_fail(this != NULL, NULL);
     g_return_val_if_fail(this->priv != NULL, NULL);
 
     return find_items_in_area(NULL, SP_GROUP(this->root), dkey, box, is_within);
@@ -1286,7 +1286,7 @@ GSList *SPDocument::items_in_box(unsigned int dkey, Geom::Rect const &box)
 
 GSList *SPDocument::partial_items_in_box(unsigned int dkey, Geom::Rect const &box)
 {
-    g_return_val_if_fail(this != NULL, NULL);
+    //g_return_val_if_fail(this != NULL, NULL);
     g_return_val_if_fail(this->priv != NULL, NULL);
 
     return find_items_in_area(NULL, SP_GROUP(this->root), dkey, box, overlaps);
@@ -1321,7 +1321,7 @@ SPItem *
 SPDocument::item_at_point( unsigned const key, Geom::Point const p,
                           gboolean const into_groups, SPItem *upto)
 {
-    g_return_val_if_fail(this != NULL, NULL);
+    //g_return_val_if_fail(this != NULL, NULL);
     g_return_val_if_fail(this->priv != NULL, NULL);
 
     return find_item_at_point(key, SP_GROUP(this->root), p, into_groups, false, upto);
@@ -1330,7 +1330,7 @@ SPDocument::item_at_point( unsigned const key, Geom::Point const p,
 SPItem*
 SPDocument::group_at_point(unsigned int key, Geom::Point const p)
 {
-    g_return_val_if_fail(this != NULL, NULL);
+    //g_return_val_if_fail(this != NULL, NULL);
     g_return_val_if_fail(this->priv != NULL, NULL);
 
     return find_group_at_point(key, SP_GROUP(this->root), p);
@@ -1345,7 +1345,7 @@ SPDocument::add_resource(gchar const *key, SPObject *object)
     GSList *rlist;
     GQuark q = g_quark_from_string(key);
 
-    g_return_val_if_fail(this != NULL, FALSE);
+    //g_return_val_if_fail(this != NULL, FALSE);
     g_return_val_if_fail(key != NULL, FALSE);
     g_return_val_if_fail(*key != '\0', FALSE);
     g_return_val_if_fail(object != NULL, FALSE);
@@ -1370,7 +1370,7 @@ SPDocument::remove_resource(gchar const *key, SPObject *object)
     GSList *rlist;
     GQuark q = g_quark_from_string(key);
 
-    g_return_val_if_fail(this != NULL, FALSE);
+    //g_return_val_if_fail(this != NULL, FALSE);
     g_return_val_if_fail(key != NULL, FALSE);
     g_return_val_if_fail(*key != '\0', FALSE);
     g_return_val_if_fail(object != NULL, FALSE);
@@ -1393,7 +1393,7 @@ SPDocument::remove_resource(gchar const *key, SPObject *object)
 GSList const *
 SPDocument::get_resource_list(gchar const *key)
 {
-    g_return_val_if_fail(this != NULL, NULL);
+    //g_return_val_if_fail(this != NULL, NULL);
     g_return_val_if_fail(key != NULL, NULL);
     g_return_val_if_fail(*key != '\0', NULL);
 
index 3fa83c779394f9ae6c00d8cddce4229f2beb0a6b..38f930c31a5f782eea8fe7528c90fecc1a18dea7 100644 (file)
@@ -28,6 +28,7 @@
 #include "gc-anchored.h"
 #include <glibmm/ustring.h>
 #include "verbs.h"
+#include "document-undo.h"
 #include <vector>
 #include <set>
 
@@ -213,6 +214,9 @@ public:
        void resized_signal_emit(gdouble width, gdouble height);
        
        unsigned int vacuum_document();
+
+       private:
+       void do_change_uri(gchar const *const filename, bool const rebase);
 };
 
 //SPDocument *sp_document_new(const gchar *uri, unsigned int keepalive, bool make_new = false);
@@ -254,11 +258,11 @@ struct SPUnit;
  * Undo & redo
  */
 
-void sp_document_set_undo_sensitive(SPDocument *document, bool sensitive);
-bool sp_document_get_undo_sensitive(SPDocument const *document);
+//void sp_document_set_undo_sensitive(SPDocument *document, bool sensitive);
+//bool sp_document_get_undo_sensitive(SPDocument const *document);
 
-void sp_document_clear_undo(SPDocument *document);
-void sp_document_clear_redo(SPDocument *document);
+//void sp_document_clear_undo(SPDocument *document);
+//void sp_document_clear_redo(SPDocument *document);
 
 //void sp_document_child_added(SPDocument *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
 //void sp_document_child_removed(SPDocument *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref);
@@ -271,16 +275,16 @@ void sp_document_clear_redo(SPDocument *document);
 //gint sp_document_ensure_up_to_date(SPDocument *doc);
 
 /* Save all previous actions to stack, as one undo step */
-void sp_document_done(SPDocument *document, unsigned int event_type, Glib::ustring event_description);
-void sp_document_maybe_done(SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description);
-void sp_document_reset_key(Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base);
+//void sp_document_done(SPDocument *document, unsigned int event_type, Glib::ustring event_description);
+//void sp_document_maybe_done(SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description);
+//void sp_document_reset_key(Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base);
 
 /* Cancel (and revert) current unsaved actions */
-void sp_document_cancel(SPDocument *document);
+//void sp_document_cancel(SPDocument *document);
 
 /* Undo and redo */
-gboolean sp_document_undo(SPDocument *document);
-gboolean sp_document_redo(SPDocument *document);
+//gboolean sp_document_undo(SPDocument *document);
+//gboolean sp_document_redo(SPDocument *document);
 
 /* Resource management */
 //gboolean sp_document_add_resource(SPDocument *document, const gchar *key, SPObject *object);
index ea25efc225f7712dd905e60b219efcc0b9480ea2..a3c3601cc8ccd98f35740bd8a8ae89fdfbd05a8e 100644 (file)
@@ -698,7 +698,7 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc)
             item->updateRepr();
         }
 
-        sp_document_done(doc, SP_IS_PEN_CONTEXT(dc)? SP_VERB_CONTEXT_PEN : SP_VERB_CONTEXT_PENCIL,
+        SPDocumentUndo::done(doc, SP_IS_PEN_CONTEXT(dc)? SP_VERB_CONTEXT_PEN : SP_VERB_CONTEXT_PENCIL,
                          _("Draw path"));
 
         // When quickly drawing several subpaths with Shift, the next subpath may be finished and
@@ -861,7 +861,7 @@ void spdc_create_single_dot(SPEventContext *ec, Geom::Point const &pt, char cons
     sp_desktop_selection(desktop)->set(item);
 
     desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating single dot"));
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, _("Create single dot"));
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, _("Create single dot"));
 }
 
 /*
index 5415fdc80fb050af4193d3c11cab77911811b5b9..513963692bade15bbc9bd1574e02a6aacf56ed86 100644 (file)
@@ -350,7 +350,7 @@ static gint sp_dropper_context_root_handler(SPEventContext *event_context, GdkEv
 
 
                 if (!(sp_desktop_selection(desktop)->isEmpty())) {
-                    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_DROPPER,
+                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_DROPPER,
                                      _("Set picked color"));
                 }
 
index 4d8ab2c11b726b928bb54e98e4d29222b39b3bc9..ab57872cde0ccab109400a51f7d95852fb9e2f0d 100644 (file)
@@ -1040,7 +1040,7 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize, bool subtract)
         dc->repr = NULL;
     }
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_CALLIGRAPHIC,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_CALLIGRAPHIC,
                      _("Draw calligraphic stroke"));
 }
 
index db1aa46d9be7faa83c4c531e051d5f7e9f58ecb9..fdb0813ce7d065f6df373eafa77fdc5db65093fe 100644 (file)
@@ -826,10 +826,10 @@ set_to_accumulated(SPEraserContext *dc)
 
 
     if ( workDone ) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ERASER, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ERASER, 
                          _("Draw eraser stroke"));
     } else {
-        sp_document_cancel(sp_desktop_document(desktop));
+        SPDocumentUndo::cancel(sp_desktop_document(desktop));
     }
 }
 
index afc0668a9eb967eff6dbe7429b2281903a4198b6..79bd96a7edf70a7515d6817b0059d09c9bf17dc0 100644 (file)
@@ -258,7 +258,7 @@ Effect::prefs (Inkscape::UI::View::View * doc)
     This function first insures that the extension is loaded, and if not,
     loads it.  It then calls the implemention to do the actual work.  It
     also resets the last effect pointer to be this effect.  Finally, it
-    executes a \c sp_document_done to commit the changes to the undo
+    executes a \c SPDocumentUndo::done to commit the changes to the undo
     stack.
 */
 void
index 7ed3891951c33a38ebd6328d7a57dfc0f3c2a4bb..d97c8c6de89039ad1cc44a052ce56b0c62d643ad 100644 (file)
@@ -162,14 +162,14 @@ ExecutionEnv::cancel (void) {
 
 void
 ExecutionEnv::undo (void) {
-    sp_document_cancel(_doc->doc());
+    SPDocumentUndo::cancel(_doc->doc());
     reselect();
     return;
 }
 
 void
 ExecutionEnv::commit (void) {
-    sp_document_done(_doc->doc(), SP_VERB_NONE, _(_effect->get_name()));
+    SPDocumentUndo::done(_doc->doc(), SP_VERB_NONE, _(_effect->get_name()));
     Effect::set_last_effect(_effect);
     _effect->get_imp()->commitDocument();
     killDocCache();
index 4983d7eff4069a994f253dbc6fb4d6f736109461..69fdbcfd1dc02e1f1ca9023a6f211257c0432aae 100644 (file)
@@ -55,8 +55,8 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
         }
 
         doc = SPDocument::createNewDoc(NULL, TRUE, TRUE);
-        bool saved = sp_document_get_undo_sensitive(doc);
-        sp_document_set_undo_sensitive(doc, false); // no need to undo in this temporary document
+        bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+               SPDocumentUndo::set_undo_sensitive(doc, false); // no need to undo in this temporary document
 
         double width = gdk_pixbuf_get_width(pb);
         double height = gdk_pixbuf_get_height(pb);
@@ -103,7 +103,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri)
         Inkscape::GC::release(image_node);
         fit_canvas_to_drawing(doc);
         // restore undo, as now this document may be shown to the user if a bitmap was opened
-        sp_document_set_undo_sensitive(doc, saved);
+               SPDocumentUndo::set_undo_sensitive(doc, saved);
     } else {
         printf("GdkPixbuf loader failed\n");
     }
index 9826addb6fb209624b8f08d36b5b39a0be2f8c6e..b507118035e053acac0efe1be82e0bf688f2faaf 100644 (file)
@@ -662,8 +662,8 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
     Page *page = catalog->getPage(page_num);
 
     SPDocument *doc = SPDocument::createNewDoc(NULL, TRUE, TRUE);
-    bool saved = sp_document_get_undo_sensitive(doc);
-    sp_document_set_undo_sensitive(doc, false); // No need to undo in this temporary document
+    bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+       SPDocumentUndo::set_undo_sensitive(doc, false); // No need to undo in this temporary document
 
     // Create builder
     gchar *docname = g_path_get_basename(uri);
@@ -737,7 +737,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) {
     delete dlg;
 
     // Restore undo
-    sp_document_set_undo_sensitive(doc, saved);
+       SPDocumentUndo::set_undo_sensitive(doc, saved);
 
     return doc;
 }
index 67720235dd80eaa30db29bd939ce65a81c8606e5..8cfc58797c84b3e74b4a14566640f01585fdfc78 100644 (file)
@@ -274,8 +274,8 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
 
     // Update attributes:
     {
-        bool const saved = sp_document_get_undo_sensitive(doc);
-        sp_document_set_undo_sensitive(doc, false);
+        bool const saved = SPDocumentUndo::get_undo_sensitive(doc);
+               SPDocumentUndo::set_undo_sensitive(doc, false);
         {
             // also save the extension for next use
             store_file_extension_in_prefs (omod->get_id(), save_method);
@@ -285,7 +285,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
                 repr->setAttribute("inkscape:dataloss", "true");
             }
         }
-        sp_document_set_undo_sensitive(doc, saved);
+               SPDocumentUndo::set_undo_sensitive(doc, saved);
         doc->setModifiedSinceSave(false);
     }
 
@@ -295,13 +295,13 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
     catch(...) {
         // revert attributes in case of official and overwrite
         if(check_overwrite && official) {
-            bool const saved = sp_document_get_undo_sensitive(doc);
-            sp_document_set_undo_sensitive(doc, false);
+            bool const saved = SPDocumentUndo::get_undo_sensitive(doc);
+                       SPDocumentUndo::set_undo_sensitive(doc, false);
             {
                 store_file_extension_in_prefs (saved_output_extension, save_method);
                 repr->setAttribute("inkscape:dataloss", saved_dataloss);
             }
-            sp_document_set_undo_sensitive(doc, saved);
+                       SPDocumentUndo::set_undo_sensitive(doc, saved);
             doc->change_uri_and_hrefs(saved_uri);
         }
         doc->setModifiedSinceSave(saved_modified);
@@ -317,13 +317,13 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension,
 
     // If it is an unofficial save, set the modified attributes back to what they were.
     if ( !official) {
-        bool const saved = sp_document_get_undo_sensitive(doc);
-        sp_document_set_undo_sensitive(doc, false);
+        bool const saved = SPDocumentUndo::get_undo_sensitive(doc);
+               SPDocumentUndo::set_undo_sensitive(doc, false);
         {
             store_file_extension_in_prefs (saved_output_extension, save_method);
             repr->setAttribute("inkscape:dataloss", saved_dataloss);
         }
-        sp_document_set_undo_sensitive(doc, saved);
+               SPDocumentUndo::set_undo_sensitive(doc, saved);
         doc->setModifiedSinceSave(saved_modified);
 
         g_free(saved_output_extension);
index 6b162c79978f404dde2ba936fdba45437f133c93..2344c67f211e012fbcc458b6aa937a00da857964 100644 (file)
@@ -560,7 +560,7 @@ sp_file_vacuum()
 
     unsigned int diff = doc->vacuum_document ();
 
-    sp_document_done(doc, SP_VERB_FILE_VACUUM,
+    SPDocumentUndo::done(doc, SP_VERB_FILE_VACUUM,
                      _("Vacuum &lt;defs&gt;"));
 
     SPDesktop *dt = SP_ACTIVE_DESKTOP;
@@ -1064,7 +1064,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri,
         }
 
         doc->doUnref();
-        sp_document_done(in_doc, SP_VERB_FILE_IMPORT,
+        SPDocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT,
                          _("Import"));
 
     } else {
index 019cbbb0294c54c184bf92bcabffc8501de49039..696efd3e37adfad486e9fd673fb96795e2ec8d32 100644 (file)
@@ -1119,7 +1119,7 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even
 
     g_free(trace_px);
     
-    sp_document_done(document, SP_VERB_CONTEXT_PAINTBUCKET, _("Fill bounded area"));
+    SPDocumentUndo::done(document, SP_VERB_CONTEXT_PAINTBUCKET, _("Fill bounded area"));
 }
 
 static gint sp_flood_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEvent *event)
@@ -1139,7 +1139,7 @@ static gint sp_flood_context_item_handler(SPEventContext *event_context, SPItem
             Inkscape::XML::Node *pathRepr = SP_OBJECT_REPR(item);
             /* Set style */
             sp_desktop_apply_style_tool (desktop, pathRepr, "/tools/paintbucket", false);
-            sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PAINTBUCKET, _("Set style on object"));
+            SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PAINTBUCKET, _("Set style on object"));
             ret = TRUE;
         }
         break;
@@ -1278,7 +1278,7 @@ static void sp_flood_finish(SPFloodContext *rc)
         sp_canvas_end_forced_full_redraws(desktop->canvas);
 
         sp_desktop_selection(desktop)->set(rc->item);
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PAINTBUCKET,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PAINTBUCKET,
                         _("Fill bounded area"));
 
         rc->item = NULL;
index 6d6ea87617f2780e36397b4ad776826ec498cd34..2e6544b637a975162e2401cf6eb6f287ce7bf89e 100644 (file)
@@ -386,7 +386,7 @@ sp_gradient_context_add_stops_between_selected_stops (SPGradientContext *rc)
     }
 
     if (g_slist_length(these_stops) > 0 && doc) {
-        sp_document_done (doc, SP_VERB_CONTEXT_GRADIENT, _("Add gradient stop"));
+        SPDocumentUndo::done (doc, SP_VERB_CONTEXT_GRADIENT, _("Add gradient stop"));
         drag->updateDraggers();
         // so that it does not automatically update draggers in idle loop, as this would deselect
         drag->local_change = true;
@@ -454,7 +454,7 @@ sp_gradient_simplify(SPGradientContext *rc, double tolerance)
     }
 
     if (g_slist_length(todel) > 0) {
-        sp_document_done (doc, SP_VERB_CONTEXT_GRADIENT, _("Simplify gradient"));
+        SPDocumentUndo::done (doc, SP_VERB_CONTEXT_GRADIENT, _("Simplify gradient"));
         drag->local_change = true;
         drag->updateDraggers();
         drag->selectByCoords(coords);
@@ -478,7 +478,7 @@ sp_gradient_context_add_stop_near_point (SPGradientContext *rc, SPItem *item,  G
 
     ec->get_drag()->addStopNearPoint (item, mouse_p, tolerance/desktop->current_zoom());
 
-    sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
+    SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
                       _("Add gradient stop"));
 
     ec->get_drag()->updateDraggers();
@@ -530,7 +530,7 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                     sp_gradient_reset_to_userspace(priv, item);
                 }
 
-                sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
+                SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
                                   _("Create default gradient"));
             }
             ret = TRUE;
@@ -812,7 +812,7 @@ sp_gradient_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                     }
                 }
                 // we did an undoable action
-                sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
+                SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
                                   _("Invert gradient"));
                 ret = TRUE;
             }
@@ -924,7 +924,7 @@ static void sp_gradient_drag(SPGradientContext &rc, Geom::Point const pt, guint
                                    -1, // ignore number (though it is always 1)
                                    fill_or_stroke, 99999, 99999, etime);
         }
-        // We did an undoable action, but sp_document_done will be called by the knot when released
+        // We did an undoable action, but SPDocumentUndo::done will be called by the knot when released
 
         // status text; we do not track coords because this branch is run once, not all the time
         // during drag
index 6306278c584b08c689408c21687b9bd4c768e16c..5fb490b8b87b219ea07679257f2329c14fec0336 100644 (file)
@@ -588,7 +588,7 @@ gr_knot_moved_handler(SPKnot *knot, Geom::Point const &ppointer, guint state, gp
                 d_new->updateKnotShape ();
                 d_new->updateTip ();
                 d_new->updateDependencies(true);
-                sp_document_done (sp_desktop_document (d_new->parent->desktop), SP_VERB_CONTEXT_GRADIENT,
+                SPDocumentUndo::done (sp_desktop_document (d_new->parent->desktop), SP_VERB_CONTEXT_GRADIENT,
                                   _("Merge gradient handles"));
                 return;
             }
@@ -887,7 +887,7 @@ gr_knot_ungrabbed_handler (SPKnot *knot, unsigned int state, gpointer data)
     dragger->updateDependencies(true);
 
     // we did an undoable action
-    sp_document_done (sp_desktop_document (dragger->parent->desktop), SP_VERB_CONTEXT_GRADIENT,
+    SPDocumentUndo::done (sp_desktop_document (dragger->parent->desktop), SP_VERB_CONTEXT_GRADIENT,
                       _("Move gradient handle"));
 }
 
@@ -940,7 +940,7 @@ gr_knot_clicked_handler(SPKnot */*knot*/, guint state, gpointer data)
             }
 
             SP_OBJECT_REPR(gradient)->removeChild(SP_OBJECT_REPR(stop));
-            sp_document_done (SP_OBJECT_DOCUMENT (gradient), SP_VERB_CONTEXT_GRADIENT,
+            SPDocumentUndo::done (SP_OBJECT_DOCUMENT (gradient), SP_VERB_CONTEXT_GRADIENT,
                       _("Delete gradient stop"));
         }
     } else {
@@ -1817,7 +1817,7 @@ GrDrag::selected_move (double x, double y, bool write_repr, bool scale_radial)
 
     if (write_repr && did) {
         // we did an undoable action
-        sp_document_maybe_done (sp_desktop_document (desktop), "grmoveh", SP_VERB_CONTEXT_GRADIENT,
+        SPDocumentUndo::maybe_done (sp_desktop_document (desktop), "grmoveh", SP_VERB_CONTEXT_GRADIENT,
                                 _("Move gradient handle(s)"));
         return;
     }
@@ -1853,7 +1853,7 @@ GrDrag::selected_move (double x, double y, bool write_repr, bool scale_radial)
 
         if (write_repr && did) {
             // we did an undoable action
-            sp_document_maybe_done (sp_desktop_document (desktop), "grmovem", SP_VERB_CONTEXT_GRADIENT,
+            SPDocumentUndo::maybe_done (sp_desktop_document (desktop), "grmovem", SP_VERB_CONTEXT_GRADIENT,
                                     _("Move gradient mid stop(s)"));
         }
     }
@@ -2142,7 +2142,7 @@ GrDrag::deleteSelected (bool just_one)
     }
 
     if (document) {
-        sp_document_done ( document, SP_VERB_CONTEXT_GRADIENT, _("Delete gradient stop(s)") );
+        SPDocumentUndo::done ( document, SP_VERB_CONTEXT_GRADIENT, _("Delete gradient stop(s)") );
     }
 }
 
index bdec992919cc2478448a93b77e9846c3f465b53d..a535ed1bd722dcab0d244f5791b1f0860d7a9e49 100644 (file)
@@ -1249,7 +1249,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
                     sp_desktop_apply_css_recursive( item, css, true );
                     item->updateRepr();
 
-                    sp_document_done( doc , SP_VERB_NONE,
+                    SPDocumentUndo::done( doc , SP_VERB_NONE,
                                       _("Drop color"));
 
                     if ( srgbProf ) {
@@ -1289,7 +1289,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
                 if (desktop->event_context && desktop->event_context->get_drag()) {
                     consumed = desktop->event_context->get_drag()->dropColor(item, colorspec, button_dt);
                     if (consumed) {
-                        sp_document_done( doc , SP_VERB_NONE, _("Drop color on gradient"));
+                        SPDocumentUndo::done( doc , SP_VERB_NONE, _("Drop color on gradient"));
                         desktop->event_context->get_drag()->updateDraggers();
                     }
                 }
@@ -1297,7 +1297,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
                 //if (!consumed && tools_active(desktop, TOOLS_TEXT)) {
                 //    consumed = sp_text_context_drop_color(c, button_doc);
                 //    if (consumed) {
-                //        sp_document_done( doc , SP_VERB_NONE, _("Drop color on gradient stop"));
+                //        SPDocumentUndo::done( doc , SP_VERB_NONE, _("Drop color on gradient stop"));
                 //    }
                 //}
 
@@ -1335,7 +1335,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
                     sp_desktop_apply_css_recursive( item, css, true );
                     item->updateRepr();
 
-                    sp_document_done( doc , SP_VERB_NONE,
+                    SPDocumentUndo::done( doc , SP_VERB_NONE,
                                       _("Drop color"));
                 }
             }
@@ -1399,7 +1399,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
                 if (desktop->event_context && desktop->event_context->get_drag()) {
                     consumed = desktop->event_context->get_drag()->dropColor(item, colorspec.c_str(), button_dt);
                     if (consumed) {
-                        sp_document_done( doc , SP_VERB_NONE, _("Drop color on gradient"));
+                        SPDocumentUndo::done( doc , SP_VERB_NONE, _("Drop color on gradient"));
                         desktop->event_context->get_drag()->updateDraggers();
                     }
                 }
@@ -1438,7 +1438,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
                     sp_desktop_apply_css_recursive( item, css, true );
                     item->updateRepr();
 
-                    sp_document_done( doc , SP_VERB_NONE,
+                    SPDocumentUndo::done( doc , SP_VERB_NONE,
                                       _("Drop color"));
                 }
             }
@@ -1490,7 +1490,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
             }
 
             Inkscape::GC::release(newgroup);
-            sp_document_done(doc, SP_VERB_NONE,
+            SPDocumentUndo::done(doc, SP_VERB_NONE,
                              _("Drop SVG"));
             break;
         }
@@ -1524,7 +1524,7 @@ sp_ui_drag_data_received(GtkWidget *widget,
 
             ext->set_param_optiongroup("link", save ? "embed" : "link");
             ext->set_gui(true);
-            sp_document_done( doc , SP_VERB_NONE,
+            SPDocumentUndo::done( doc , SP_VERB_NONE,
                               _("Drop bitmap image"));
             break;
         }
index 10672e0481404092c672e5608e30bb46fdb34cce..95a9ec1482b675614228b1c0bc2291aa0a597ae6 100644 (file)
@@ -427,7 +427,7 @@ static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot
                                 g_signal_emit(knot,
                                               knot_signals[UNGRABBED], 0,
                                               event->button.state);
-                                sp_document_undo(sp_desktop_document(knot->desktop));
+                                SPDocumentUndo::undo(sp_desktop_document(knot->desktop));
                                 knot->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Node or handle drag canceled."));
                                 transform_escaped = true;
                                 consumed = TRUE;
index af11d5acb0e2e01ef8c4d147b0d59067d6472056..89f57da978b7f2a360153f17593dc750ea0b0a27 100644 (file)
@@ -146,7 +146,7 @@ KnotHolder::knot_clicked_handler(SPKnot *knot, guint state)
     }
 
     // for drag, this is done by ungrabbed_handler, but for click we must do it here
-    sp_document_done(SP_OBJECT_DOCUMENT(item), object_verb,
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(item), object_verb,
                      _("Change handle"));
 }
 
@@ -225,7 +225,7 @@ KnotHolder::knot_ungrabbed_handler(SPKnot */*knot*/)
                 object_verb = SP_VERB_SELECTION_DYNAMIC_OFFSET;
         }
 
-        sp_document_done(SP_OBJECT_DOCUMENT (object), object_verb,
+        SPDocumentUndo::done(SP_OBJECT_DOCUMENT (object), object_verb,
                          _("Move handle"));
     }
 }
index b8e9b8cf9609bd6d858d9eea25a579a6d6c92e22..a2476a098425575b97219792544c588c8611530a 100644 (file)
@@ -636,7 +636,7 @@ KnotHolderEntityCrossingSwitcher::knot_click(guint state)
             //std::cout<<"crossing set to"<<lpe->crossing_points[s].sign<<".\n";
         }
         lpe->crossing_points_vector.param_set_and_write_new_value(lpe->crossing_points.to_vector());
-        sp_document_done(lpe->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, /// @todo Is this the right verb?
+        SPDocumentUndo::done(lpe->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, /// @todo Is this the right verb?
                  _("Change knot crossing"));
 
         // FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating.
index e662f7d95c01585bb2a8b1dda3dfb0e5846c99c3..af4f84f597dba88b25e6cf6a2ea7845cd6abf55d 100644 (file)
@@ -414,7 +414,7 @@ PathParam::on_paste_button_click()
     Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
     Glib::ustring svgd = cm->getPathParameter(SP_ACTIVE_DESKTOP);
     paste_param_path(svgd.data());
-    sp_document_done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+    SPDocumentUndo::done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                      _("Paste path parameter"));
 }
 
@@ -446,7 +446,7 @@ PathParam::on_link_button_click()
         // check if linking to object to which LPE is applied (maybe delegated to PathReference
 
         param_write_to_repr(pathid.c_str());
-        sp_document_done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+        SPDocumentUndo::done(param_effect->getSPDoc(), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                          _("Link path parameter to path"));
     }
 }
index c44ab5bc616e3c64e26e2558f27a467b59478bfd..daa9ae5951c66b628c5fc2ae3813c7632f50904a 100644 (file)
@@ -162,7 +162,7 @@ sp_selected_path_combine(SPDesktop *desktop)
         // move to the position of the topmost, reduced by the number of deleted items
         repr->setPosition(position > 0 ? position : 0);
 
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_COMBINE, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_COMBINE, 
                          _("Combine"));
 
         selection->set(repr);
@@ -272,7 +272,7 @@ sp_selected_path_break_apart(SPDesktop *desktop)
     desktop->clearWaitingCursor();
 
     if (did) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_BREAK_APART, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_BREAK_APART, 
                          _("Break apart"));
     } else {
         sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No path(s)</b> to break apart in the selection."));
@@ -314,7 +314,7 @@ sp_selected_path_to_curves(SPDesktop *desktop, bool interactive)
     if (interactive) {
         desktop->clearWaitingCursor();
         if (did) {
-            sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_TO_CURVE, 
+            SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_OBJECT_TO_CURVE, 
                              _("Object to path"));
         } else {
             sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No objects</b> to convert to path in the selection."));
@@ -627,7 +627,7 @@ sp_selected_path_reverse(SPDesktop *desktop)
     desktop->clearWaitingCursor();
 
     if (did) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_REVERSE,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_REVERSE,
                          _("Reverse path"));
     } else {
         sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No paths</b> to reverse in the selection."));
index d9839c556b02bda0b175a6230e02c483775b2d6f..817bb97d7b4126c82ca3b48d9787a7390280fa3a 100644 (file)
@@ -341,7 +341,7 @@ persp3d_toggle_VP (Persp3D *persp, Proj::Axis axis, bool set_undo) {
     persp3d_update_box_reprs (persp);
     SP_OBJECT(persp)->updateRepr(SP_OBJECT_WRITE_EXT);
     if (set_undo) {
-        sp_document_done(sp_desktop_document(inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
+        SPDocumentUndo::done(sp_desktop_document(inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
                          _("Toggle vanishing point"));
     }
 }
@@ -352,7 +352,7 @@ persp3d_toggle_VPs (std::list<Persp3D *> p, Proj::Axis axis) {
     for (std::list<Persp3D *>::iterator i = p.begin(); i != p.end(); ++i) {
         persp3d_toggle_VP((*i), axis, false);
     }
-    sp_document_done(sp_desktop_document(inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
+    SPDocumentUndo::done(sp_desktop_document(inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
                      _("Toggle multiple vanishing points"));
 }
 
index b232a340ae6d4608c590cc591333f4a05a658dd1..69a9bc2f069a71ce146874be74d35b7dd5180f52 100644 (file)
@@ -545,7 +545,7 @@ static void sp_rect_finish(SPRectContext *rc)
         sp_canvas_end_forced_full_redraws(desktop->canvas);
 
         sp_desktop_selection(desktop)->set(rc->item);
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT,
                          _("Create rectangle"));
 
         rc->item = NULL;
@@ -571,7 +571,7 @@ static void sp_rect_cancel(SPRectContext *rc)
 
     sp_canvas_end_forced_full_redraws(desktop->canvas);
 
-    sp_document_cancel(sp_desktop_document(desktop));
+    SPDocumentUndo::cancel(sp_desktop_document(desktop));
 }
 
 
index db25d3fad06518d7042d3736a4b1d3f39ca1647a..215436f38099563068b0e91c917e9cacf25dffb0 100644 (file)
@@ -222,7 +222,7 @@ sp_select_context_abort(SPEventContext *event_context)
             if (sc->item) {
                 // only undo if the item is still valid
                 if (SP_OBJECT_DOCUMENT( SP_OBJECT(sc->item))) {
-                    sp_document_undo(sp_desktop_document(desktop));
+                    SPDocumentUndo::undo(sp_desktop_document(desktop));
                 }
 
                 sp_object_unref( SP_OBJECT(sc->item), NULL);
@@ -230,7 +230,7 @@ sp_select_context_abort(SPEventContext *event_context)
                 // NOTE:  This is a workaround to a bug.
                 // When the ctrl key is held, sc->item is not defined
                 // so in this case (only), we skip the object doc check
-                sp_document_undo(sp_desktop_document(desktop));
+                SPDocumentUndo::undo(sp_desktop_document(desktop));
             }
             sc->item = NULL;
 
index 223fcee33c3d2a11f2b9bd0a8533f1f969b4682a..066b86ddf74fb2071a5b84e4c025ac11c5f82c82 100644 (file)
@@ -300,7 +300,7 @@ void sp_selection_delete(SPDesktop *desktop)
 
     if (tools_isactive(desktop, TOOLS_TEXT))
         if (sp_text_delete_selection(desktop->event_context)) {
-            sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+            SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                              _("Delete text"));
             return;
         }
@@ -326,7 +326,7 @@ void sp_selection_delete(SPDesktop *desktop)
      */
     tools_switch( desktop, tools_active( desktop ) );
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DELETE,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_DELETE,
                      _("Delete"));
 }
 
@@ -421,7 +421,7 @@ void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone)
 
 
     if ( !suppressDone ) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE,
                          _("Duplicate"));
     }
 
@@ -446,7 +446,7 @@ void sp_edit_clear_all(SPDesktop *dt)
         items = g_slist_remove(items, items->data);
     }
 
-    sp_document_done(doc, SP_VERB_EDIT_CLEAR_ALL,
+    SPDocumentUndo::done(doc, SP_VERB_EDIT_CLEAR_ALL,
                      _("Delete all"));
 }
 
@@ -647,7 +647,7 @@ void sp_selection_group(SPDesktop *desktop)
 
     sp_selection_group_impl(p, group, xml_doc, doc);
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_GROUP,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_GROUP,
                      _("Group"));
 
     selection->set(group);
@@ -708,7 +708,7 @@ void sp_selection_ungroup(SPDesktop *desktop)
 
     g_slist_free(items);
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_UNGROUP,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_UNGROUP,
                      _("Ungroup"));
 }
 
@@ -843,7 +843,7 @@ sp_selection_raise(SPDesktop *desktop)
         g_slist_free(rev);
     }
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_RAISE,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_RAISE,
                      //TRANSLATORS: only translate "string" in "context|string".
                      // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
                      // "Raise" means "to raise an object" in the undo history
@@ -881,7 +881,7 @@ void sp_selection_raise_to_top(SPDesktop *desktop)
 
     g_slist_free(rl);
 
-    sp_document_done(document, SP_VERB_SELECTION_TO_FRONT,
+    SPDocumentUndo::done(document, SP_VERB_SELECTION_TO_FRONT,
                      _("Raise to top"));
 }
 
@@ -944,7 +944,7 @@ sp_selection_lower(SPDesktop *desktop)
         g_slist_free(rev);
     }
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_LOWER,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_LOWER,
                      _("Lower"));
 }
 
@@ -991,21 +991,21 @@ void sp_selection_lower_to_bottom(SPDesktop *desktop)
 
     g_slist_free(rl);
 
-    sp_document_done(document, SP_VERB_SELECTION_TO_BACK,
+    SPDocumentUndo::done(document, SP_VERB_SELECTION_TO_BACK,
                      _("Lower to bottom"));
 }
 
 void
 sp_undo(SPDesktop *desktop, SPDocument *)
 {
-        if (!sp_document_undo(sp_desktop_document(desktop)))
+        if (!SPDocumentUndo::undo(sp_desktop_document(desktop)))
             desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to undo."));
 }
 
 void
 sp_redo(SPDesktop *desktop, SPDocument *)
 {
-        if (!sp_document_redo(sp_desktop_document(desktop)))
+        if (!SPDocumentUndo::redo(sp_desktop_document(desktop)))
             desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to redo."));
 }
 
@@ -1066,7 +1066,7 @@ void sp_selection_paste(SPDesktop *desktop, bool in_place)
 {
     Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
     if (cm->paste(desktop, in_place)) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE, _("Paste"));
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE, _("Paste"));
     }
 }
 
@@ -1074,7 +1074,7 @@ void sp_selection_paste_style(SPDesktop *desktop)
 {
     Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
     if (cm->pasteStyle(desktop)) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_STYLE, _("Paste style"));
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_STYLE, _("Paste style"));
     }
 }
 
@@ -1083,7 +1083,7 @@ void sp_selection_paste_livepatheffect(SPDesktop *desktop)
 {
     Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
     if (cm->pastePathEffect(desktop)) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_LIVEPATHEFFECT,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_LIVEPATHEFFECT,
                          _("Paste live path effect"));
     }
 }
@@ -1116,7 +1116,7 @@ void sp_selection_remove_livepatheffect(SPDesktop *desktop)
 
     }
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT,
                      _("Remove live path effect"));
 }
 
@@ -1137,7 +1137,7 @@ void sp_selection_remove_filter(SPDesktop *desktop)
     sp_desktop_set_style(desktop, css);
     sp_repr_css_attr_unref(css);
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_REMOVE_FILTER,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_REMOVE_FILTER,
                      _("Remove filter"));
 }
 
@@ -1146,7 +1146,7 @@ void sp_selection_paste_size(SPDesktop *desktop, bool apply_x, bool apply_y)
 {
     Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
     if (cm->pasteSize(desktop, false, apply_x, apply_y)) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_SIZE,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_SIZE,
                          _("Paste size"));
     }
 }
@@ -1155,7 +1155,7 @@ void sp_selection_paste_size_separately(SPDesktop *desktop, bool apply_x, bool a
 {
     Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get();
     if (cm->pasteSize(desktop, true, apply_x, apply_y)) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_SIZE_SEPARATELY,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_PASTE_SIZE_SEPARATELY,
                          _("Paste size separately"));
     }
 }
@@ -1191,7 +1191,7 @@ void sp_selection_to_next_layer(SPDesktop *dt, bool suppressDone)
         if (temp_clip) g_slist_free(temp_clip);
         if (next) dt->setCurrentLayer(next);
         if ( !suppressDone ) {
-            sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_MOVE_TO_NEXT,
+            SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_MOVE_TO_NEXT,
                              _("Raise to next layer"));
         }
     } else {
@@ -1236,7 +1236,7 @@ void sp_selection_to_prev_layer(SPDesktop *dt, bool suppressDone)
         if (temp_clip) g_slist_free(temp_clip);
         if (next) dt->setCurrentLayer(next);
         if ( !suppressDone ) {
-            sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_MOVE_TO_PREV,
+            SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_MOVE_TO_PREV,
                              _("Lower to previous layer"));
         }
     } else {
@@ -1452,7 +1452,7 @@ void sp_selection_remove_transform(SPDesktop *desktop)
         l = l->next;
     }
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_FLATTEN,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_OBJECT_FLATTEN,
                      _("Remove transform"));
 }
 
@@ -1554,7 +1554,7 @@ void sp_selection_rotate_90(SPDesktop *desktop, bool ccw)
         sp_item_rotate_rel(item, rot_90);
     }
 
-    sp_document_done(sp_desktop_document(desktop),
+    SPDocumentUndo::done(sp_desktop_document(desktop),
                      ccw ? SP_VERB_OBJECT_ROTATE_90_CCW : SP_VERB_OBJECT_ROTATE_90_CW,
                      ccw ? _("Rotate 90&#176; CCW") : _("Rotate 90&#176; CW"));
 }
@@ -1572,7 +1572,7 @@ sp_selection_rotate(Inkscape::Selection *selection, gdouble const angle_degrees)
 
     sp_selection_rotate_relative(selection, *center, angle_degrees);
 
-    sp_document_maybe_done(sp_desktop_document(selection->desktop()),
+    SPDocumentUndo::maybe_done(sp_desktop_document(selection->desktop()),
                            ( ( angle_degrees > 0 )
                              ? "selector:rotate:ccw"
                              : "selector:rotate:cw" ),
@@ -1619,7 +1619,7 @@ sp_selection_rotate_screen(Inkscape::Selection *selection, gdouble angle)
 
     sp_selection_rotate_relative(selection, *center, zangle);
 
-    sp_document_maybe_done(sp_desktop_document(selection->desktop()),
+    SPDocumentUndo::maybe_done(sp_desktop_document(selection->desktop()),
                            ( (angle > 0)
                              ? "selector:rotate:ccw"
                              : "selector:rotate:cw" ),
@@ -1649,7 +1649,7 @@ sp_selection_scale(Inkscape::Selection *selection, gdouble grow)
     double const times = 1.0 + grow / max_len;
     sp_selection_scale_relative(selection, center, Geom::Scale(times, times));
 
-    sp_document_maybe_done(sp_desktop_document(selection->desktop()),
+    SPDocumentUndo::maybe_done(sp_desktop_document(selection->desktop()),
                            ( (grow > 0)
                              ? "selector:scale:larger"
                              : "selector:scale:smaller" ),
@@ -1678,7 +1678,7 @@ sp_selection_scale_times(Inkscape::Selection *selection, gdouble times)
 
     Geom::Point const center(sel_bbox->midpoint());
     sp_selection_scale_relative(selection, center, Geom::Scale(times, times));
-    sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_CONTEXT_SELECT,
+    SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_CONTEXT_SELECT,
                      _("Scale by whole factor"));
 }
 
@@ -1693,13 +1693,13 @@ sp_selection_move(SPDesktop *desktop, gdouble dx, gdouble dy)
     sp_selection_move_relative(selection, dx, dy);
 
     if (dx == 0) {
-        sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT,
                                _("Move vertically"));
     } else if (dy == 0) {
-        sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT,
                                _("Move horizontally"));
     } else {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT,
                          _("Move"));
     }
 }
@@ -1719,13 +1719,13 @@ sp_selection_move_screen(SPDesktop *desktop, gdouble dx, gdouble dy)
     sp_selection_move_relative(selection, zdx, zdy);
 
     if (dx == 0) {
-        sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT,
                                _("Move vertically by pixels"));
     } else if (dy == 0) {
-        sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT,
                                _("Move horizontally by pixels"));
     } else {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT,
                          _("Move"));
     }
 }
@@ -2055,7 +2055,7 @@ sp_selection_clone(SPDesktop *desktop)
 
     // TRANSLATORS: only translate "string" in "context|string".
     // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_CLONE,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_CLONE,
                      Q_("action|Clone"));
 
     selection->setReprList(newsel);
@@ -2105,7 +2105,7 @@ sp_selection_relink(SPDesktop *desktop)
     if (!relinked) {
         desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("<b>No clones to relink</b> in the selection."));
     } else {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNLINK_CLONE,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_UNLINK_CLONE,
                          _("Relink clone"));
     }
 }
@@ -2172,7 +2172,7 @@ sp_selection_unlink(SPDesktop *desktop)
         desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("<b>No clones to unlink</b> in the selection."));
     }
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNLINK_CLONE,
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_UNLINK_CLONE,
                      _("Unlink clone"));
 }
 
@@ -2328,7 +2328,7 @@ void sp_selection_to_marker(SPDesktop *desktop, bool apply)
 
     g_slist_free(items);
 
-    sp_document_done(doc, SP_VERB_EDIT_SELECTION_2_MARKER,
+    SPDocumentUndo::done(doc, SP_VERB_EDIT_SELECTION_2_MARKER,
                      _("Objects to marker"));
 }
 
@@ -2369,7 +2369,7 @@ void sp_selection_to_guides(SPDesktop *desktop)
         sp_selection_to_guides_recursive(SP_ITEM(i->data), deleteitem, wholegroups);
     }
 
-    sp_document_done(doc, SP_VERB_EDIT_SELECTION_2_GUIDES, _("Objects to guides"));
+    SPDocumentUndo::done(doc, SP_VERB_EDIT_SELECTION_2_GUIDES, _("Objects to guides"));
 }
 
 void
@@ -2472,7 +2472,7 @@ sp_selection_tile(SPDesktop *desktop, bool apply)
 
     g_slist_free(items);
 
-    sp_document_done(doc, SP_VERB_EDIT_TILE,
+    SPDocumentUndo::done(doc, SP_VERB_EDIT_TILE,
                      _("Objects to pattern"));
 }
 
@@ -2544,7 +2544,7 @@ sp_selection_untile(SPDesktop *desktop)
     if (!did) {
         desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("<b>No pattern fills</b> in the selection."));
     } else {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNTILE,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_UNTILE,
                          _("Pattern to objects"));
         selection->setList(new_select);
     }
@@ -2807,7 +2807,7 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop)
         gdk_pixbuf_unref(pb);
 
         // Complete undoable transaction
-        sp_document_done(document, SP_VERB_SELECTION_CREATE_BITMAP,
+        SPDocumentUndo::done(document, SP_VERB_SELECTION_CREATE_BITMAP,
                          _("Create bitmap"));
     }
 
@@ -3024,9 +3024,9 @@ sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_to_la
     g_slist_free(items_to_select);
 
     if (apply_clip_path)
-        sp_document_done(doc, SP_VERB_OBJECT_SET_CLIPPATH, _("Set clipping path"));
+        SPDocumentUndo::done(doc, SP_VERB_OBJECT_SET_CLIPPATH, _("Set clipping path"));
     else
-        sp_document_done(doc, SP_VERB_OBJECT_SET_MASK, _("Set mask"));
+        SPDocumentUndo::done(doc, SP_VERB_OBJECT_SET_MASK, _("Set mask"));
 }
 
 void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) {
@@ -3150,9 +3150,9 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) {
     g_slist_free(items_to_select);
 
     if (apply_clip_path)
-        sp_document_done(doc, SP_VERB_OBJECT_UNSET_CLIPPATH, _("Release clipping path"));
+        SPDocumentUndo::done(doc, SP_VERB_OBJECT_UNSET_CLIPPATH, _("Release clipping path"));
     else
-        sp_document_done(doc, SP_VERB_OBJECT_UNSET_MASK, _("Release mask"));
+        SPDocumentUndo::done(doc, SP_VERB_OBJECT_UNSET_MASK, _("Release mask"));
 }
 
 /**
@@ -3189,7 +3189,7 @@ void
 verb_fit_canvas_to_selection(SPDesktop *const desktop)
 {
     if (fit_canvas_to_selection(desktop)) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_FIT_CANVAS_TO_SELECTION,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_FIT_CANVAS_TO_SELECTION,
                          _("Fit Page to Selection"));
     }
 }
@@ -3218,7 +3218,7 @@ void
 verb_fit_canvas_to_drawing(SPDesktop *desktop)
 {
     if (fit_canvas_to_drawing(sp_desktop_document(desktop))) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_FIT_CANVAS_TO_DRAWING,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_FIT_CANVAS_TO_DRAWING,
                          _("Fit Page to Drawing"));
     }
 }
@@ -3239,7 +3239,7 @@ void fit_canvas_to_selection_or_drawing(SPDesktop *desktop) {
                            ? fit_canvas_to_drawing(doc, true)
                            : fit_canvas_to_selection(desktop, true) );
     if (changed) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_FIT_CANVAS_TO_SELECTION_OR_DRAWING,
                          _("Fit Page to Selection or Drawing"));
     }
 };
index 89799246cec882a8b5fa32e3e38c605e246d0317..627620a6007e7c0363a41830a29e9c4c4d798ebf 100644 (file)
@@ -520,16 +520,16 @@ void Inkscape::SelTrans::ungrab()
         _items_centers.clear();
 
         if (_current_relative_affine.isTranslation()) {
-            sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+            SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                              _("Move"));
         } else if (_current_relative_affine.without_translation().isScale()) {
-            sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+            SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                              _("Scale"));
         } else if (_current_relative_affine.without_translation().isRotation()) {
-            sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+            SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                              _("Rotate"));
         } else {
-            sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+            SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                              _("Skew"));
         }
 
@@ -541,7 +541,7 @@ void Inkscape::SelTrans::ungrab()
                 SPItem *it = (SPItem*)SP_OBJECT(l->data);
                 SP_OBJECT(it)->updateRepr();
             }
-            sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+            SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                             _("Set center"));
         }
 
@@ -616,7 +616,7 @@ void Inkscape::SelTrans::stamp()
             Inkscape::GC::release(copy_repr);
             l = l->next;
         }
-        sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                          _("Stamp"));
     }
 
@@ -805,7 +805,7 @@ void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHa
                     _center_is_set = false;  // center has changed
                     _updateHandles();
                 }
-                sp_document_done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
+                SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT,
                                         _("Reset center"));
             }
             break;
index 5bf7f664cee8b6c676a3bbd54f16c2e55b0d6f2e..877e7397925f70e5be09ecf0d195a19da3016027 100644 (file)
@@ -284,7 +284,7 @@ sp_guide_create_guides_around_page(SPDesktop *dt) {
 
     sp_guide_pt_pairs_to_guides(dt, pts);
 
-    sp_document_done (doc, SP_VERB_NONE, _("Guides Around Page"));
+    SPDocumentUndo::done (doc, SP_VERB_NONE, _("Guides Around Page"));
 }
 
 void sp_guide_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler)
index c178cfdd49796cd86d29e0ec5e07e72f4829f392..1d38771bc4ed8b29b759ac22f8dba1b48fb35b07 100644 (file)
@@ -497,7 +497,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done)
     }
 
     if (do_done)
-        sp_document_done (doc, SP_VERB_NONE, _("Ungroup"));
+        SPDocumentUndo::done (doc, SP_VERB_NONE, _("Ungroup"));
 }
 
 /*
index 44c3bf62013c42d84cffbf5f6facce5f66a42c01..8c750f347066e9e32fea0a8759b930d3fb6eea40 100644 (file)
@@ -204,7 +204,7 @@ static void sp_namedview_generate_old_grid(SPNamedView * /*nv*/, SPDocument *doc
         repr->setAttribute("gridempopacity", NULL);
         repr->setAttribute("gridempspacing", NULL);
 
-//        sp_document_done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid from pre0.46 grid settings"));
+//        SPDocumentUndo::done(doc, SP_VERB_DIALOG_NAMEDVIEW, _("Create new grid from pre0.46 grid settings"));
     }
 }
 
@@ -812,8 +812,8 @@ void sp_namedview_document_from_window(SPDesktop *desktop)
     Geom::Rect const r = desktop->get_display_area();
 
     // saving window geometry is not undoable
-    bool saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop));
-    sp_document_set_undo_sensitive(sp_desktop_document(desktop), false);
+    bool saved = SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop));
+       SPDocumentUndo::set_undo_sensitive(sp_desktop_document(desktop), false);
 
     sp_repr_set_svg_double(view, "inkscape:zoom", desktop->current_zoom());
     sp_repr_set_svg_double(view, "inkscape:cx", r.midpoint()[Geom::X]);
@@ -832,7 +832,7 @@ void sp_namedview_document_from_window(SPDesktop *desktop)
     view->setAttribute("inkscape:current-layer", desktop->currentLayer()->getId());
 
     // restore undoability
-    sp_document_set_undo_sensitive(sp_desktop_document(desktop), saved);
+       SPDocumentUndo::set_undo_sensitive(sp_desktop_document(desktop), saved);
 }
 
 void SPNamedView::hide(SPDesktop const *desktop)
@@ -889,10 +889,10 @@ void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr)
         v = !v;
     }
 
-    bool saved = sp_document_get_undo_sensitive(doc);
-    sp_document_set_undo_sensitive(doc, false);
+    bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+       SPDocumentUndo::set_undo_sensitive(doc, false);
     sp_repr_set_boolean(repr, "showguides", v);
-    sp_document_set_undo_sensitive(doc, saved);
+       SPDocumentUndo::set_undo_sensitive(doc, saved);
 
     doc->setModifiedSinceSave();
 }
@@ -904,10 +904,10 @@ void sp_namedview_show_grids(SPNamedView * namedview, bool show, bool dirty_docu
     SPDocument *doc = SP_OBJECT_DOCUMENT (namedview);
     Inkscape::XML::Node *repr = SP_OBJECT_REPR(namedview);
 
-    bool saved = sp_document_get_undo_sensitive(doc);
-    sp_document_set_undo_sensitive(doc, false);
+    bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+       SPDocumentUndo::set_undo_sensitive(doc, false);
     sp_repr_set_boolean(repr, "showgrid", namedview->grids_visible);
-    sp_document_set_undo_sensitive(doc, saved);
+       SPDocumentUndo::set_undo_sensitive(doc, saved);
 
     /* we don't want the document to get dirty on startup; that's when
        we call this function with dirty_document = false */
index 2eb8daf8986de280ae76644e2cbdc78383ede4ea..3d1cd4b211e6f62d2318513f44aeadbaa3d570ee 100644 (file)
@@ -480,7 +480,7 @@ sp_spiral_finish(SPSpiralContext *sc)
         sp_canvas_end_forced_full_redraws(desktop->canvas);
 
         sp_desktop_selection(desktop)->set(sc->item);
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL,
                          _("Create spiral"));
 
         sc->item = NULL;
@@ -506,7 +506,7 @@ static void sp_spiral_cancel(SPSpiralContext *sc)
 
     sp_canvas_end_forced_full_redraws(desktop->canvas);
 
-    sp_document_cancel(sp_desktop_document(desktop));
+    SPDocumentUndo::cancel(sp_desktop_document(desktop));
 }
 
 /*
index db5ceaa8ef4dcd05ba52d80227ee2327f04b5817..5073382e5d129db56a2e7e1f9fdae110c6887f97 100644 (file)
@@ -419,7 +419,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb
         {
             SP_OBJECT(l->data)->deleteObject();
         }
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, 
                          description);
         selection->clear();
 
@@ -593,7 +593,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb
     if (desc) g_free(desc);
 
     if (verb != SP_VERB_NONE) {
-        sp_document_done(sp_desktop_document(desktop), verb, description);
+        SPDocumentUndo::done(sp_desktop_document(desktop), verb, description);
     }
 
     delete res;
@@ -1216,7 +1216,7 @@ sp_selected_path_outline(SPDesktop *desktop)
     }
 
     if (did) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_OUTLINE, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_OUTLINE, 
                          _("Convert stroke to path"));
     } else {
         // TRANSLATORS: "to outline" means "to convert stroke to path"
@@ -1419,7 +1419,7 @@ sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool updat
     {
         // pas vraiment de points sur le resultat
         // donc il ne reste rien
-        sp_document_done(sp_desktop_document(desktop), 
+        SPDocumentUndo::done(sp_desktop_document(desktop), 
                          (updating ? SP_VERB_SELECTION_LINKED_OFFSET 
                           : SP_VERB_SELECTION_DYNAMIC_OFFSET),
                          (updating ? _("Create linked offset")
@@ -1488,7 +1488,7 @@ sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool updat
         selection->set(nitem);
     }
 
-    sp_document_done(sp_desktop_document(desktop), 
+    SPDocumentUndo::done(sp_desktop_document(desktop), 
                      (updating ? SP_VERB_SELECTION_LINKED_OFFSET 
                       : SP_VERB_SELECTION_DYNAMIC_OFFSET),
                      (updating ? _("Create linked offset")
@@ -1733,7 +1733,7 @@ sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset)
     }
 
     if (did) {
-        sp_document_done(sp_desktop_document(desktop), 
+        SPDocumentUndo::done(sp_desktop_document(desktop), 
                          (expand ? SP_VERB_SELECTION_OFFSET : SP_VERB_SELECTION_INSET),
                          (expand ? _("Outset path") : _("Inset path")));
     } else {
@@ -1993,7 +1993,7 @@ sp_selected_path_simplify_selection(SPDesktop *desktop, float threshold, bool ju
                                                         breakableAngles, true);
 
     if (didSomething)
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_SIMPLIFY, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_SIMPLIFY, 
                          _("Simplify"));
     else
         desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("<b>No paths</b> to simplify in the selection."));
index 8c30f5a5a39fda298742d36562173b66ed7d3250..ebdf56673a062fecc0f775c6271c20f3b107e771 100644 (file)
@@ -877,15 +877,15 @@ case GDK_SCROLL_LEFT:
             tc->has_dilated = false;
             switch (tc->mode) {
                 case SPRAY_MODE_COPY:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_SPRAY, _("Spray with copies"));
                     break;
                 case SPRAY_MODE_CLONE:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_SPRAY, _("Spray with clones"));
                     break;
                 case SPRAY_MODE_SINGLE_PATH:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_SPRAY, _("Spray in single path"));
                     break;
             }
index 69d711722d9f4d5d83251aa8a2bd83b8a771beb6..2761c573aa319debce0627afc0f44218f66f97ff 100644 (file)
@@ -499,7 +499,7 @@ sp_star_finish (SPStarContext * sc)
         sp_canvas_end_forced_full_redraws(desktop->canvas);
 
         sp_desktop_selection(desktop)->set(sc->item);
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
                          _("Create star"));
 
         sc->item = NULL;
@@ -525,7 +525,7 @@ static void sp_star_cancel(SPStarContext *sc)
 
     sp_canvas_end_forced_full_redraws(desktop->canvas);
 
-    sp_document_cancel(sp_desktop_document(desktop));
+    SPDocumentUndo::cancel(sp_desktop_document(desktop));
 }
 
 /*
index 2cc6e30d99d1af36fd429e7c095ceb941a23a4b5..5af97165e8004165da727093cee7dc2469ad647a 100644 (file)
@@ -188,7 +188,7 @@ text_put_on_path()
     SP_OBJECT_REPR(text)->setAttribute("x", NULL);
     SP_OBJECT_REPR(text)->setAttribute("y", NULL);
 
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, 
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, 
                      _("Put text on path"));
     g_slist_free(text_reprs);
 }
@@ -225,7 +225,7 @@ text_remove_from_path()
     if (!did) {
         sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No texts-on-paths</b> in the selection."));
     } else {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, 
                          _("Remove text from path"));
         selection->setList(g_slist_copy((GSList *) selection->itemList())); // reselect to update statusbar description
     }
@@ -289,7 +289,7 @@ text_remove_all_kerns()
     if (!did) {
         sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select <b>text(s)</b> to remove kerns from."));
     } else {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, 
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, 
                          _("Remove manual kerns"));
     }
 }
@@ -377,7 +377,7 @@ text_flow_into_shape()
 
     SP_OBJECT(text)->deleteObject (true);
 
-    sp_document_done(doc, SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT,
                      _("Flow text into shape"));
 
     sp_desktop_selection(desktop)->set(SP_ITEM(root_object));
@@ -473,7 +473,7 @@ text_unflow ()
     g_slist_free (old_objs);
     g_slist_free (new_objs);
 
-    sp_document_done(doc, SP_VERB_CONTEXT_TEXT, 
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT, 
                      _("Unflow flowed text"));
 }
 
@@ -530,7 +530,7 @@ flowtext_to_text()
     g_slist_free(items);
 
     if (did) {
-        sp_document_done(sp_desktop_document(desktop), 
+        SPDocumentUndo::done(sp_desktop_document(desktop), 
                          SP_VERB_OBJECT_FLOWTEXT_TO_TEXT,
                          _("Convert flowed text to text"));
         selection->setReprList(reprs);        
index b37c973115069d08e295f2141a268c2eda084544..cfde60a0da1910fdce64f1bfcdf59a036facc3fe 100644 (file)
@@ -501,7 +501,7 @@ sp_text_context_setup_text(SPTextContext *tc)
     text_item->transform = SP_ITEM(ec->desktop->currentLayer())->i2doc_affine().inverse();
 
     text_item->updateRepr();
-    sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
                      _("Create text"));
 }
 
@@ -540,7 +540,7 @@ insert_uni_char(SPTextContext *const tc)
         tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, u);
         sp_text_context_update_cursor(tc);
         sp_text_context_update_text_selection(tc);
-        sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM,
+        SPDocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM,
                          _("Insert Unicode character"));
     }
 }
@@ -699,7 +699,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                         sp_desktop_apply_style_tool(desktop, SP_OBJECT_REPR(ft), "/tools/text", true);
                         sp_desktop_selection(desktop)->set(ft);
                         desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created."));
-                        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                          _("Create flowed text"));
                     } else {
                         desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("The frame is <b>too small</b> for the current font size. Flowed text not created."));
@@ -839,7 +839,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                     sp_text_context_update_cursor(tc);
                                     sp_text_context_update_text_selection(tc);
                                     desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No-break space"));
-                                    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                                      _("Insert no-break space"));
                                     return TRUE;
                                 }
@@ -876,7 +876,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                         sp_repr_css_set_property(css, "font-weight", "normal");
                                     sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
                                     sp_repr_css_attr_unref(css);
-                                    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                                      _("Make bold"));
                                     sp_text_context_update_cursor(tc);
                                     sp_text_context_update_text_selection(tc);
@@ -894,7 +894,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                         sp_repr_css_set_property(css, "font-style", "italic");
                                     sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
                                     sp_repr_css_attr_unref(css);
-                                    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                                      _("Make italic"));
                                     sp_text_context_update_cursor(tc);
                                     sp_text_context_update_text_selection(tc);
@@ -933,7 +933,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
 
                                 sp_text_context_update_cursor(tc);
                                 sp_text_context_update_text_selection(tc);
-                                sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                                SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                                  _("New line"));
                                 return TRUE;
                             }
@@ -967,7 +967,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
 
                                     sp_text_context_update_cursor(tc);
                                     sp_text_context_update_text_selection(tc);
-                                    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                                      _("Backspace"));
                                 }
                                 return TRUE;
@@ -998,7 +998,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
 
                                     sp_text_context_update_cursor(tc);
                                     sp_text_context_update_text_selection(tc);
-                                    sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+                                    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
                                                      _("Delete"));
                                 }
                                 return TRUE;
@@ -1015,7 +1015,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                             sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, Geom::Point(mul*-1, 0));
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
-                                        sp_document_maybe_done(sp_desktop_document(desktop), "kern:left", SP_VERB_CONTEXT_TEXT,
+                                        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "kern:left", SP_VERB_CONTEXT_TEXT,
                                                                _("Kern to the left"));
                                     } else {
                                         if (MOD__CTRL)
@@ -1040,7 +1040,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                             sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, Geom::Point(mul*1, 0));
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
-                                        sp_document_maybe_done(sp_desktop_document(desktop), "kern:right", SP_VERB_CONTEXT_TEXT,
+                                        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "kern:right", SP_VERB_CONTEXT_TEXT,
                                                                _("Kern to the right"));
                                     } else {
                                         if (MOD__CTRL)
@@ -1065,7 +1065,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                             sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, Geom::Point(0, mul*-1));
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
-                                        sp_document_maybe_done(sp_desktop_document(desktop), "kern:up", SP_VERB_CONTEXT_TEXT,
+                                        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "kern:up", SP_VERB_CONTEXT_TEXT,
                                                                _("Kern up"));
 
                                     } else {
@@ -1091,7 +1091,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                             sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, Geom::Point(0, mul*1));
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
-                                        sp_document_maybe_done(sp_desktop_document(desktop), "kern:down", SP_VERB_CONTEXT_TEXT,
+                                        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "kern:down", SP_VERB_CONTEXT_TEXT,
                                                                _("Kern down"));
 
                                     } else {
@@ -1168,7 +1168,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                         } else {
                                             sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, -90);
                                         }
-                                        sp_document_maybe_done(sp_desktop_document(desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT,
+                                        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT,
                                                                _("Rotate counterclockwise"));
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
@@ -1189,7 +1189,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                         } else {
                                             sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, 90);
                                         }
-                                        sp_document_maybe_done(sp_desktop_document(desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT,
+                                        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT,
                                                                 _("Rotate clockwise"));
                                         sp_text_context_update_cursor(tc);
                                         sp_text_context_update_text_selection(tc);
@@ -1206,7 +1206,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                                 sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, -10);
                                             else
                                                 sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, -1);
-                                            sp_document_maybe_done(sp_desktop_document(desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT,
+                                            SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT,
                                                                     _("Contract line spacing"));
 
                                         } else {
@@ -1214,7 +1214,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                                 sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, -10);
                                             else
                                                 sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, -1);
-                                            sp_document_maybe_done(sp_desktop_document(desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT,
+                                            SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT,
                                                                     _("Contract letter spacing"));
 
                                         }
@@ -1233,7 +1233,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                                 sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, 10);
                                             else
                                                 sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, 1);
-                                            sp_document_maybe_done(sp_desktop_document(desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT,
+                                            SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT,
                                                                     _("Expand line spacing"));
 
                                         } else {
@@ -1241,7 +1241,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                                                 sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, 10);
                                             else
                                                 sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, desktop, 1);
-                                            sp_document_maybe_done(sp_desktop_document(desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT,
+                                            SPDocumentUndo::maybe_done(sp_desktop_document(desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT,
                                                                     _("Expand letter spacing"));
 
                                         }
@@ -1371,7 +1371,7 @@ sp_text_paste_inline(SPEventContext *ec)
                 tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start);
                 begin = end + 1;
             }
-            sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
+            SPDocumentUndo::done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
                              _("Paste text"));
 
             return true;
@@ -1496,7 +1496,7 @@ sp_text_context_style_set(SPCSSAttr const *css, SPTextContext *tc)
         return false;    // will get picked up by the parent and applied to the whole text object
 
     sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css);
-    sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
                      _("Set text style"));
     sp_text_context_update_cursor(tc);
     sp_text_context_update_text_selection(tc);
@@ -1704,7 +1704,7 @@ sp_text_context_forget_text(SPTextContext *tc)
         // the XML editor
         if ( text_repr && sp_repr_parent(text_repr) ) {
             sp_repr_unparent(text_repr);
-            sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
+            SPDocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
                      _("Remove empty text"));
         }
     }
@@ -1737,7 +1737,7 @@ sptc_commit(GtkIMContext */*imc*/, gchar *string, SPTextContext *tc)
     sp_text_context_update_cursor(tc);
     sp_text_context_update_text_selection(tc);
 
-    sp_document_done(SP_OBJECT_DOCUMENT(tc->text), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(tc->text), SP_VERB_CONTEXT_TEXT,
                      _("Type text"));
 }
 
index a2b0cd7909412091ebfd92bd14b1f8af7537386d..e9bc48372bae322633da67aa3eb39fb31bbc6bf4 100644 (file)
@@ -568,7 +568,7 @@ void Tracer::traceThread()
         }
 
     //## inform the document, so we can undo
-    sp_document_done(doc, SP_VERB_SELECTION_TRACE, _("Trace bitmap"));
+    SPDocumentUndo::done(doc, SP_VERB_SELECTION_TRACE, _("Trace bitmap"));
 
     engine = NULL;
 
index e77d2d465ff3ffc89b563a1b473a894b92ff2cc4..cd6ff325ad87a4cb35ed0181294da9f89f067e0b 100644 (file)
@@ -1258,55 +1258,55 @@ sp_tweak_context_root_handler(SPEventContext *event_context,
             tc->has_dilated = false;
             switch (tc->mode) {
                 case TWEAK_MODE_MOVE:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Move tweak"));
                     break;
                 case TWEAK_MODE_MOVE_IN_OUT:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Move in/out tweak"));
                     break;
                 case TWEAK_MODE_MOVE_JITTER:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Move jitter tweak"));
                     break;
                 case TWEAK_MODE_SCALE:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Scale tweak"));
                     break;
                 case TWEAK_MODE_ROTATE:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Rotate tweak"));
                     break;
                 case TWEAK_MODE_MORELESS:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Duplicate/delete tweak"));
                     break;
                 case TWEAK_MODE_PUSH:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Push path tweak"));
                     break;
                 case TWEAK_MODE_SHRINK_GROW:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Shrink/grow path tweak"));
                     break;
                 case TWEAK_MODE_ATTRACT_REPEL:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Attract/repel path tweak"));
                     break;
                 case TWEAK_MODE_ROUGHEN:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Roughen path tweak"));
                     break;
                 case TWEAK_MODE_COLORPAINT:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Color paint tweak"));
                     break;
                 case TWEAK_MODE_COLORJITTER:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Color jitter tweak"));
                     break;
                 case TWEAK_MODE_BLUR:
-                    sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
+                    SPDocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(tc)->desktop),
                                      SP_VERB_CONTEXT_TWEAK, _("Blur tweak"));
                     break;
             }
index 98ad9dc7bf8110d02b97857b2b34127fd82e8744..1ffbf1fd09f095dc3e33a4a62e482f776c8cc895 100644 (file)
@@ -284,7 +284,7 @@ sp_item_create_link(GtkMenuItem *menuitem, SPItem *item)
     Inkscape::GC::release(repr);
     Inkscape::GC::release(child);
 
-    sp_document_done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE,
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE,
                      _("Create link"));
 
     sp_object_attributes_dialog(object, "SPAnchor");
index 0b47f42ab038bc36b70cfdc0e4ee7220596aafd8..af1671b04e5ffac9ef6f0a44d5f7f2b5a3deed9d 100644 (file)
@@ -233,7 +233,7 @@ private :
         prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
         if (changed) {
-            sp_document_done ( sp_desktop_document (desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+            SPDocumentUndo::done ( sp_desktop_document (desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                                _("Align"));
         }
 
@@ -392,7 +392,7 @@ private :
         prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
         if (changed) {
-            sp_document_done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+            SPDocumentUndo::done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                                _("Distribute"));
         }
     }
@@ -505,7 +505,7 @@ private :
         // restore compensation setting
         prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
-        sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+        SPDocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                          _("Remove overlaps"));
     }
 };
@@ -536,7 +536,7 @@ private :
         // restore compensation setting
         prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
-        sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+        SPDocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                          _("Arrange connector network"));
     }
 };
@@ -567,7 +567,7 @@ private :
         // restore compensation setting
         prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
-        sp_document_done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+        SPDocumentUndo::done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                           _("Unclump"));
     }
 };
@@ -638,7 +638,7 @@ private :
         // restore compensation setting
         prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
-        sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+        SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                           _("Randomize positions"));
     }
 };
@@ -737,7 +737,7 @@ private :
             }
 
             if (changed) {
-                sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+                SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                                   _("Distribute text baselines"));
             }
 
@@ -760,7 +760,7 @@ private :
             }
 
             if (changed) {
-                sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
+                SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE,
                                   _("Align text baselines"));
             }
         }
index cb6cfbbbe05b7bd01a156ab21ebc871a13e44f1a..a8445c66c35cb79f0b321d064c0f8ae9986e5fcd 100644 (file)
@@ -486,7 +486,7 @@ void ColorItem::_updatePreviews()
                     str = 0;
 
                     if ( bruteForce( document, rroot, paletteName, def.getR(), def.getG(), def.getB() ) ) {
-                        sp_document_done( document , SP_VERB_DIALOG_SWATCHES,
+                        SPDocumentUndo::done( document , SP_VERB_DIALOG_SWATCHES,
                                           _("Change color definition"));
                     }
                 }
@@ -720,7 +720,7 @@ void ColorItem::buttonClicked(bool secondary)
         sp_desktop_set_style(desktop, css);
         sp_repr_css_attr_unref(css);
 
-        sp_document_done( sp_desktop_document(desktop), SP_VERB_DIALOG_SWATCHES, descr.c_str() );
+        SPDocumentUndo::done( sp_desktop_document(desktop), SP_VERB_DIALOG_SWATCHES, descr.c_str() );
     }
 }
 
index 970c609af28e94cbabea540d4f8cafe489526328..2fe353533dd67b35105a25240c91979370958700 100644 (file)
@@ -450,7 +450,7 @@ DocumentProperties::linkSelectedProfile()
         //Inkscape::GC::release(defsRepr);
 
         // inform the document, so we can undo
-        sp_document_done(desktop->doc(), SP_VERB_EDIT_LINK_COLOR_PROFILE, _("Link Color Profile"));
+        SPDocumentUndo::done(desktop->doc(), SP_VERB_EDIT_LINK_COLOR_PROFILE, _("Link Color Profile"));
 
         populate_linked_profiles_box();
     }
@@ -523,7 +523,7 @@ void DocumentProperties::removeSelectedProfile(){
         Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj);
         if (!name.compare(prof->name)){
             sp_repr_unparent(obj->repr);
-            sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile"));
+            SPDocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile"));
         }
         current = g_slist_next(current);
     }
@@ -668,7 +668,7 @@ void DocumentProperties::addExternalScript(){
         xml_doc->root()->addChild(scriptRepr, NULL);
 
         // inform the document, so we can undo
-        sp_document_done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script..."));
+        SPDocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script..."));
 
         populate_external_scripts_box();
     }
@@ -692,7 +692,7 @@ void DocumentProperties::removeExternalScript(){
         SPScript* script = (SPScript*) obj;
         if (name == script->xlinkhref){
             sp_repr_unparent(obj->repr);
-            sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script"));
+            SPDocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script"));
         }
         current = g_slist_next(current);
     }
@@ -985,7 +985,7 @@ DocumentProperties::onRemoveGrid()
         // delete the grid that corresponds with the selected tab
         // when the grid is deleted from SVG, the SPNamedview handler automatically deletes the object, so found_grid becomes an invalid pointer!
         found_grid->repr->parent()->removeChild(found_grid->repr);
-        sp_document_done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid"));
+        SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid"));
     }
 }
 
index 7baf2d71fb417a9b8a662b7921d68ea2d9812b6c..3a80c4ba814fa8d2fef8c29009e153a370e8a75d 100644 (file)
@@ -1032,7 +1032,7 @@ private:
                     Inkscape::GC::release(repr);
                 }
 
-                sp_document_done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("New light source"));
+                SPDocumentUndo::done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("New light source"));
                 update();
             }
 
@@ -1215,7 +1215,7 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa
     if(iter) {
         SPFilter* filter = (*iter)[_columns.filter];
         filter->setLabel(text.c_str());
-        sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Rename filter"));
+        SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Rename filter"));
         if(iter)
             (*iter)[_columns.label] = text;
     }
@@ -1251,7 +1251,7 @@ void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustri
         }
 
         update_selection(sel);
-        sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS,  _("Apply filter"));
+        SPDocumentUndo::done(doc, SP_VERB_DIALOG_FILTER_EFFECTS,  _("Apply filter"));
     }
 }
 
@@ -1327,7 +1327,7 @@ void FilterEffectsDialog::FilterModifier::add_filter()
 
     select_filter(filter);
 
-    sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter"));
 }
 
 void FilterEffectsDialog::FilterModifier::remove_filter()
@@ -1338,7 +1338,7 @@ void FilterEffectsDialog::FilterModifier::remove_filter()
         SPDocument* doc = filter->document;
         sp_repr_unparent(filter->repr);
 
-        sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter"));
+        SPDocumentUndo::done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter"));
 
         update_filters();
     }
@@ -1353,7 +1353,7 @@ void FilterEffectsDialog::FilterModifier::duplicate_filter()
         repr = repr->duplicate(repr->document());
         parent->appendChild(repr);
 
-        sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter"));
+        SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter"));
 
         update_filters();
     }
@@ -1543,7 +1543,7 @@ void FilterEffectsDialog::PrimitiveList::remove_selected()
 
         sp_repr_unparent(prim->repr);
 
-        sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_FILTER_EFFECTS,
+        SPDocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_FILTER_EFFECTS,
                          _("Remove filter primitive"));
 
         update();
@@ -1915,7 +1915,7 @@ bool FilterEffectsDialog::PrimitiveList::on_button_release_event(GdkEventButton*
                         // If input is null, delete it
                         if(!in_val) {
                             sp_repr_unparent(o->repr);
-                            sp_document_done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS,
+                            SPDocumentUndo::done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS,
                                              _("Remove merge node"));
                             (*get_selection()->get_selected())[_columns.primitive] = prim;
                         }
@@ -2032,7 +2032,7 @@ void FilterEffectsDialog::PrimitiveList::on_drag_end(const Glib::RefPtr<Gdk::Dra
 
     filter->requestModified(SP_OBJECT_MODIFIED_FLAG);
 
-    sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Reorder filter primitive"));
+    SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Reorder filter primitive"));
 }
 
 // If a connection is dragged towards the top or bottom of the list, the list should scroll to follow.
@@ -2263,7 +2263,7 @@ void FilterEffectsDialog::add_primitive()
 
         _primitive_list.select(prim);
 
-        sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter primitive"));
+        SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter primitive"));
     }
 }
 
@@ -2359,7 +2359,7 @@ void FilterEffectsDialog::duplicate_primitive()
         repr = SP_OBJECT_REPR(origprim)->duplicate(SP_OBJECT_REPR(origprim)->document());
         SP_OBJECT_REPR(filter)->appendChild(repr);
 
-        sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter primitive"));
+        SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter primitive"));
 
         _primitive_list.update();
     }
@@ -2411,7 +2411,7 @@ void FilterEffectsDialog::set_attr(SPObject* o, const SPAttributeEnum attr, cons
 
             Glib::ustring undokey = "filtereffects:";
             undokey += name;
-            sp_document_maybe_done(filter->document, undokey.c_str(), SP_VERB_DIALOG_FILTER_EFFECTS,
+            SPDocumentUndo::maybe_done(filter->document, undokey.c_str(), SP_VERB_DIALOG_FILTER_EFFECTS,
                                    _("Set filter primitive attribute"));
         }
 
index 8ed502aae04d8e1cdffb9965233f99ff8a3681c6..8193b43845ba573f932008aacd9969b7c62108fd 100644 (file)
@@ -28,7 +28,7 @@
 #include "glyphs.h"
 
 #include "desktop.h"
-#include "document.h" // for sp_document_done()
+#include "document.h" // for SPDocumentUndo::done()
 #include "libnrtype/font-instance.h"
 #include "sp-flowtext.h"
 #include "sp-text.h"
@@ -571,7 +571,7 @@ void GlyphsPanel::insertText()
             }
             combined += glyphs;
             sp_te_set_repr_text_multiline(textItem, combined.c_str());
-            sp_document_done(targetDesktop->doc(), SP_VERB_CONTEXT_TEXT, _("Append text"));
+            SPDocumentUndo::done(targetDesktop->doc(), SP_VERB_CONTEXT_TEXT, _("Append text"));
         }
     }
 }
index 3a7964ba250e47bdb5546191bd5c0ae3fc9e9a64..9c3422167facc854e6b4821e9d8cd434b2173b02 100644 (file)
@@ -108,7 +108,7 @@ void GuidelinePropertiesDialog::_onApply()
 
     sp_guide_moveto(*_guide, newpos, true);
 
-    sp_document_done(SP_OBJECT_DOCUMENT(_guide), SP_VERB_NONE, 
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(_guide), SP_VERB_NONE, 
                      _("Set guide properties"));
 }
 
@@ -121,7 +121,7 @@ void GuidelinePropertiesDialog::_onDelete()
 {
     SPDocument *doc = SP_OBJECT_DOCUMENT(_guide);
     sp_guide_remove(_guide);
-    sp_document_done(doc, SP_VERB_NONE, 
+    SPDocumentUndo::done(doc, SP_VERB_NONE, 
                      _("Delete guide"));
 }
 
index ffa4642e77533f0c4327ee4d9fb0f1ffdfa2e64c..80c943e39baa865f128822d6a605e102138bd28a 100644 (file)
@@ -105,7 +105,7 @@ LayerPropertiesDialog::_apply()
     g_assert(_strategy != NULL);
 
     _strategy->perform(*this);
-    sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE,
+    SPDocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE,
                      _("Add layer"));
 
     _close();
@@ -188,7 +188,7 @@ void LayerPropertiesDialog::Rename::perform(LayerPropertiesDialog &dialog) {
                                          (gchar *)name.c_str(),
                                          FALSE
     );
-    sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, 
+    SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, 
                      _("Rename layer"));
     // TRANSLATORS: This means "The layer has been renamed"
     desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Renamed layer"));
index ff3a13ab2dd74d62e9ddb7806a4da8effffb495b..962d78df8d354e2fbbf9bb5ad37a0bdaa43444b9 100644 (file)
@@ -468,7 +468,7 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol )
                 row[_model->_colVisible] = newValue;
                 item->setHidden( !newValue  );
                 item->updateRepr();
-                sp_document_done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
+                SPDocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
                                   newValue? _("Unhide layer") : _("Hide layer"));
             }
             break;
@@ -479,7 +479,7 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol )
                 row[_model->_colLocked] = newValue;
                 item->setLocked( newValue );
                 item->updateRepr();
-                sp_document_done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
+                SPDocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS,
                                   newValue? _("Lock layer") : _("Unlock layer"));
             }
             break;
index 62ed4e63996da17a5bd47a436754afae036f4a28..d05790b3e66b291b999de709a67fc254695719f9 100644 (file)
@@ -372,7 +372,7 @@ LivePathEffectEditor::onApply()
 
             LivePathEffect::Effect::createAndApply(data->key.c_str(), doc, item);
 
-            sp_document_done(doc, SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+            SPDocumentUndo::done(doc, SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                      _("Create and apply path effect"));
 
             lpe_list_locked = false;
@@ -390,7 +390,7 @@ LivePathEffectEditor::onRemove()
         if ( item && SP_IS_LPE_ITEM(item) ) {
             sp_lpe_item_remove_current_path_effect(SP_LPE_ITEM(item), false);
 
-            sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+            SPDocumentUndo::done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                                _("Remove path effect") );
 
             effect_list_reload(SP_LPE_ITEM(item));
@@ -406,7 +406,7 @@ void LivePathEffectEditor::onUp()
         if ( item && SP_IS_LPE_ITEM(item) ) {
             sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item));
 
-            sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+            SPDocumentUndo::done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                                _("Move path effect up") );
 
             effect_list_reload(SP_LPE_ITEM(item));
@@ -422,7 +422,7 @@ void LivePathEffectEditor::onDown()
         if ( item && SP_IS_LPE_ITEM(item) ) {
             sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item));
 
-            sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+            SPDocumentUndo::done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                                _("Move path effect down") );
 
             effect_list_reload(SP_LPE_ITEM(item));
@@ -461,7 +461,7 @@ void LivePathEffectEditor::on_visibility_toggled( Glib::ustring const& str )
         /* FIXME: this explicit writing to SVG is wrong. The lpe_item should have a method to disable/enable an effect within its stack.
          * So one can call:  lpe_item->setActive(lpeobjref->lpeobject); */
         lpeobjref->lpeobject->get_lpe()->getRepr()->setAttribute("is_visible", newValue ? "true" : "false");
-        sp_document_done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
+        SPDocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT,
                           newValue ? _("Activate path effect") : _("Deactivate path effect"));
     }
 }
index 0e484c3f21143b078742b09d2fc980dd0c42fd6b..01560733f5a7b1eb40f7655fd359b11271d0fe65 100644 (file)
@@ -171,7 +171,7 @@ SessionPlaybackDialogImpl::_respCallback(int resp)
                        switch (result) {
                                case Gtk::RESPONSE_OK:
                                        this->_sm->clearDocument();
-                                       sp_document_done(sp_desktop_document(this->_desktop), SP_VERB_NONE, 
+                                       SPDocumentUndo::done(sp_desktop_document(this->_desktop), SP_VERB_NONE, 
                                                         /* TODO: annotate */ "session-player.cpp:186");
                                        this->_sm->loadSessionFile(sessionfiledlg.get_filename());
                                        this->_openfile.set_text(this->_sfp->filename());
index 7f41c4d6b7350225f889b8bdf03dc6946290fd8e..7c6ced5aa4eb371f8da7ae3a41252cfb8c508b14 100644 (file)
@@ -117,7 +117,7 @@ void SvgFontsDialog::AttrEntry::on_attr_changed(){
 
         Glib::ustring undokey = "svgfonts:";
         undokey += name;
-        sp_document_maybe_done(o->document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS,
+        SPDocumentUndo::maybe_done(o->document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS,
                                _("Set SVG Font attribute"));
     }
 
@@ -163,7 +163,7 @@ void SvgFontsDialog::on_kerning_value_changed(){
     if (!this->kerning_pair) return;
     SPDocument* document = sp_desktop_document(this->getDesktop());
 
-    //TODO: I am unsure whether this is the correct way of calling sp_document_maybe_done
+    //TODO: I am unsure whether this is the correct way of calling SPDocumentUndo::maybe_done
     Glib::ustring undokey = "svgfonts:hkern:k:";
     undokey += this->kerning_pair->u1->attribute_string();
     undokey += ":";
@@ -171,7 +171,7 @@ void SvgFontsDialog::on_kerning_value_changed(){
 
     //slider values increase from right to left so that they match the kerning pair preview
     this->kerning_pair->repr->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider.get_value()).c_str());
-    sp_document_maybe_done(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value"));
+    SPDocumentUndo::maybe_done(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value"));
 
     //populate_kerning_pairs_box();
     kerning_preview.redraw();
@@ -462,7 +462,7 @@ void SvgFontsDialog::add_glyph(){
     SPDocument* doc = sp_desktop_document(this->getDesktop());
     /* SPGlyph* glyph =*/ new_glyph(doc, get_selected_spfont(), count+1);
 
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph"));
 
     update_glyphs();
 }
@@ -506,7 +506,7 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){
         return;
     }
     glyph->repr->setAttribute("d", (char*) sp_svg_write_path (pathv));
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
 
     update_glyphs();
 }
@@ -548,7 +548,7 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){
     for (obj = get_selected_spfont()->children; obj; obj=obj->next){
         if (SP_IS_MISSING_GLYPH(obj)){
             obj->repr->setAttribute("d", (char*) sp_svg_write_path (pathv));
-            sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
+            SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves"));
         }
     }
 
@@ -567,7 +567,7 @@ void SvgFontsDialog::reset_missing_glyph_description(){
     for (obj = get_selected_spfont()->children; obj; obj=obj->next){
         if (SP_IS_MISSING_GLYPH(obj)){
             obj->repr->setAttribute("d", (char*) "M0,0h1000v1024h-1000z");
-            sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph"));
+            SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph"));
         }
     }
 
@@ -582,7 +582,7 @@ void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring&
     glyph->repr->setAttribute("glyph-name", str.c_str());
 
     SPDocument* doc = sp_desktop_document(this->getDesktop());
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name"));
 
     update_glyphs();
 }
@@ -595,7 +595,7 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin
     glyph->repr->setAttribute("unicode", str.c_str());
 
     SPDocument* doc = sp_desktop_document(this->getDesktop());
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode"));
 
     update_glyphs();
 }
@@ -605,7 +605,7 @@ void SvgFontsDialog::remove_selected_font(){
 
     sp_repr_unparent(font->repr);
     SPDocument* doc = sp_desktop_document(this->getDesktop());
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font"));
 
     update_fonts();
 }
@@ -620,7 +620,7 @@ void SvgFontsDialog::remove_selected_glyph(){
     sp_repr_unparent(glyph->repr);
 
     SPDocument* doc = sp_desktop_document(this->getDesktop());
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph"));
 
     update_glyphs();
 }
@@ -635,7 +635,7 @@ void SvgFontsDialog::remove_selected_kerning_pair(){
     sp_repr_unparent(pair->repr);
 
     SPDocument* doc = sp_desktop_document(this->getDesktop());
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair"));
 
     update_glyphs();
 }
@@ -723,7 +723,7 @@ void SvgFontsDialog::add_kerning_pair(){
     // get corresponding object
     this->kerning_pair = SP_HKERN( document->getObjectByRepr(repr) );
 
-    sp_document_done(document, SP_VERB_DIALOG_SVG_FONTS, _("Add kerning pair"));
+    SPDocumentUndo::done(document, SP_VERB_DIALOG_SVG_FONTS, _("Add kerning pair"));
 }
 
 Gtk::VBox* SvgFontsDialog::kerning_tab(){
@@ -816,7 +816,7 @@ void set_font_family(SPFont* font, char* str){
         }
     }
 
-    sp_document_done(font->document, SP_VERB_DIALOG_SVG_FONTS, _("Set font family"));
+    SPDocumentUndo::done(font->document, SP_VERB_DIALOG_SVG_FONTS, _("Set font family"));
 }
 
 void SvgFontsDialog::add_font(){
@@ -839,7 +839,7 @@ void SvgFontsDialog::add_font(){
     update_fonts();
 //    select_font(font);
 
-    sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add font"));
+    SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add font"));
 }
 
 SvgFontsDialog::SvgFontsDialog()
index d5d48a5285c23fe34ef44c963628df7e85729427..62682d6232f8d7afd4940a473eb7e946dc01fb1e 100644 (file)
@@ -184,7 +184,7 @@ void SwatchesPanelHook::convertGradient( GtkMenuItem * /*menuitem*/, gpointer us
                 if ( targetName == grad->getId() ) {
                     grad->repr->setAttribute("osb:paint", "solid"); // TODO make conditional
 
-                    sp_document_done(doc, SP_VERB_CONTEXT_GRADIENT,
+                    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_GRADIENT,
                                      _("Add gradient stop"));
 
                     handleGradientsChange(doc); // work-around for signal not being emitted
index 546fdd8f0482b5735116e9fda22e7483af72655b..cf29ed77fd50423b2a97674c4346244b49256e17 100644 (file)
@@ -344,7 +344,7 @@ g_print("\n row = %f     col = %f selection x= %f selection y = %f", total_row_h
              g_slist_free (current_row);
     }
 
-    sp_document_done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE,
+    SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE,
                       _("Arrange in a grid"));
 
 }
index f74c5d6e033f50cb8fcd19f4ab597cfc04d303a6..62f0f38aa18720df3956a40755ed690af2c179c8 100644 (file)
@@ -677,7 +677,7 @@ Transformation::applyPageMove(Inkscape::Selection *selection)
         }
     }
 
-    sp_document_done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM,
+    SPDocumentUndo::done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM,
                        _("Move"));
 }
 
@@ -734,7 +734,7 @@ Transformation::applyPageScale(Inkscape::Selection *selection)
         }
     }
 
-    sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+    SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
                      _("Scale"));
 }
 
@@ -756,7 +756,7 @@ Transformation::applyPageRotate(Inkscape::Selection *selection)
         }
     }
 
-    sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+    SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
                      _("Rotate"));
 }
 
@@ -815,7 +815,7 @@ Transformation::applyPageSkew(Inkscape::Selection *selection)
         }
     }
 
-    sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+    SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
                      _("Skew"));
 }
 
@@ -842,7 +842,7 @@ Transformation::applyPageTransform(Inkscape::Selection *selection)
         sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform
     }
 
-    sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+    SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
                      _("Edit transformation matrix"));
 }
 
index 8017af8031140b8253aca36474807434679f9279..9e092207211579e2a8fc694d24208046f71eaab9 100644 (file)
@@ -214,7 +214,7 @@ UndoHistory::_onListSelectionChange()
 
             _event_log->blockNotifications();
             for ( --last ; curr_event != last ; ++curr_event ) {
-                sp_document_redo(_document);
+                SPDocumentUndo::redo(_document);
             }
             _event_log->blockNotifications(false);
 
@@ -248,7 +248,7 @@ UndoHistory::_onListSelectionChange()
 
             while ( selected != last_selected ) {
 
-                sp_document_undo(_document);
+                SPDocumentUndo::undo(_document);
 
                 if ( last_selected->parent() &&
                      last_selected == last_selected->parent()->children().begin() )
@@ -273,7 +273,7 @@ UndoHistory::_onListSelectionChange()
 
             while ( selected != last_selected ) {
 
-                sp_document_redo(_document);
+                SPDocumentUndo::redo(_document);
 
                 if ( !last_selected->children().empty() ) {
                     _event_log->setCurrEventParent(last_selected);
@@ -317,10 +317,10 @@ UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::T
         EventLog::const_iterator last = curr_event_parent->children().end();
 
         _event_log->blockNotifications();
-        sp_document_redo(_document);
+        SPDocumentUndo::redo(_document);
 
         for ( --last ; curr_event != last ; ++curr_event ) {
-            sp_document_redo(_document);
+            SPDocumentUndo::redo(_document);
         }
         _event_log->blockNotifications(false);
 
index 2025a12d7b4826cc54f7de1d9306792eec78dabc..a455567e834ca2378f587ab7c1fc6966115bfd15 100644 (file)
@@ -662,9 +662,9 @@ void MultiPathManipulator::_commit(CommitEvent cps)
     _selection.signal_update.emit();
     invokeForAll(&PathManipulator::writeXML);
     if (key) {
-        sp_document_maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, reason);
+        SPDocumentUndo::maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, reason);
     } else {
-        sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason);
+        SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason);
     }
     signal_coords_changed.emit();
 }
@@ -673,7 +673,7 @@ void MultiPathManipulator::_commit(CommitEvent cps)
 void MultiPathManipulator::_done(gchar const *reason) {
     invokeForAll(&PathManipulator::update);
     invokeForAll(&PathManipulator::writeXML);
-    sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason);
+    SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason);
     signal_coords_changed.emit();
 }
 
index 8e37b2c8518904a523f1ddb80a2775f75240cb28..dec37cd1c58668db3e6bc5c1897694bdaaea0973 100644 (file)
@@ -1387,13 +1387,13 @@ void PathManipulator::_removeNodesFromSelection()
 void PathManipulator::_commit(Glib::ustring const &annotation)
 {
     writeXML();
-    sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, annotation.data());
+    SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, annotation.data());
 }
 
 void PathManipulator::_commit(Glib::ustring const &annotation, gchar const *key)
 {
     writeXML();
-    sp_document_maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE,
+    SPDocumentUndo::maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE,
             annotation.data());
 }
 
index 34cf1d5e35f72718ae2a6f12da676a1063f3c908..48dd596858d7941ad9539b362dbd47631f110276 100644 (file)
@@ -132,7 +132,7 @@ sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp)
     (ptr->_preview).setRgba32 (rgba);
 
     if (ptr->_undo && SP_ACTIVE_DESKTOP)
-        sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE,
+        SPDocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE,
                          /* TODO: annotate */ "color-picker.cpp:130");
 
     ptr->on_changed (rgba);
index e9f09f574c9deb5109f7967d3dd5cdcd05d06f81..cc38de24fb495e93f3573755c4b9331fbdc42a6d 100644 (file)
@@ -96,7 +96,7 @@ EntityLineEntry::on_changed()
     SPDocument *doc = SP_ACTIVE_DOCUMENT;
     Glib::ustring text = static_cast<Gtk::Entry*>(_packable)->get_text();
     if (rdf_set_work_entity (doc, _entity, text.c_str()))
-        sp_document_done (doc, SP_VERB_NONE, 
+        SPDocumentUndo::done (doc, SP_VERB_NONE, 
                           /* TODO: annotate */ "entity-entry.cpp:101");
     _wr->setUpdating (false);
 }
@@ -141,7 +141,7 @@ EntityMultiLineEntry::on_changed()
     Gtk::TextView *tv = static_cast<Gtk::TextView*>(s->get_child());
     Glib::ustring text = tv->get_buffer()->get_text();
     if (rdf_set_work_entity (doc, _entity, text.c_str()))
-        sp_document_done (doc, SP_VERB_NONE, 
+        SPDocumentUndo::done (doc, SP_VERB_NONE, 
                           /* TODO: annotate */ "entity-entry.cpp:146");
     _wr->setUpdating (false);
 }
index f25192b2a301605b979af42c051636ec1a299729..da096f25d628de2e6981b57e7df092a881e891b1 100644 (file)
@@ -583,7 +583,7 @@ void LayerSelector::_prepareLabelRenderer(
 void LayerSelector::_lockLayer(bool lock) {
     if ( _layer && SP_IS_ITEM(_layer) ) {
         SP_ITEM(_layer)->setLocked(lock);
-        sp_document_done(sp_desktop_document(_desktop), SP_VERB_NONE,
+        SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_NONE,
                          lock? _("Lock layer") : _("Unlock layer"));
     }
 }
@@ -591,7 +591,7 @@ void LayerSelector::_lockLayer(bool lock) {
 void LayerSelector::_hideLayer(bool hide) {
     if ( _layer && SP_IS_ITEM(_layer) ) {
         SP_ITEM(_layer)->setHidden(hide);
-        sp_document_done(sp_desktop_document(_desktop), SP_VERB_NONE,
+        SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_NONE,
                          hide? _("Hide layer") : _("Unhide layer"));
     }
 }
index a5f1d89be02b6ab48a6965c650270bef7e4dfd4e..a4a789840e710430d3bcb08cbc4ec81b8cc963bb 100644 (file)
@@ -64,7 +64,7 @@ LicenseItem::on_toggled()
 
     _wr.setUpdating (true);
     rdf_set_license (SP_ACTIVE_DOCUMENT, _lic->details ? _lic : 0);
-    sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, 
+    SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, 
                       /* TODO: annotate */ "licensor.cpp:65");
     _wr.setUpdating (false);
     static_cast<Gtk::Entry*>(_eep->_packable)->set_text (_lic->uri);
index bfc291bc02a3e69435a2219e31a2b9ffbaf02b03..f5e4657b13e719a23a6dd444737cb9013d284a47 100644 (file)
@@ -168,7 +168,7 @@ ObjectCompositeSettings::_blendBlurValueChanged()
                                      SP_OBJECT_STYLE_MODIFIED_FLAG ));
     }
 
-    sp_document_maybe_done (document, _blur_tag.c_str(), _verb_code,
+    SPDocumentUndo::maybe_done (document, _blur_tag.c_str(), _verb_code,
                             _("Change blur"));
 
     // resume interruptibility
@@ -208,7 +208,7 @@ ObjectCompositeSettings::_opacityValueChanged()
 
     sp_repr_css_attr_unref (css);
 
-    sp_document_maybe_done (sp_desktop_document (desktop), _opacity_tag.c_str(), _verb_code,
+    SPDocumentUndo::maybe_done (sp_desktop_document (desktop), _opacity_tag.c_str(), _verb_code,
                             _("Change opacity"));
 
     // resume interruptibility
index 1f70a26fd80f9176a48d9183b19341c6fa2fd63d..33adc85d0c5cb008d194057f27b23ef47873fbf0 100644 (file)
@@ -413,7 +413,7 @@ PageSizer::setDim (double w, double h, bool changeList)
         // changing the page size. The SVG's origin however is in the upper left corner, so we must compensate for this
         Geom::Translate const vert_offset(Geom::Point(0, (old_height - h)));
                SP_GROUP(SP_ROOT(doc->root))->translateChildItems(vert_offset);
-        sp_document_done (doc, SP_VERB_NONE, _("Set page size"));
+        SPDocumentUndo::done (doc, SP_VERB_NONE, _("Set page size"));
     }
 
     if ( w != h ) {
index db31d08d340288573c82cf06bf0ddb0251919dee..16422f1b2e1557e3acfc477f53c09875ab3ebdb4 100644 (file)
@@ -349,14 +349,14 @@ RegisteredColorPicker::on_changed (guint32 rgba)
 
     gchar c[32];
     sp_svg_write_color(c, sizeof(c), rgba);
-    bool saved = sp_document_get_undo_sensitive (local_doc);
-    sp_document_set_undo_sensitive (local_doc, false);
+    bool saved = SPDocumentUndo::get_undo_sensitive (local_doc);
+       SPDocumentUndo::set_undo_sensitive (local_doc, false);
     local_repr->setAttribute(_ckey.c_str(), c);
     sp_repr_set_css_double(local_repr, _akey.c_str(), (rgba & 0xff) / 255.0);
-    sp_document_set_undo_sensitive (local_doc, saved);
+       SPDocumentUndo::set_undo_sensitive (local_doc, saved);
 
     local_doc->setModifiedSinceSave();
-    sp_document_done (local_doc, SP_VERB_NONE,
+    SPDocumentUndo::done (local_doc, SP_VERB_NONE,
                       /* TODO: annotate */ "registered-widget.cpp: RegisteredColorPicker::on_changed");
 
     _wr->setUpdating (false);
index 7aefbb90e4005d4cf343050ef12104ef837b0f0c..dec8cd111f30e17ba51f927ad84da32ca6abea16 100644 (file)
@@ -104,16 +104,16 @@ protected:
             local_doc = sp_desktop_document(dt);
         }
 
-        bool saved = sp_document_get_undo_sensitive (local_doc);
-        sp_document_set_undo_sensitive (local_doc, false);
+        bool saved = SPDocumentUndo::get_undo_sensitive (local_doc);
+               SPDocumentUndo::set_undo_sensitive (local_doc, false);
         if (!write_undo) local_repr->setAttribute(_key.c_str(), svgstr);
-        sp_document_set_undo_sensitive (local_doc, saved);
+               SPDocumentUndo::set_undo_sensitive (local_doc, saved);
 
         local_doc->setModifiedSinceSave();
 
         if (write_undo) {
             local_repr->setAttribute(_key.c_str(), svgstr);
-            sp_document_done (local_doc, event_type, event_description);
+                       SPDocumentUndo::done (local_doc, event_type, event_description);
         }
     }
 
index 0afc0da3e642da4a6d532867c1b9a9ce933dfa1d..9fac481456d979702924d4e5d9e829df9bb1207b 100644 (file)
@@ -152,7 +152,7 @@ Ruler::on_button_release_event(GdkEventButton *evb)
             sp_repr_set_svg_double(repr, "position", guide_pos_dt);
             SP_OBJECT_REPR(_dt->namedview)->appendChild(repr);
             Inkscape::GC::release(repr);
-            sp_document_done(sp_desktop_document(_dt), SP_VERB_NONE, 
+            SPDocumentUndo::done(sp_desktop_document(_dt), SP_VERB_NONE, 
                              /* TODO: annotate */ "ruler.cpp:157");
         }
         _dt->set_coordinate_status(event_dt);
index a8f9f9c60d9ae9e1419d5384471321181721d2cf..9a94113eb461311e488ec732cc817e445dec3b05 100644 (file)
@@ -464,7 +464,7 @@ void SelectedStyle::dragDataReceived( GtkWidget */*widget*/,
                 sp_repr_css_set_property( css, (tracker->item == SS_FILL) ? "fill":"stroke", c );
                 sp_desktop_set_style( tracker->parent->_desktop, css );
                 sp_repr_css_attr_unref( css );
-                sp_document_done( sp_desktop_document(tracker->parent->_desktop) , SP_VERB_NONE,
+                SPDocumentUndo::done( sp_desktop_document(tracker->parent->_desktop) , SP_VERB_NONE,
                                   _("Drop color"));
             }
         }
@@ -477,7 +477,7 @@ void SelectedStyle::on_fill_remove() {
     sp_repr_css_set_property (css, "fill", "none");
     sp_desktop_set_style (_desktop, css, true, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Remove fill"));
 }
 
@@ -486,7 +486,7 @@ void SelectedStyle::on_stroke_remove() {
     sp_repr_css_set_property (css, "stroke", "none");
     sp_desktop_set_style (_desktop, css, true, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Remove stroke"));
 }
 
@@ -495,7 +495,7 @@ void SelectedStyle::on_fill_unset() {
     sp_repr_css_unset_property (css, "fill");
     sp_desktop_set_style (_desktop, css, true, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Unset fill"));
 }
 
@@ -511,7 +511,7 @@ void SelectedStyle::on_stroke_unset() {
     sp_repr_css_unset_property (css, "stroke-dasharray");
     sp_desktop_set_style (_desktop, css, true, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Unset stroke"));
 }
 
@@ -520,7 +520,7 @@ void SelectedStyle::on_fill_opaque() {
     sp_repr_css_set_property (css, "fill-opacity", "1");
     sp_desktop_set_style (_desktop, css, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Make fill opaque"));
 }
 
@@ -529,7 +529,7 @@ void SelectedStyle::on_stroke_opaque() {
     sp_repr_css_set_property (css, "stroke-opacity", "1");
     sp_desktop_set_style (_desktop, css, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Make fill opaque"));
 }
 
@@ -541,7 +541,7 @@ void SelectedStyle::on_fill_lastused() {
     sp_repr_css_set_property (css, "fill", c);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Apply last set color to fill"));
 }
 
@@ -553,7 +553,7 @@ void SelectedStyle::on_stroke_lastused() {
     sp_repr_css_set_property (css, "stroke", c);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Apply last set color to stroke"));
 }
 
@@ -564,7 +564,7 @@ void SelectedStyle::on_fill_lastselected() {
     sp_repr_css_set_property (css, "fill", c);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Apply last selected color to fill"));
 }
 
@@ -575,7 +575,7 @@ void SelectedStyle::on_stroke_lastselected() {
     sp_repr_css_set_property (css, "stroke", c);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Apply last selected color to stroke"));
 }
 
@@ -595,7 +595,7 @@ void SelectedStyle::on_fill_invert() {
     sp_repr_css_set_property (css, "fill", c);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Invert fill"));
 }
 
@@ -615,7 +615,7 @@ void SelectedStyle::on_stroke_invert() {
     sp_repr_css_set_property (css, "stroke", c);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Invert stroke"));
 }
 
@@ -627,7 +627,7 @@ void SelectedStyle::on_fill_white() {
     sp_repr_css_set_property (css, "fill-opacity", "1");
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("White fill"));
 }
 
@@ -639,7 +639,7 @@ void SelectedStyle::on_stroke_white() {
     sp_repr_css_set_property (css, "stroke-opacity", "1");
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("White stroke"));
 }
 
@@ -651,7 +651,7 @@ void SelectedStyle::on_fill_black() {
     sp_repr_css_set_property (css, "fill-opacity", "1.0");
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Black fill"));
 }
 
@@ -663,7 +663,7 @@ void SelectedStyle::on_stroke_black() {
     sp_repr_css_set_property (css, "stroke-opacity", "1.0");
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Black stroke"));
 }
 
@@ -706,7 +706,7 @@ void SelectedStyle::on_fill_paste() {
         sp_repr_css_set_property (css, "fill", text.c_str());
         sp_desktop_set_style (_desktop, css);
         sp_repr_css_attr_unref (css);
-        sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+        SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Paste fill"));
     }
 }
@@ -724,7 +724,7 @@ void SelectedStyle::on_stroke_paste() {
         sp_repr_css_set_property (css, "stroke", text.c_str());
         sp_desktop_set_style (_desktop, css);
         sp_repr_css_attr_unref (css);
-        sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+        SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Paste stroke"));
     }
 }
@@ -778,7 +778,7 @@ void SelectedStyle::on_fillstroke_swap() {
 
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Swap fill and stroke"));
 }
 
@@ -853,7 +853,7 @@ SelectedStyle::on_opacity_click(GdkEventButton *event)
         sp_repr_css_set_property (css, "opacity", opacity);
         sp_desktop_set_style (_desktop, css);
         sp_repr_css_attr_unref (css);
-        sp_document_done (sp_desktop_document (_desktop), SP_VERB_DIALOG_FILL_STROKE,
+        SPDocumentUndo::done (sp_desktop_document (_desktop), SP_VERB_DIALOG_FILL_STROKE,
                       _("Change opacity"));
         return true;
     }
@@ -888,7 +888,7 @@ void SelectedStyle::on_popup_preset(int i) {
     // FIXME: update dash patterns!
     sp_desktop_set_style (_desktop, css, true);
     sp_repr_css_attr_unref (css);
-    sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_SWATCHES,
+    SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_SWATCHES,
                       _("Change stroke width"));
 }
 
@@ -1147,7 +1147,7 @@ void SelectedStyle::on_opacity_changed () {
     sp_canvas_force_full_redraw_after_interruptions(sp_desktop_canvas(_desktop), 0);
     sp_desktop_set_style (_desktop, css);
     sp_repr_css_attr_unref (css);
-    sp_document_maybe_done (sp_desktop_document (_desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (_desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE,
                       _("Change opacity"));
     // resume interruptibility
     sp_canvas_end_forced_full_redraws(sp_desktop_canvas(_desktop));
@@ -1274,19 +1274,19 @@ RotateableSwatch::do_motion(double by, guint modifier) {
     if (modifier == 3) { // Alt, do nothing
 
     } else if (modifier == 2) { // saturation
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, (_("Adjust saturation")));
         double ch = hsl[1];
         parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>saturation</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, without modifiers to adjust hue"), ch - diff, ch, diff);
 
     } else if (modifier == 1) { // lightness
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, (_("Adjust lightness")));
         double ch = hsl[2];
         parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>lightness</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, without modifiers to adjust hue"), ch - diff, ch, diff);
 
     } else { // hue
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, (_("Adjust hue")));
         double ch = hsl[0];
         parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>hue</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, with <b>Ctrl</b> to adjust lightness"), ch - diff, ch, diff);
@@ -1315,15 +1315,15 @@ RotateableSwatch::do_release(double by, guint modifier) {
 
     if (modifier == 3) { // Alt, do nothing
     } else if (modifier == 2) { // saturation
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, ("Adjust saturation"));
 
     } else if (modifier == 1) { // lightness
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, ("Adjust lightness"));
 
     } else { // hue
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, ("Adjust hue"));
     }
 
@@ -1397,7 +1397,7 @@ RotateableStrokeWidth::do_motion(double by, guint modifier) {
     if (modifier == 3) { // Alt, do nothing
     } else {
         double diff = value_adjust(startvalue, by, modifier, false);
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width")));
         parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>stroke width</b>: was %.3g, now <b>%.3g</b> (diff %.3g)"), startvalue, startvalue + diff, diff);
     }
@@ -1411,7 +1411,7 @@ RotateableStrokeWidth::do_release(double by, guint modifier) {
     } else {
         value_adjust(startvalue, by, modifier, true);
         startvalue_set = false;
-        sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
+        SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey,
                                 SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width")));
     }
 
index 3a36127f4d74bd733e271621fd91642bf2a9b2be..84c6a0de2be868e572afd25ab220aa70d7f11bb3 100644 (file)
@@ -186,11 +186,11 @@ ToleranceSlider::update (double val)
     _wr->setUpdating (true);
 
     SPDocument *doc = sp_desktop_document(dt);
-    bool saved = sp_document_get_undo_sensitive (doc);
-    sp_document_set_undo_sensitive (doc, false);
+    bool saved = SPDocumentUndo::get_undo_sensitive (doc);
+       SPDocumentUndo::set_undo_sensitive (doc, false);
     Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt));
     repr->setAttribute(_key.c_str(), os.str().c_str());
-    sp_document_set_undo_sensitive (doc, saved);
+       SPDocumentUndo::set_undo_sensitive (doc, saved);
 
     doc->setModifiedSinceSave();
     
index 78ceec4671178a2bf4fb33535d7f0137eeab7af4..80f15fc5a7ab1ef0afd17c0818de17cfe79fb212 100644 (file)
@@ -119,7 +119,7 @@ vp_knot_moved_handler (SPKnot */*knot*/, Geom::Point const *ppointer, guint stat
             }
             // FIXME: Do we need to create a new dragger as well?
             dragger->updateZOrders ();
-            sp_document_done (sp_desktop_document (inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
+            SPDocumentUndo::done (sp_desktop_document (inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
                               _("Split vanishing points"));
             return;
         }
@@ -164,7 +164,7 @@ vp_knot_moved_handler (SPKnot */*knot*/, Geom::Point const *ppointer, guint stat
                 //       deleted according to changes in the svg representation, not based on any user input
                 //       as is currently the case.
 
-                sp_document_done (sp_desktop_document (inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
+                SPDocumentUndo::done (sp_desktop_document (inkscape_active_desktop()), SP_VERB_CONTEXT_3DBOX,
                                   _("Merge vanishing points"));
 
                 return;
@@ -220,7 +220,7 @@ vp_knot_ungrabbed_handler (SPKnot *knot, guint /*state*/, gpointer data)
     // TODO: Undo machinery!!
     g_return_if_fail (dragger->parent);
     g_return_if_fail (dragger->parent->document);
-    sp_document_done(dragger->parent->document, SP_VERB_CONTEXT_3DBOX,
+    SPDocumentUndo::done(dragger->parent->document, SP_VERB_CONTEXT_3DBOX,
                      _("3D box: Move vanishing point"));
 }
 
index 24c17aad8fd93f4035f486201cd626324c8b396b..300fe7494daa335b113c42ba9db87ad24d5cce77 100644 (file)
@@ -1098,7 +1098,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
             SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer());
             if (next) {
                 dt->setCurrentLayer(next);
-                sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT,
+                SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT,
                                  _("Switch to next layer"));
                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to next layer."));
             } else {
@@ -1110,7 +1110,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
             SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer());
             if (prev) {
                 dt->setCurrentLayer(prev);
-                sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_PREV,
+                SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_PREV,
                                  _("Switch to previous layer"));
                 dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to previous layer."));
             } else {
@@ -1176,7 +1176,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
                         description = _("Lower layer");
                         break;
                 };
-                sp_document_done(sp_desktop_document(dt), verb, description);
+                SPDocumentUndo::done(sp_desktop_document(dt), verb, description);
                 if (message) {
                     dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message);
                     g_free((void *) message);
@@ -1221,7 +1221,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
                     dt->setCurrentLayer(new_layer);
                 }
 #endif
-                sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DUPLICATE,
+                SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_DUPLICATE,
                                  _("Duplicate layer"));
 
                 // TRANSLATORS: this means "The layer has been duplicated."
@@ -1253,7 +1253,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
                     dt->setCurrentLayer(survivor);
                 }
 
-                sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE,
+                SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE,
                                  _("Delete layer"));
 
                 // TRANSLATORS: this means "The layer has been deleted."
@@ -1268,7 +1268,7 @@ LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
                 dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
             } else {
                 dt->toggleLayerSolo( dt->currentLayer() );
-                sp_document_maybe_done(sp_desktop_document(dt), "layer:solo", SP_VERB_LAYER_SOLO, _("Toggle layer solo"));
+                SPDocumentUndo::maybe_done(sp_desktop_document(dt), "layer:solo", SP_VERB_LAYER_SOLO, _("Toggle layer solo"));
             }
             break;
         }
@@ -1328,12 +1328,12 @@ ObjectVerb::perform( SPAction *action, void *data, void */*pdata*/ )
             break;
         case SP_VERB_OBJECT_FLIP_HORIZONTAL:
             sp_selection_scale_relative(sel, center, Geom::Scale(-1.0, 1.0));
-            sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL,
+            SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL,
                              _("Flip horizontally"));
             break;
         case SP_VERB_OBJECT_FLIP_VERTICAL:
             sp_selection_scale_relative(sel, center, Geom::Scale(1.0, -1.0));
-            sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL,
+            SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL,
                              _("Flip vertically"));
             break;
         case SP_VERB_OBJECT_SET_MASK:
@@ -2162,19 +2162,19 @@ LockAndHideVerb::perform(SPAction *action, void *data, void */*pdata*/)
     switch (reinterpret_cast<std::size_t>(data)) {
         case SP_VERB_UNLOCK_ALL:
             unlock_all(dt);
-            sp_document_done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer"));
+            SPDocumentUndo::done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer"));
             break;
         case SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS:
             unlock_all_in_all_layers(dt);
-            sp_document_done(doc, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, _("Unlock all objects in all layers"));
+            SPDocumentUndo::done(doc, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, _("Unlock all objects in all layers"));
             break;
         case SP_VERB_UNHIDE_ALL:
             unhide_all(dt);
-            sp_document_done(doc, SP_VERB_UNHIDE_ALL, _("Unhide all objects in the current layer"));
+            SPDocumentUndo::done(doc, SP_VERB_UNHIDE_ALL, _("Unhide all objects in the current layer"));
             break;
         case SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS:
             unhide_all_in_all_layers(dt);
-            sp_document_done(doc, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, _("Unhide all objects in all layers"));
+            SPDocumentUndo::done(doc, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, _("Unhide all objects in all layers"));
             break;
         default:
             return;
index 5a7256d8355a3584e71b98e7cf1f87bf9ed31048..e4db09c90c244e775d8ec0f4a23c0ef34092753a 100644 (file)
@@ -332,7 +332,7 @@ void FillNStroke::setFillrule( SPPaintSelector::FillRule mode )
         sp_repr_css_attr_unref(css);
         css = 0;
 
-        sp_document_done(desktop->doc(), SP_VERB_DIALOG_FILL_STROKE,
+        SPDocumentUndo::done(desktop->doc(), SP_VERB_DIALOG_FILL_STROKE,
                          _("Change fill rule"));
     }
 }
@@ -417,7 +417,7 @@ void FillNStroke::dragFromPaint()
             // local change, do not update from selection
             dragId = g_timeout_add_full(G_PRIORITY_DEFAULT, 100, dragDelayCB, this, 0);
             psel->setFlatColor( desktop, (kind == FILL) ? "fill" : "stroke", (kind == FILL) ? "fill-opacity" : "stroke-opacity" );
-            sp_document_maybe_done(desktop->doc(), (kind == FILL) ? undo_F_label : undo_S_label, SP_VERB_DIALOG_FILL_STROKE,
+            SPDocumentUndo::maybe_done(desktop->doc(), (kind == FILL) ? undo_F_label : undo_S_label, SP_VERB_DIALOG_FILL_STROKE,
                                    (kind == FILL) ? _("Set fill color") : _("Set stroke color"));
             break;
         }
@@ -480,7 +480,7 @@ void FillNStroke::updateFromPaint()
             sp_repr_css_attr_unref(css);
             css = 0;
 
-            sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE,
+            SPDocumentUndo::done(document, SP_VERB_DIALOG_FILL_STROKE,
                              (kind == FILL) ? _("Remove fill") : _("Remove stroke"));
             break;
         }
@@ -496,7 +496,7 @@ void FillNStroke::updateFromPaint()
             psel->setFlatColor( desktop,
                                 (kind == FILL) ? "fill" : "stroke",
                                 (kind == FILL) ? "fill-opacity" : "stroke-opacity" );
-            sp_document_maybe_done(sp_desktop_document(desktop), (kind == FILL) ? undo_F_label : undo_S_label, SP_VERB_DIALOG_FILL_STROKE,
+            SPDocumentUndo::maybe_done(sp_desktop_document(desktop), (kind == FILL) ? undo_F_label : undo_S_label, SP_VERB_DIALOG_FILL_STROKE,
                                    (kind == FILL) ? _("Set fill color") : _("Set stroke color"));
 
             if (kind == FILL) {
@@ -583,7 +583,7 @@ void FillNStroke::updateFromPaint()
                     css = 0;
                 }
 
-                sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE,
+                SPDocumentUndo::done(document, SP_VERB_DIALOG_FILL_STROKE,
                                  (kind == FILL) ? _("Set gradient on fill") : _("Set gradient on stroke"));
             }
             break;
@@ -643,7 +643,7 @@ void FillNStroke::updateFromPaint()
 
                 } // end if
 
-                sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE,
+                SPDocumentUndo::done(document, SP_VERB_DIALOG_FILL_STROKE,
                                  (kind == FILL) ? _("Set pattern on fill") :
                                  _("Set pattern on stroke"));
             } // end if
@@ -670,7 +670,7 @@ void FillNStroke::updateFromPaint()
                 sp_repr_css_attr_unref(css);
                 css = 0;
 
-                sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE,
+                SPDocumentUndo::done(document, SP_VERB_DIALOG_FILL_STROKE,
                                  (kind == FILL) ? _("Unset fill") : _("Unset stroke"));
             }
             break;
index fe003319f70640be2b135e6f9be3730f781394d5..a5543990838de8d2030758b5ff8ac6f29e80b836 100644 (file)
@@ -151,7 +151,7 @@ gr_item_activate (GtkMenuItem *menuitem, gpointer data)
 
     gr_apply_gradient (selection, ev? ev->get_drag() : NULL, gr);
 
-    sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
+    SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT,
                       _("Assign gradient to object"));
 }
 
index 132aff4555351271537e0656fb20c73b688d6a36..d8bbcd788c31665d977cc0bd52facde59d7fc04c 100644 (file)
@@ -363,7 +363,7 @@ static void sp_gvs_gradient_activate(GtkMenuItem *mi, SPGradientVectorSelector *
         /* We do extra undo push here */
         /* If handler has already done it, it is just NOP */
         // FIXME: looks like this is never a valid undo step, consider removing this
-        sp_document_done(SP_OBJECT_DOCUMENT(norm), SP_VERB_CONTEXT_GRADIENT,
+        SPDocumentUndo::done(SP_OBJECT_DOCUMENT(norm), SP_VERB_CONTEXT_GRADIENT,
                           /* TODO: annotate */ "gradient-vector.cpp:350");
     }
 }
@@ -666,7 +666,7 @@ static void offadjustmentChanged( GtkAdjustment *adjustment, GtkWidget *vb)
     stop->offset = adjustment->value;
     sp_repr_set_css_double(SP_OBJECT_REPR(stop), "offset", stop->offset);
 
-    sp_document_done(SP_OBJECT_DOCUMENT(stop), SP_VERB_CONTEXT_GRADIENT,
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(stop), SP_VERB_CONTEXT_GRADIENT,
                       _("Change gradient stop offset"));
 
     blocked = FALSE;
@@ -739,7 +739,7 @@ static void sp_grd_ed_add_stop(GtkWidget */*widget*/,  GtkWidget *vb)
     GtkWidget *offslide =GTK_WIDGET(g_object_get_data(G_OBJECT(vb), "offslide"));
     gtk_widget_set_sensitive(offslide, TRUE);
     gtk_widget_set_sensitive(GTK_WIDGET(offspin), TRUE);
-    sp_document_done(SP_OBJECT_DOCUMENT(gradient), SP_VERB_CONTEXT_GRADIENT,
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(gradient), SP_VERB_CONTEXT_GRADIENT,
                       _("Add gradient stop"));
 }
 
@@ -770,7 +770,7 @@ static void sp_grd_ed_del_stop(GtkWidget */*widget*/,  GtkWidget *vb)
         SP_OBJECT_REPR(gradient)->removeChild(SP_OBJECT_REPR(stop));
         sp_gradient_vector_widget_load_gradient(vb, gradient);
         update_stop_list(GTK_WIDGET(mnu), gradient, NULL);
-        sp_document_done(SP_OBJECT_DOCUMENT(gradient), SP_VERB_CONTEXT_GRADIENT,
+        SPDocumentUndo::done(SP_OBJECT_DOCUMENT(gradient), SP_VERB_CONTEXT_GRADIENT,
                           _("Delete gradient stop"));
     }
 
@@ -1040,10 +1040,10 @@ static void sp_gradient_vector_widget_load_gradient(GtkWidget *widget, SPGradien
         // Once the user edits a gradient, it stops being auto-collectable
         if (SP_OBJECT_REPR(gradient)->attribute("inkscape:collect")) {
             SPDocument *document = SP_OBJECT_DOCUMENT(gradient);
-            bool saved = sp_document_get_undo_sensitive(document);
-            sp_document_set_undo_sensitive(document, false);
+            bool saved = SPDocumentUndo::get_undo_sensitive(document);
+                       SPDocumentUndo::set_undo_sensitive(document, false);
             SP_OBJECT_REPR(gradient)->setAttribute("inkscape:collect", NULL);
-            sp_document_set_undo_sensitive(document, saved);
+                       SPDocumentUndo::set_undo_sensitive(document, saved);
         }
     } else { // no gradient, disable everything
         gtk_widget_set_sensitive(widget, FALSE);
@@ -1197,7 +1197,7 @@ static void sp_gradient_vector_color_changed(SPColorSelector *csel, GtkObject *o
     // g_snprintf(c, 256, "stop-color:#%06x;stop-opacity:%g;", rgb >> 8, static_cast<gdouble>(alpha));
     //SP_OBJECT_REPR(stop)->setAttribute("style", c);
 
-    sp_document_done(SP_OBJECT_DOCUMENT(ngr), SP_VERB_CONTEXT_GRADIENT,
+    SPDocumentUndo::done(SP_OBJECT_DOCUMENT(ngr), SP_VERB_CONTEXT_GRADIENT,
                       _("Change gradient stop color"));
 
     blocked = FALSE;
index 487e3a2743f37d3b2d1bcb353f339484136ddb68..a5bf818210daa155aa02ba024972c35282097754 100644 (file)
@@ -243,7 +243,7 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw)
         Geom::Matrix scaler = get_scale_transform_with_stroke (*bbox, strokewidth, transform_stroke, x0, y0, x1, y1);
 
         sp_selection_apply_affine(selection, scaler);
-        sp_document_maybe_done (document, actionkey, SP_VERB_CONTEXT_SELECT,
+        SPDocumentUndo::maybe_done (document, actionkey, SP_VERB_CONTEXT_SELECT,
                                 _("Transform by toolbar"));
 
         // resume interruptibility
index de14fc173bb5732e667243f41f82fb6d510f498b..8a46001b1a3b5da064c5ae6adde590340f2fbcdd 100644 (file)
@@ -154,7 +154,7 @@ sp_attribute_widget_changed (GtkEditable *editable)
         if (spaw->hasobj && spaw->src.object) {
         
             SP_OBJECT_REPR (spaw->src.object)->setAttribute(spaw->attribute, text, false);
-            sp_document_done (SP_OBJECT_DOCUMENT (spaw->src.object), SP_VERB_NONE,
+            SPDocumentUndo::done (SP_OBJECT_DOCUMENT (spaw->src.object), SP_VERB_NONE,
                               _("Set attribute"));
 
         } else if (spaw->src.repr) {
@@ -761,7 +761,7 @@ sp_attribute_table_entry_changed ( GtkEditable *editable,
 
                 if (spat->hasobj && spat->src.object) {
                     SP_OBJECT_REPR (spat->src.object)->setAttribute(spat->attributes[i], text, false);
-                    sp_document_done (SP_OBJECT_DOCUMENT (spat->src.object), SP_VERB_NONE,
+                    SPDocumentUndo::done (SP_OBJECT_DOCUMENT (spat->src.object), SP_VERB_NONE,
                                       _("Set attribute"));
 
                 } else if (spat->src.repr) {
index 7150b07fd4b6fa244120073c52d0d04f27aa117e..239f6e6e1f4a294cb865be6d43a33a85cad43806 100644 (file)
@@ -165,7 +165,7 @@ sp_xmlview_content_changed (GtkTextBuffer *tb, SPXMLViewContent *text)
         text->repr->setContent(data);
         g_free (data);
         text->blocked = FALSE;
-        sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
+        SPDocumentUndo::done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_XML_EDITOR,
                           _("Type text in a text node"));
     }
 }
index 1843c8edbdba85d49d1eff201591a4ef35f6cc26..0d7b95f4c5f3c3ec5e16d3ff72a644107800be20 100644 (file)
@@ -498,7 +498,7 @@ sp_marker_select(Gtk::OptionMenu *mnu, Gtk::Container *spw, SPMarkerLoc const wh
     sp_repr_css_attr_unref(css);
     css = 0;
 
-    sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done(document, SP_VERB_DIALOG_FILL_STROKE,
                      _("Set markers"));
 
 };
@@ -1203,7 +1203,7 @@ sp_stroke_style_scale_line(Gtk::Container *spw)
     sp_repr_css_attr_unref(css);
     css = 0;
 
-    sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE,
+    SPDocumentUndo::done(document, SP_VERB_DIALOG_FILL_STROKE,
                      _("Set stroke style"));
 
     spw->set_data("update", GINT_TO_POINTER(FALSE));
@@ -1300,7 +1300,7 @@ sp_stroke_style_any_toggled(Gtk::ToggleButton *tb, Gtk::Container *spw)
         sp_repr_css_attr_unref(css);
         css = 0;
 
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_DIALOG_FILL_STROKE,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_FILL_STROKE,
                          _("Set stroke style"));
     }
 }
index ce0f8a810ae366f69ce3c3558b843fa4a1bd59e2..b1329b92a438aed2b9012232c764f3c2b0e9ca2f 100644 (file)
@@ -135,7 +135,7 @@ void SwatchSelector::_changedCb(SPColorSelector */*csel*/, void *data)
                 os << "stop-color:" << c << ";stop-opacity:" << static_cast<gdouble>(alpha) <<";";
                 SP_OBJECT_REPR(stop)->setAttribute("style", os.str().c_str());
 
-                sp_document_done(SP_OBJECT_DOCUMENT(ngr), SP_VERB_CONTEXT_GRADIENT,
+                SPDocumentUndo::done(SP_OBJECT_DOCUMENT(ngr), SP_VERB_CONTEXT_GRADIENT,
                                  _("Change swatch color"));
             }
         }
index c255e087bb491484aa365daae1b5f089aab26967..29e7355365004d4ce173b60ee2681efd4321dbe9 100644 (file)
@@ -1270,7 +1270,7 @@ static void sp_node_path_value_changed(GtkAdjustment *adj, GObject *tbl, Geom::D
     UnitTracker* tracker = reinterpret_cast<UnitTracker*>(g_object_get_data( tbl, "tracker" ));
     SPUnit const *unit = tracker->getActiveUnit();
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         prefs->setDouble(Glib::ustring("/tools/nodes/") + (d == Geom::X ? "x" : "y"),
             sp_units_get_pixels(adj->value, *unit));
     }
@@ -2051,8 +2051,8 @@ static void toggle_snap_callback(GtkToggleAction *act, gpointer data) //data poi
         return;
     }
 
-    bool saved = sp_document_get_undo_sensitive(doc);
-    sp_document_set_undo_sensitive(doc, false);
+    bool saved = SPDocumentUndo::get_undo_sensitive(doc);
+       SPDocumentUndo::set_undo_sensitive(doc, false);
 
     bool v = false;
     SPAttributeEnum attr = (SPAttributeEnum) GPOINTER_TO_INT(g_object_get_data(G_OBJECT(act), "SP_ATTR_INKSCAPE"));
@@ -2137,7 +2137,7 @@ static void toggle_snap_callback(GtkToggleAction *act, gpointer data) //data poi
     // The snapping preferences are stored in the document, and therefore toggling makes the document dirty
     doc->setModifiedSinceSave();
 
-    sp_document_set_undo_sensitive(doc, saved);
+       SPDocumentUndo::set_undo_sensitive(doc, saved);
 }
 
 void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
@@ -2491,7 +2491,7 @@ static void sp_stb_magnitude_value_changed( GtkAdjustment *adj, GObject *dataKlu
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" );
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         // do not remember prefs if this call is initiated by an undo change, because undoing object
         // creation sets bogus values to its attributes before it is deleted
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
@@ -2522,7 +2522,7 @@ static void sp_stb_magnitude_value_changed( GtkAdjustment *adj, GObject *dataKlu
         }
     }
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
                          _("Star: Change number of corners"));
     }
 
@@ -2533,7 +2533,7 @@ static void sp_stb_proportion_value_changed( GtkAdjustment *adj, GObject *dataKl
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" );
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         if (!IS_NAN(adj->value)) {
             Inkscape::Preferences *prefs = Inkscape::Preferences::get();
             prefs->setDouble("/tools/shapes/star/proportion", adj->value);
@@ -2569,7 +2569,7 @@ static void sp_stb_proportion_value_changed( GtkAdjustment *adj, GObject *dataKl
     }
 
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
                          _("Star: Change spoke ratio"));
     }
 
@@ -2581,7 +2581,7 @@ static void sp_stb_sides_flat_state_changed( EgeSelectOneAction *act, GObject *d
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" );
     bool flat = ege_select_one_action_get_active( act ) == 0;
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setBool( "/tools/shapes/star/isflatsided", flat);
     }
@@ -2613,7 +2613,7 @@ static void sp_stb_sides_flat_state_changed( EgeSelectOneAction *act, GObject *d
     }
 
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
                          flat ? _("Make polygon") : _("Make star"));
     }
 
@@ -2624,7 +2624,7 @@ static void sp_stb_rounded_value_changed( GtkAdjustment *adj, GObject *dataKludg
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" );
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setDouble("/tools/shapes/star/rounded", (gdouble) adj->value);
     }
@@ -2650,7 +2650,7 @@ static void sp_stb_rounded_value_changed( GtkAdjustment *adj, GObject *dataKludg
         }
     }
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
                          _("Star: Change rounding"));
     }
 
@@ -2661,7 +2661,7 @@ static void sp_stb_randomized_value_changed( GtkAdjustment *adj, GObject *dataKl
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" );
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setDouble("/tools/shapes/star/randomized", (gdouble) adj->value);
     }
@@ -2687,7 +2687,7 @@ static void sp_stb_randomized_value_changed( GtkAdjustment *adj, GObject *dataKl
         }
     }
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR,
                          _("Star: Change randomization"));
     }
 
@@ -3026,7 +3026,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *
     UnitTracker* tracker = reinterpret_cast<UnitTracker*>(g_object_get_data( tbl, "tracker" ));
     SPUnit const *unit = tracker->getActiveUnit();
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setDouble(Glib::ustring("/tools/shapes/rect/") + value_name, sp_units_get_pixels(adj->value, *unit));
     }
@@ -3055,7 +3055,7 @@ static void sp_rtb_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *
     sp_rtb_sensitivize( tbl );
 
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT,
                                    _("Change rectangle"));
     }
 
@@ -3423,7 +3423,7 @@ static void box3d_persp_tb_event_attr_changed(Inkscape::XML::Node *repr,
     }
 
     // set freeze so that it can be caught in box3d_angle_z_value_changed() (to avoid calling
-    // sp_document_maybe_done() when the document is undo insensitive)
+    // SPDocumentUndo::maybe_done() when the document is undo insensitive)
     g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(TRUE));
 
     // TODO: Only update the appropriate part of the toolbar
@@ -3507,7 +3507,7 @@ static void box3d_angle_value_changed(GtkAdjustment *adj, GObject *dataKludge, P
     SP_OBJECT(persp)->updateRepr();
 
     // TODO: use the correct axis here, too
-    sp_document_maybe_done(document, "perspangle", SP_VERB_CONTEXT_3DBOX, _("3D Box: Change perspective (angle of infinite axis)"));
+    SPDocumentUndo::maybe_done(document, "perspangle", SP_VERB_CONTEXT_3DBOX, _("3D Box: Change perspective (angle of infinite axis)"));
 
     g_object_set_data( dataKludge, "freeze", GINT_TO_POINTER(FALSE) );
 }
@@ -3702,7 +3702,7 @@ static void sp_spl_tb_value_changed(GtkAdjustment *adj, GObject *tbl, Glib::ustr
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" );
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setDouble("/tools/shapes/spiral/" + value_name, adj->value);
     }
@@ -3733,7 +3733,7 @@ static void sp_spl_tb_value_changed(GtkAdjustment *adj, GObject *tbl, Glib::ustr
     g_free(namespaced_name);
 
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL,
                                    _("Change spiral"));
     }
 
@@ -5296,7 +5296,7 @@ sp_arctb_startend_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *v
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" );
 
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setDouble(Glib::ustring("/tools/shapes/arc/") + value_name, adj->value);
     }
@@ -5344,7 +5344,7 @@ sp_arctb_startend_value_changed(GtkAdjustment *adj, GObject *tbl, gchar const *v
     sp_arctb_sensitivize( tbl, adj->value, other->value );
 
     if (modmade) {
-        sp_document_maybe_done(sp_desktop_document(desktop), value_name, SP_VERB_CONTEXT_ARC,
+        SPDocumentUndo::maybe_done(sp_desktop_document(desktop), value_name, SP_VERB_CONTEXT_ARC,
                                    _("Arc: Change start/end"));
     }
 
@@ -5366,7 +5366,7 @@ static void sp_arctb_end_value_changed(GtkAdjustment *adj, GObject *tbl)
 static void sp_arctb_open_state_changed( EgeSelectOneAction *act, GObject *tbl )
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" );
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setBool("/tools/shapes/arc/open", ege_select_one_action_get_active(act) != 0);
     }
@@ -5408,7 +5408,7 @@ static void sp_arctb_open_state_changed( EgeSelectOneAction *act, GObject *tbl )
     }
 
     if (modmade) {
-        sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC,
+        SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC,
                                    _("Arc: Change open/closed"));
     }
 
@@ -5739,7 +5739,7 @@ static void sp_lpetool_mode_changed(EgeSelectOneAction *act, GObject *tbl)
             SP_LPETOOL_CONTEXT(desktop->event_context)->mode = type;
         }
 
-        if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+        if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
             Inkscape::Preferences *prefs = Inkscape::Preferences::get();
             prefs->setInt( "/tools/lpetool/mode", mode );
         }
@@ -6076,7 +6076,7 @@ static void sp_erasertb_mode_changed( EgeSelectOneAction *act, GObject *tbl )
 {
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" );
     bool eraserMode = ege_select_one_action_get_active( act ) != 0;
-    if (sp_document_get_undo_sensitive(sp_desktop_document(desktop))) {
+    if (SPDocumentUndo::get_undo_sensitive(sp_desktop_document(desktop))) {
         Inkscape::Preferences *prefs = Inkscape::Preferences::get();
         prefs->setBool( "/tools/eraser/mode", eraserMode );
     }
@@ -6376,7 +6376,7 @@ static void sp_text_fontfamily_value_changed( Ink_ComboBoxEntry_Action *act, GOb
     g_free (family);
 
     // Save for undo
-    sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
                                    _("Text: Change font family"));
     sp_repr_css_attr_unref (css);
 
@@ -6423,7 +6423,7 @@ static void sp_text_fontsize_value_changed( Ink_ComboBoxEntry_Action *act, GObje
     sp_desktop_set_style (desktop, css, true, true);
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:size", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:size", SP_VERB_NONE,
                                    _("Text: Change font size"));
 
     // If no selected objects, set default.
@@ -6569,7 +6569,7 @@ static void sp_text_style_changed( InkToggleAction* act, GObject *tbl )
     // Do we need to update other CSS values?
     SPDesktop   *desktop    = SP_ACTIVE_DESKTOP;
     sp_desktop_set_style (desktop, css, true, true);
-    sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
                                    _("Text: Change font style"));
     sp_repr_css_attr_unref (css);
 
@@ -6646,7 +6646,7 @@ static void sp_text_script_changed( InkToggleAction* act, GObject *tbl )
     sp_desktop_set_style (desktop, css, true, false);
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:script", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:script", SP_VERB_NONE,
                                    _("Text: Change superscript or subscript"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -6790,7 +6790,7 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl )
     sp_style_unref(query);
 
     sp_desktop_set_style (desktop, css, true, true);
-    sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
                                    _("Text: Change alignment"));
     sp_repr_css_attr_unref (css);
 
@@ -6829,7 +6829,7 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl )
     }
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:line-height", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:line-height", SP_VERB_NONE,
                                    _("Text: Change line-height"));
 
     // If no selected objects, set default.
@@ -6868,7 +6868,7 @@ static void sp_text_wordspacing_value_changed( GtkAdjustment *adj, GObject *tbl
     sp_desktop_set_style (desktop, css, true, false);
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:word-spacing", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:word-spacing", SP_VERB_NONE,
                                    _("Text: Change word-spacing"));
 
     // If no selected objects, set default.
@@ -6907,7 +6907,7 @@ static void sp_text_letterspacing_value_changed( GtkAdjustment *adj, GObject *tb
     sp_desktop_set_style (desktop, css, true, false);
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:letter-spacing", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:letter-spacing", SP_VERB_NONE,
                                    _("Text: Change letter-spacing"));
 
     // If no selected objects, set default.
@@ -6952,7 +6952,7 @@ static void sp_text_dx_value_changed( GtkAdjustment *adj, GObject *tbl )
     }
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:dx", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:dx", SP_VERB_NONE,
                                    _("Text: Change dx (kern)"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -6983,7 +6983,7 @@ static void sp_text_dy_value_changed( GtkAdjustment *adj, GObject *tbl )
     }
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:dy", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:dy", SP_VERB_NONE,
                                    _("Text: Change dy"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -7014,7 +7014,7 @@ static void sp_text_rotation_value_changed( GtkAdjustment *adj, GObject *tbl )
     }
 
     // Save for undo
-    sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:rotate", SP_VERB_NONE,
+    SPDocumentUndo::maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:rotate", SP_VERB_NONE,
                                    _("Text: Change rotate"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -7059,7 +7059,7 @@ static void sp_text_orientation_mode_changed( EgeSelectOneAction *act, GObject *
     }
 
     sp_desktop_set_style (SP_ACTIVE_DESKTOP, css, true, true);
-    sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
+    SPDocumentUndo::done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT,
                                    _("Text: Change orientation"));
     sp_repr_css_attr_unref (css);
 
@@ -7869,7 +7869,7 @@ static void sp_connector_orthogonal_toggled( GtkToggleAction* act, GObject *tbl
     Inkscape::Selection * selection = sp_desktop_selection(desktop);
     SPDocument *doc = sp_desktop_document(desktop);
 
-    if (!sp_document_get_undo_sensitive(doc)) {
+    if (!SPDocumentUndo::get_undo_sensitive(doc)) {
         return;
     }
 
@@ -7906,7 +7906,7 @@ static void sp_connector_orthogonal_toggled( GtkToggleAction* act, GObject *tbl
         prefs->setBool("/tools/connector/orthogonal", is_orthog);
     }
 
-    sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR,
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR,
             is_orthog ? _("Set connector type: orthogonal"): _("Set connector type: polyline"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -7918,7 +7918,7 @@ static void connector_curvature_changed(GtkAdjustment *adj, GObject* tbl)
     Inkscape::Selection * selection = sp_desktop_selection(desktop);
     SPDocument *doc = sp_desktop_document(desktop);
 
-    if (!sp_document_get_undo_sensitive(doc)) {
+    if (!SPDocumentUndo::get_undo_sensitive(doc)) {
         return;
     }
 
@@ -7954,7 +7954,7 @@ static void connector_curvature_changed(GtkAdjustment *adj, GObject* tbl)
         prefs->setDouble(Glib::ustring("/tools/connector/curvature"), newValue);
     }
 
-    sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR,
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR,
             _("Change connector curvature"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -7966,7 +7966,7 @@ static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl)
     SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" );
     SPDocument *doc = sp_desktop_document(desktop);
 
-    if (!sp_document_get_undo_sensitive(doc)) {
+    if (!SPDocumentUndo::get_undo_sensitive(doc)) {
         return;
     }
 
@@ -8002,7 +8002,7 @@ static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl)
         g_slist_free(items);
     }
 
-    sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR,
+    SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR,
             _("Change connector spacing"));
 
     g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
@@ -8023,7 +8023,7 @@ static void sp_connector_graph_layout(void)
 
     prefs->setInt("/options/clonecompensation/value", saved_compensation);
 
-    sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Arrange connector network"));
+    SPDocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Arrange connector network"));
 }
 
 static void sp_directed_graph_layout_toggled( GtkToggleAction* act, GtkObject * /*tbl*/ )