summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b63533)
raw | patch | inline | side by side (parent: 2b63533)
author | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Fri, 2 Jul 2010 12:35:42 +0000 (18:05 +0530) | ||
committer | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Fri, 2 Jul 2010 12:35:42 +0000 (18:05 +0530) |
92 files changed:
diff --git a/src/arc-context.cpp b/src/arc-context.cpp
index ab3389ec6daebae542898b20626ce4b790e36679..2f70e16f361c519fc3fb1b5a0e90af4de5e82761 100644 (file)
--- a/src/arc-context.cpp
+++ b/src/arc-context.cpp
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;
sp_canvas_end_forced_full_redraws(desktop->canvas);
- sp_document_cancel(sp_desktop_document(desktop));
+ SPDocumentUndo::cancel(sp_desktop_document(desktop));
}
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 5534aa4109187b45df4c6d2ae009b06b9d1f171d..88763e1835c5a7360395fcfb947575d0ac8ba6a0 100644 (file)
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
@@ -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;
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;
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index 15cd97b28ca30419fb123bc2962fc3c99b15617a..70e0c38562aff65722356b4d35ee516c779bfbb5 100644 (file)
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -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)
// 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,
if (items) {
g_slist_free(items);
}
- sp_document_set_undo_sensitive(document, saved);
+ SPDocumentUndo::set_undo_sensitive(document, saved);
}
index 90b16fddd3b8ff4a2d2010033a4e6616dbfd623e..ff19c77499879137b5c0d79950e7c781cfcc342e 100644 (file)
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);
}
c->unref();
- sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, _("Create connector"));
+ SPDocumentUndo::done(doc, SP_VERB_CONTEXT_CONNECTOR, _("Create connector"));
}
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)
/**
* 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>
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)
/**
* 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>
diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp
index 810f501d7fe1bbf024161db08f6fa31b54d9e314..2046b95101aaca86b3c43e837fc9ec9673ded798 100644 (file)
--- a/src/desktop-events.cpp
+++ b/src/desktop-events.cpp
@@ -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));
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;
{
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)
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"));
}
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"));
}
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"));
}
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index 6513813cc0e0ba49b151aec6860232c205573d3e..649918742e723a7e0c486bbd1ce606d7d41894bd 100644 (file)
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
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)) {
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();
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) {
modified = true;
}
}
- sp_document_set_undo_sensitive(doc, saved);
+ SPDocumentUndo::set_undo_sensitive(doc, saved);
if (modified) {
doc->setModifiedSinceSave();
index abc45b44be8f22b97856c66a63b834e1edda1f02..8d2b15e4402e6dcfc864a7d9f3736029634c63f6 100644 (file)
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));
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));
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"));
}
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"));
}
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 */
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)
// 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)
}
// 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)
--- a/src/dialogs/xml-tree.cpp
+++ b/src/dialogs/xml-tree.cpp
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);
}
}
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"));
}
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);
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);
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"));
}
updated->updateRepr();
}
- sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR,
+ SPDocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
_("Delete attribute"));
}
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? */
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);
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);
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);
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"));
}
/*
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index ee15e480f820d639196e9c8a404c0c19bd1243a9..280eea24317f6d2802bbbbd5a07fd6adaa2cf79a 100644 (file)
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
#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"
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);
* 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);
}
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;
}
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);
}
gboolean
-sp_document_undo (SPDocument *doc)
+SPDocumentUndo::undo (SPDocument *doc)
{
using Inkscape::Debug::EventTracker;
using Inkscape::Debug::SimpleEvent;
}
gboolean
-sp_document_redo (SPDocument *doc)
+SPDocumentUndo::redo (SPDocument *doc)
{
using Inkscape::Debug::EventTracker;
using Inkscape::Debug::SimpleEvent;
}
void
-sp_document_clear_undo (SPDocument *doc)
+SPDocumentUndo::clear_undo (SPDocument *doc)
{
if (doc->priv->undo)
doc->priv->undoStackObservers.notifyClearUndoEvent();
}
void
-sp_document_clear_redo (SPDocument *doc)
+SPDocumentUndo::clear_redo (SPDocument *doc)
{
if (doc->priv->redo)
doc->priv->undoStackObservers.notifyClearRedoEvent();
diff --git a/src/document.cpp b/src/document.cpp
index 147c22b3c1dbd476a1399e139b94f67449836cbb..e68bc1f947bb46d7bc0d93d0b9dea223972e9179 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
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();
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();
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));
}
}
-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);
}
/**
*/
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);
}
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();
}
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);
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);
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);
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);
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);
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);
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);
diff --git a/src/document.h b/src/document.h
index 3fa83c779394f9ae6c00d8cddce4229f2beb0a6b..38f930c31a5f782eea8fe7528c90fecc1a18dea7 100644 (file)
--- a/src/document.h
+++ b/src/document.h
#include "gc-anchored.h"
#include <glibmm/ustring.h>
#include "verbs.h"
+#include "document-undo.h"
#include <vector>
#include <set>
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);
* 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);
//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);
diff --git a/src/draw-context.cpp b/src/draw-context.cpp
index ea25efc225f7712dd905e60b219efcc0b9480ea2..a3c3601cc8ccd98f35740bd8a8ae89fdfbd05a8e 100644 (file)
--- a/src/draw-context.cpp
+++ b/src/draw-context.cpp
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)
--- a/src/dropper-context.cpp
+++ b/src/dropper-context.cpp
@@ -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)
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"));
}
diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp
index db1aa46d9be7faa83c4c531e051d5f7e9f58ecb9..fdb0813ce7d065f6df373eafa77fdc5db65093fe 100644 (file)
--- a/src/eraser-context.cpp
+++ b/src/eraser-context.cpp
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)
--- a/src/extension/effect.cpp
+++ b/src/extension/effect.cpp
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)
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();
diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp
index 4983d7eff4069a994f253dbc6fb4d6f736109461..69fdbcfd1dc02e1f1ca9023a6f211257c0432aae 100644 (file)
}
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);
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");
}
diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp
index 9826addb6fb209624b8f08d36b5b39a0be2f8c6e..b507118035e053acac0efe1be82e0bf688f2faaf 100644 (file)
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);
delete dlg;
// Restore undo
- sp_document_set_undo_sensitive(doc, saved);
+ SPDocumentUndo::set_undo_sensitive(doc, saved);
return doc;
}
index 67720235dd80eaa30db29bd939ce65a81c8606e5..8cfc58797c84b3e74b4a14566640f01585fdfc78 100644 (file)
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
// 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);
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);
diff --git a/src/file.cpp b/src/file.cpp
index 6b162c79978f404dde2ba936fdba45437f133c93..2344c67f211e012fbcc458b6aa937a00da857964 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
unsigned int diff = doc->vacuum_document ();
- sp_document_done(doc, SP_VERB_FILE_VACUUM,
+ SPDocumentUndo::done(doc, SP_VERB_FILE_VACUUM,
_("Vacuum <defs>"));
SPDesktop *dt = SP_ACTIVE_DESKTOP;
}
doc->doUnref();
- sp_document_done(in_doc, SP_VERB_FILE_IMPORT,
+ SPDocumentUndo::done(in_doc, SP_VERB_FILE_IMPORT,
_("Import"));
} else {
diff --git a/src/flood-context.cpp b/src/flood-context.cpp
index 019cbbb0294c54c184bf92bcabffc8501de49039..696efd3e37adfad486e9fd673fb96795e2ec8d32 100644 (file)
--- a/src/flood-context.cpp
+++ b/src/flood-context.cpp
@@ -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;
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)
--- a/src/gradient-context.cpp
+++ b/src/gradient-context.cpp
}
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;
}
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);
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;
}
-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
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 6306278c584b08c689408c21687b9bd4c768e16c..5fb490b8b87b219ea07679257f2329c14fec0336 100644 (file)
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -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;
}
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"));
}
}
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)"));
}
}
}
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)") );
}
}
diff --git a/src/interface.cpp b/src/interface.cpp
index bdec992919cc2478448a93b77e9846c3f465b53d..a535ed1bd722dcab0d244f5791b1f0860d7a9e49 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
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 ) {
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();
}
}
//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"));
// }
//}
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 (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();
}
}
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"));
}
}
}
Inkscape::GC::release(newgroup);
- sp_document_done(doc, SP_VERB_NONE,
+ SPDocumentUndo::done(doc, SP_VERB_NONE,
_("Drop SVG"));
break;
}
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;
}
diff --git a/src/knot.cpp b/src/knot.cpp
index 10672e0481404092c672e5608e30bb46fdb34cce..95a9ec1482b675614228b1c0bc2291aa0a597ae6 100644 (file)
--- a/src/knot.cpp
+++ b/src/knot.cpp
@@ -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;
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index af11d5acb0e2e01ef8c4d147b0d59067d6472056..89f57da978b7f2a360153f17593dc750ea0b0a27 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
}
// 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"));
}
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)
//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)
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"));
}
// 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"));
}
}
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index c44ab5bc616e3c64e26e2558f27a467b59478bfd..daa9ae5951c66b628c5fc2ae3813c7632f50904a 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
// 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);
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."));
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."));
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."));
diff --git a/src/persp3d.cpp b/src/persp3d.cpp
index d9839c556b02bda0b175a6230e02c483775b2d6f..817bb97d7b4126c82ca3b48d9787a7390280fa3a 100644 (file)
--- a/src/persp3d.cpp
+++ b/src/persp3d.cpp
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"));
}
}
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"));
}
diff --git a/src/rect-context.cpp b/src/rect-context.cpp
index b232a340ae6d4608c590cc591333f4a05a658dd1..69a9bc2f069a71ce146874be74d35b7dd5180f52 100644 (file)
--- a/src/rect-context.cpp
+++ b/src/rect-context.cpp
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;
sp_canvas_end_forced_full_redraws(desktop->canvas);
- sp_document_cancel(sp_desktop_document(desktop));
+ SPDocumentUndo::cancel(sp_desktop_document(desktop));
}
diff --git a/src/select-context.cpp b/src/select-context.cpp
index db25d3fad06518d7042d3736a4b1d3f39ca1647a..215436f38099563068b0e91c917e9cacf25dffb0 100644 (file)
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
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);
// 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)
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;
}
*/
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"));
}
if ( !suppressDone ) {
- sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE,
+ SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE,
_("Duplicate"));
}
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"));
}
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);
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"));
}
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
g_slist_free(rl);
- sp_document_done(document, SP_VERB_SELECTION_TO_FRONT,
+ SPDocumentUndo::done(document, SP_VERB_SELECTION_TO_FRONT,
_("Raise to top"));
}
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"));
}
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."));
}
{
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"));
}
}
{
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"));
}
}
{
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"));
}
}
}
- 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"));
}
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"));
}
{
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"));
}
}
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 {
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 {
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"));
}
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° CCW") : _("Rotate 90° 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" ),
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" ),
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" ),
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"));
}
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"));
}
}
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"));
}
}
// 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);
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"));
}
}
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"));
}
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"));
}
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
g_slist_free(items);
- sp_document_done(doc, SP_VERB_EDIT_TILE,
+ SPDocumentUndo::done(doc, SP_VERB_EDIT_TILE,
_("Objects to pattern"));
}
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);
}
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) {
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"));
}
/**
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"));
}
}
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"));
}
}
? 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"));
}
};
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 89799246cec882a8b5fa32e3e38c605e246d0317..627620a6007e7c0363a41830a29e9c4c4d798ebf 100644 (file)
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
_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"));
}
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"));
}
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;
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 5bf7f664cee8b6c676a3bbd54f16c2e55b0d6f2e..877e7397925f70e5be09ecf0d195a19da3016027 100644 (file)
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
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)
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index c178cfdd49796cd86d29e0ec5e07e72f4829f392..1d38771bc4ed8b29b759ac22f8dba1b48fb35b07 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
}
if (do_done)
- sp_document_done (doc, SP_VERB_NONE, _("Ungroup"));
+ SPDocumentUndo::done (doc, SP_VERB_NONE, _("Ungroup"));
}
/*
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 44c3bf62013c42d84cffbf5f6facce5f66a42c01..8c750f347066e9e32fea0a8759b930d3fb6eea40 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -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"));
}
}
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]);
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)
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 */
diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp
index 2eb8daf8986de280ae76644e2cbdc78383ede4ea..3d1cd4b211e6f62d2318513f44aeadbaa3d570ee 100644 (file)
--- a/src/spiral-context.cpp
+++ b/src/spiral-context.cpp
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;
sp_canvas_end_forced_full_redraws(desktop->canvas);
- sp_document_cancel(sp_desktop_document(desktop));
+ SPDocumentUndo::cancel(sp_desktop_document(desktop));
}
/*
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index db5ceaa8ef4dcd05ba52d80227ee2327f04b5817..5073382e5d129db56a2e7e1f9fdae110c6887f97 100644 (file)
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -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;
}
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."));
diff --git a/src/spray-context.cpp b/src/spray-context.cpp
index 8c30f5a5a39fda298742d36562173b66ed7d3250..ebdf56673a062fecc0f775c6271c20f3b107e771 100644 (file)
--- a/src/spray-context.cpp
+++ b/src/spray-context.cpp
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;
}
diff --git a/src/star-context.cpp b/src/star-context.cpp
index 69d711722d9f4d5d83251aa8a2bd83b8a771beb6..2761c573aa319debce0627afc0f44218f66f97ff 100644 (file)
--- a/src/star-context.cpp
+++ b/src/star-context.cpp
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;
sp_canvas_end_forced_full_redraws(desktop->canvas);
- sp_document_cancel(sp_desktop_document(desktop));
+ SPDocumentUndo::cancel(sp_desktop_document(desktop));
}
/*
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index 2cc6e30d99d1af36fd429e7c095ceb941a23a4b5..5af97165e8004165da727093cee7dc2469ad647a 100644 (file)
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
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);
}
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
}
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"));
}
}
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));
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"));
}
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);
diff --git a/src/text-context.cpp b/src/text-context.cpp
index b37c973115069d08e295f2141a268c2eda084544..cfde60a0da1910fdce64f1bfcdf59a036facc3fe 100644 (file)
--- a/src/text-context.cpp
+++ b/src/text-context.cpp
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"));
}
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"));
}
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;
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);
// 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"));
}
}
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"));
}
diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp
index a2b0cd7909412091ebfd92bd14b1f8af7537386d..e9bc48372bae322633da67aa3eb39fb31bbc6bf4 100644 (file)
--- a/src/trace/trace.cpp
+++ b/src/trace/trace.cpp
}
//## 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;
diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp
index e77d2d465ff3ffc89b563a1b473a894b92ff2cc4..cd6ff325ad87a4cb35ed0181294da9f89f067e0b 100644 (file)
--- a/src/tweak-context.cpp
+++ b/src/tweak-context.cpp
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)
--- a/src/ui/context-menu.cpp
+++ b/src/ui/context-menu.cpp
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)
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"));
}
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"));
}
}
// 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"));
}
};
// 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"));
}
};
// 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"));
}
};
// 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"));
}
};
}
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"));
}
}
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)
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"));
}
}
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)
//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();
}
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);
}
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();
}
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);
}
// 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)
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"));
}
}
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()
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();
}
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();
}
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.
_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"));
}
}
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)
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
#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"
}
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)
--- a/src/ui/dialog/guides.cpp
+++ b/src/ui/dialog/guides.cpp
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"));
}
{
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)
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();
(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)
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
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;
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)
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;
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));
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));
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));
/* 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)
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)
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"));
}
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 += ":";
//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();
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();
}
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();
}
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"));
}
}
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"));
}
}
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();
}
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();
}
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();
}
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();
}
// 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(){
}
}
- 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(){
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
diff --git a/src/ui/dialog/tile.cpp b/src/ui/dialog/tile.cpp
index 546fdd8f0482b5735116e9fda22e7483af72655b..cf29ed77fd50423b2a97674c4346244b49256e17 100644 (file)
--- a/src/ui/dialog/tile.cpp
+++ b/src/ui/dialog/tile.cpp
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)
}
}
- sp_document_done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM,
+ SPDocumentUndo::done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM,
_("Move"));
}
}
}
- sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
_("Scale"));
}
}
}
- sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
_("Rotate"));
}
}
}
- sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
+ SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM,
_("Skew"));
}
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)
_event_log->blockNotifications();
for ( --last ; curr_event != last ; ++curr_event ) {
- sp_document_redo(_document);
+ SPDocumentUndo::redo(_document);
}
_event_log->blockNotifications(false);
while ( selected != last_selected ) {
- sp_document_undo(_document);
+ SPDocumentUndo::undo(_document);
if ( last_selected->parent() &&
last_selected == last_selected->parent()->children().begin() )
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)
_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();
}
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)
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)
(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)
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);
}
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)
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"));
}
}
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)
_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);
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index bfc291bc02a3e69435a2219e31a2b9ffbaf02b03..f5e4657b13e719a23a6dd444737cb9013d284a47 100644 (file)
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
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)
// 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)
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)
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)
--- a/src/ui/widget/ruler.cpp
+++ b/src/ui/widget/ruler.cpp
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)
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"));
}
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
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"));
}
}
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"));
}
}
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"));
}
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;
}
// 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"));
}
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));
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);
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"));
}
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);
}
} 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)
_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)
--- a/src/vanishing-point.cpp
+++ b/src/vanishing-point.cpp
@@ -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;
// 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"));
}
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 24c17aad8fd93f4035f486201cd626324c8b396b..300fe7494daa335b113c42ba9db87ad24d5cce77 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
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 {
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 {
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);
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."
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."
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;
}
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:
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)
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"));
}
}
// 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;
}
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;
}
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) {
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;
} // 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
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)
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");
}
}
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;
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"));
}
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)
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)
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) {
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)
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"));
};
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));
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)
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)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -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"));
}
}
// 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"));
}
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"));
}
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 );
}
{
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.
// 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);
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.
}
// 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) );
}
// 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) );
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;
}
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) );
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;
}
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) );
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*/ )