diff options
| author | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | 2010-07-02 12:35:42 +0000 |
|---|---|---|
| committer | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | 2010-07-02 12:35:42 +0000 |
| commit | d25a9a072143eafa4a9823b84e977c4b85d45efe (patch) | |
| tree | ef59162da575782282a2e127931707a63d7cbbb0 /src/ui | |
| parent | C++fied SPDocument added (diff) | |
| download | inkscape-d25a9a072143eafa4a9823b84e977c4b85d45efe.tar.gz inkscape-d25a9a072143eafa4a9823b84e977c4b85d45efe.zip | |
New Class SPDocumentUndo created which takes care of c++fying some non SPDocument based methods
(bzr r9546.1.3)
Diffstat (limited to 'src/ui')
29 files changed, 126 insertions, 126 deletions
diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 98ad9dc7b..1ffbf1fd0 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -284,7 +284,7 @@ sp_item_create_link(GtkMenuItem *menuitem, SPItem *item) Inkscape::GC::release(repr); Inkscape::GC::release(child); - sp_document_done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE, + SPDocumentUndo::done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE, _("Create link")); sp_object_attributes_dialog(object, "SPAnchor"); diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 0b47f42ab..af1671b04 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -233,7 +233,7 @@ private : prefs->setInt("/options/clonecompensation/value", saved_compensation); if (changed) { - sp_document_done ( sp_desktop_document (desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done ( sp_desktop_document (desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Align")); } @@ -392,7 +392,7 @@ private : prefs->setInt("/options/clonecompensation/value", saved_compensation); if (changed) { - sp_document_done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Distribute")); } } @@ -505,7 +505,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Remove overlaps")); } }; @@ -536,7 +536,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Arrange connector network")); } }; @@ -567,7 +567,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - sp_document_done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done (sp_desktop_document (_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Unclump")); } }; @@ -638,7 +638,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Randomize positions")); } }; @@ -737,7 +737,7 @@ private : } if (changed) { - sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Distribute text baselines")); } @@ -760,7 +760,7 @@ private : } if (changed) { - sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Align text baselines")); } } diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index cb6cfbbbe..a8445c66c 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -486,7 +486,7 @@ void ColorItem::_updatePreviews() str = 0; if ( bruteForce( document, rroot, paletteName, def.getR(), def.getG(), def.getB() ) ) { - sp_document_done( document , SP_VERB_DIALOG_SWATCHES, + SPDocumentUndo::done( document , SP_VERB_DIALOG_SWATCHES, _("Change color definition")); } } @@ -720,7 +720,7 @@ void ColorItem::buttonClicked(bool secondary) sp_desktop_set_style(desktop, css); sp_repr_css_attr_unref(css); - sp_document_done( sp_desktop_document(desktop), SP_VERB_DIALOG_SWATCHES, descr.c_str() ); + SPDocumentUndo::done( sp_desktop_document(desktop), SP_VERB_DIALOG_SWATCHES, descr.c_str() ); } } diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 970c609af..2fe353533 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -450,7 +450,7 @@ DocumentProperties::linkSelectedProfile() //Inkscape::GC::release(defsRepr); // inform the document, so we can undo - sp_document_done(desktop->doc(), SP_VERB_EDIT_LINK_COLOR_PROFILE, _("Link Color Profile")); + SPDocumentUndo::done(desktop->doc(), SP_VERB_EDIT_LINK_COLOR_PROFILE, _("Link Color Profile")); populate_linked_profiles_box(); } @@ -523,7 +523,7 @@ void DocumentProperties::removeSelectedProfile(){ Inkscape::ColorProfile* prof = reinterpret_cast<Inkscape::ColorProfile*>(obj); if (!name.compare(prof->name)){ sp_repr_unparent(obj->repr); - sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile")); + SPDocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_COLOR_PROFILE, _("Remove linked color profile")); } current = g_slist_next(current); } @@ -668,7 +668,7 @@ void DocumentProperties::addExternalScript(){ xml_doc->root()->addChild(scriptRepr, NULL); // inform the document, so we can undo - sp_document_done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script...")); + SPDocumentUndo::done(desktop->doc(), SP_VERB_EDIT_ADD_EXTERNAL_SCRIPT, _("Add external script...")); populate_external_scripts_box(); } @@ -692,7 +692,7 @@ void DocumentProperties::removeExternalScript(){ SPScript* script = (SPScript*) obj; if (name == script->xlinkhref){ sp_repr_unparent(obj->repr); - sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script")); + SPDocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script")); } current = g_slist_next(current); } @@ -985,7 +985,7 @@ DocumentProperties::onRemoveGrid() // delete the grid that corresponds with the selected tab // when the grid is deleted from SVG, the SPNamedview handler automatically deletes the object, so found_grid becomes an invalid pointer! found_grid->repr->parent()->removeChild(found_grid->repr); - sp_document_done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid")); + SPDocumentUndo::done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid")); } } diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 7baf2d71f..3a80c4ba8 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1032,7 +1032,7 @@ private: Inkscape::GC::release(repr); } - sp_document_done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("New light source")); + SPDocumentUndo::done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("New light source")); update(); } @@ -1215,7 +1215,7 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa if(iter) { SPFilter* filter = (*iter)[_columns.filter]; filter->setLabel(text.c_str()); - sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Rename filter")); + SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Rename filter")); if(iter) (*iter)[_columns.label] = text; } @@ -1251,7 +1251,7 @@ void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustri } update_selection(sel); - sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Apply filter")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Apply filter")); } } @@ -1327,7 +1327,7 @@ void FilterEffectsDialog::FilterModifier::add_filter() select_filter(filter); - sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter")); } void FilterEffectsDialog::FilterModifier::remove_filter() @@ -1338,7 +1338,7 @@ void FilterEffectsDialog::FilterModifier::remove_filter() SPDocument* doc = filter->document; sp_repr_unparent(filter->repr); - sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter")); update_filters(); } @@ -1353,7 +1353,7 @@ void FilterEffectsDialog::FilterModifier::duplicate_filter() repr = repr->duplicate(repr->document()); parent->appendChild(repr); - sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter")); + SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter")); update_filters(); } @@ -1543,7 +1543,7 @@ void FilterEffectsDialog::PrimitiveList::remove_selected() sp_repr_unparent(prim->repr); - sp_document_done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_FILTER_EFFECTS, + SPDocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter primitive")); update(); @@ -1915,7 +1915,7 @@ bool FilterEffectsDialog::PrimitiveList::on_button_release_event(GdkEventButton* // If input is null, delete it if(!in_val) { sp_repr_unparent(o->repr); - sp_document_done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS, + SPDocumentUndo::done(prim->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove merge node")); (*get_selection()->get_selected())[_columns.primitive] = prim; } @@ -2032,7 +2032,7 @@ void FilterEffectsDialog::PrimitiveList::on_drag_end(const Glib::RefPtr<Gdk::Dra filter->requestModified(SP_OBJECT_MODIFIED_FLAG); - sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Reorder filter primitive")); + SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Reorder filter primitive")); } // If a connection is dragged towards the top or bottom of the list, the list should scroll to follow. @@ -2263,7 +2263,7 @@ void FilterEffectsDialog::add_primitive() _primitive_list.select(prim); - sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter primitive")); + SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Add filter primitive")); } } @@ -2359,7 +2359,7 @@ void FilterEffectsDialog::duplicate_primitive() repr = SP_OBJECT_REPR(origprim)->duplicate(SP_OBJECT_REPR(origprim)->document()); SP_OBJECT_REPR(filter)->appendChild(repr); - sp_document_done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter primitive")); + SPDocumentUndo::done(filter->document, SP_VERB_DIALOG_FILTER_EFFECTS, _("Duplicate filter primitive")); _primitive_list.update(); } @@ -2411,7 +2411,7 @@ void FilterEffectsDialog::set_attr(SPObject* o, const SPAttributeEnum attr, cons Glib::ustring undokey = "filtereffects:"; undokey += name; - sp_document_maybe_done(filter->document, undokey.c_str(), SP_VERB_DIALOG_FILTER_EFFECTS, + SPDocumentUndo::maybe_done(filter->document, undokey.c_str(), SP_VERB_DIALOG_FILTER_EFFECTS, _("Set filter primitive attribute")); } diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp index 8ed502aae..8193b4384 100644 --- a/src/ui/dialog/glyphs.cpp +++ b/src/ui/dialog/glyphs.cpp @@ -28,7 +28,7 @@ #include "glyphs.h" #include "desktop.h" -#include "document.h" // for sp_document_done() +#include "document.h" // for SPDocumentUndo::done() #include "libnrtype/font-instance.h" #include "sp-flowtext.h" #include "sp-text.h" @@ -571,7 +571,7 @@ void GlyphsPanel::insertText() } combined += glyphs; sp_te_set_repr_text_multiline(textItem, combined.c_str()); - sp_document_done(targetDesktop->doc(), SP_VERB_CONTEXT_TEXT, _("Append text")); + SPDocumentUndo::done(targetDesktop->doc(), SP_VERB_CONTEXT_TEXT, _("Append text")); } } } diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 3a7964ba2..9c3422167 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -108,7 +108,7 @@ void GuidelinePropertiesDialog::_onApply() sp_guide_moveto(*_guide, newpos, true); - sp_document_done(SP_OBJECT_DOCUMENT(_guide), SP_VERB_NONE, + SPDocumentUndo::done(SP_OBJECT_DOCUMENT(_guide), SP_VERB_NONE, _("Set guide properties")); } @@ -121,7 +121,7 @@ void GuidelinePropertiesDialog::_onDelete() { SPDocument *doc = SP_OBJECT_DOCUMENT(_guide); sp_guide_remove(_guide); - sp_document_done(doc, SP_VERB_NONE, + SPDocumentUndo::done(doc, SP_VERB_NONE, _("Delete guide")); } diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index ffa4642e7..80c943e39 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -105,7 +105,7 @@ LayerPropertiesDialog::_apply() g_assert(_strategy != NULL); _strategy->perform(*this); - sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, _("Add layer")); _close(); @@ -188,7 +188,7 @@ void LayerPropertiesDialog::Rename::perform(LayerPropertiesDialog &dialog) { (gchar *)name.c_str(), FALSE ); - sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, _("Rename layer")); // TRANSLATORS: This means "The layer has been renamed" desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Renamed layer")); diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index ff3a13ab2..962d78df8 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -468,7 +468,7 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol ) row[_model->_colVisible] = newValue; item->setHidden( !newValue ); item->updateRepr(); - sp_document_done( _desktop->doc() , SP_VERB_DIALOG_LAYERS, + SPDocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS, newValue? _("Unhide layer") : _("Hide layer")); } break; @@ -479,7 +479,7 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol ) row[_model->_colLocked] = newValue; item->setLocked( newValue ); item->updateRepr(); - sp_document_done( _desktop->doc() , SP_VERB_DIALOG_LAYERS, + SPDocumentUndo::done( _desktop->doc() , SP_VERB_DIALOG_LAYERS, newValue? _("Lock layer") : _("Unlock layer")); } break; diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 62ed4e639..d05790b3e 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -372,7 +372,7 @@ LivePathEffectEditor::onApply() LivePathEffect::Effect::createAndApply(data->key.c_str(), doc, item); - sp_document_done(doc, SP_VERB_DIALOG_LIVE_PATH_EFFECT, + SPDocumentUndo::done(doc, SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Create and apply path effect")); lpe_list_locked = false; @@ -390,7 +390,7 @@ LivePathEffectEditor::onRemove() if ( item && SP_IS_LPE_ITEM(item) ) { sp_lpe_item_remove_current_path_effect(SP_LPE_ITEM(item), false); - sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + SPDocumentUndo::done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Remove path effect") ); effect_list_reload(SP_LPE_ITEM(item)); @@ -406,7 +406,7 @@ void LivePathEffectEditor::onUp() if ( item && SP_IS_LPE_ITEM(item) ) { sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item)); - sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + SPDocumentUndo::done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Move path effect up") ); effect_list_reload(SP_LPE_ITEM(item)); @@ -422,7 +422,7 @@ void LivePathEffectEditor::onDown() if ( item && SP_IS_LPE_ITEM(item) ) { sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item)); - sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + SPDocumentUndo::done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Move path effect down") ); effect_list_reload(SP_LPE_ITEM(item)); @@ -461,7 +461,7 @@ void LivePathEffectEditor::on_visibility_toggled( Glib::ustring const& str ) /* FIXME: this explicit writing to SVG is wrong. The lpe_item should have a method to disable/enable an effect within its stack. * So one can call: lpe_item->setActive(lpeobjref->lpeobject); */ lpeobjref->lpeobject->get_lpe()->getRepr()->setAttribute("is_visible", newValue ? "true" : "false"); - sp_document_done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + SPDocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, newValue ? _("Activate path effect") : _("Deactivate path effect")); } } diff --git a/src/ui/dialog/session-player.cpp b/src/ui/dialog/session-player.cpp index 0e484c3f2..01560733f 100644 --- a/src/ui/dialog/session-player.cpp +++ b/src/ui/dialog/session-player.cpp @@ -171,7 +171,7 @@ SessionPlaybackDialogImpl::_respCallback(int resp) switch (result) { case Gtk::RESPONSE_OK: this->_sm->clearDocument(); - sp_document_done(sp_desktop_document(this->_desktop), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(this->_desktop), SP_VERB_NONE, /* TODO: annotate */ "session-player.cpp:186"); this->_sm->loadSessionFile(sessionfiledlg.get_filename()); this->_openfile.set_text(this->_sfp->filename()); diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 7f41c4d6b..7c6ced5aa 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -117,7 +117,7 @@ void SvgFontsDialog::AttrEntry::on_attr_changed(){ Glib::ustring undokey = "svgfonts:"; undokey += name; - sp_document_maybe_done(o->document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, + SPDocumentUndo::maybe_done(o->document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Set SVG Font attribute")); } @@ -163,7 +163,7 @@ void SvgFontsDialog::on_kerning_value_changed(){ if (!this->kerning_pair) return; SPDocument* document = sp_desktop_document(this->getDesktop()); - //TODO: I am unsure whether this is the correct way of calling sp_document_maybe_done + //TODO: I am unsure whether this is the correct way of calling SPDocumentUndo::maybe_done Glib::ustring undokey = "svgfonts:hkern:k:"; undokey += this->kerning_pair->u1->attribute_string(); undokey += ":"; @@ -171,7 +171,7 @@ void SvgFontsDialog::on_kerning_value_changed(){ //slider values increase from right to left so that they match the kerning pair preview this->kerning_pair->repr->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider.get_value()).c_str()); - sp_document_maybe_done(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value")); + SPDocumentUndo::maybe_done(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value")); //populate_kerning_pairs_box(); kerning_preview.redraw(); @@ -462,7 +462,7 @@ void SvgFontsDialog::add_glyph(){ SPDocument* doc = sp_desktop_document(this->getDesktop()); /* SPGlyph* glyph =*/ new_glyph(doc, get_selected_spfont(), count+1); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph")); update_glyphs(); } @@ -506,7 +506,7 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){ return; } glyph->repr->setAttribute("d", (char*) sp_svg_write_path (pathv)); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); update_glyphs(); } @@ -548,7 +548,7 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){ for (obj = get_selected_spfont()->children; obj; obj=obj->next){ if (SP_IS_MISSING_GLYPH(obj)){ obj->repr->setAttribute("d", (char*) sp_svg_write_path (pathv)); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph curves")); } } @@ -567,7 +567,7 @@ void SvgFontsDialog::reset_missing_glyph_description(){ for (obj = get_selected_spfont()->children; obj; obj=obj->next){ if (SP_IS_MISSING_GLYPH(obj)){ obj->repr->setAttribute("d", (char*) "M0,0h1000v1024h-1000z"); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Reset missing-glyph")); } } @@ -582,7 +582,7 @@ void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring& glyph->repr->setAttribute("glyph-name", str.c_str()); SPDocument* doc = sp_desktop_document(this->getDesktop()); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name")); update_glyphs(); } @@ -595,7 +595,7 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin glyph->repr->setAttribute("unicode", str.c_str()); SPDocument* doc = sp_desktop_document(this->getDesktop()); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode")); update_glyphs(); } @@ -605,7 +605,7 @@ void SvgFontsDialog::remove_selected_font(){ sp_repr_unparent(font->repr); SPDocument* doc = sp_desktop_document(this->getDesktop()); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font")); update_fonts(); } @@ -620,7 +620,7 @@ void SvgFontsDialog::remove_selected_glyph(){ sp_repr_unparent(glyph->repr); SPDocument* doc = sp_desktop_document(this->getDesktop()); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph")); update_glyphs(); } @@ -635,7 +635,7 @@ void SvgFontsDialog::remove_selected_kerning_pair(){ sp_repr_unparent(pair->repr); SPDocument* doc = sp_desktop_document(this->getDesktop()); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair")); update_glyphs(); } @@ -723,7 +723,7 @@ void SvgFontsDialog::add_kerning_pair(){ // get corresponding object this->kerning_pair = SP_HKERN( document->getObjectByRepr(repr) ); - sp_document_done(document, SP_VERB_DIALOG_SVG_FONTS, _("Add kerning pair")); + SPDocumentUndo::done(document, SP_VERB_DIALOG_SVG_FONTS, _("Add kerning pair")); } Gtk::VBox* SvgFontsDialog::kerning_tab(){ @@ -816,7 +816,7 @@ void set_font_family(SPFont* font, char* str){ } } - sp_document_done(font->document, SP_VERB_DIALOG_SVG_FONTS, _("Set font family")); + SPDocumentUndo::done(font->document, SP_VERB_DIALOG_SVG_FONTS, _("Set font family")); } void SvgFontsDialog::add_font(){ @@ -839,7 +839,7 @@ void SvgFontsDialog::add_font(){ update_fonts(); // select_font(font); - sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add font")); + SPDocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add font")); } SvgFontsDialog::SvgFontsDialog() diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index d5d48a528..62682d623 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -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 546fdd8f0..cf29ed77f 100644 --- a/src/ui/dialog/tile.cpp +++ b/src/ui/dialog/tile.cpp @@ -344,7 +344,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h g_slist_free (current_row); } - sp_document_done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE, + SPDocumentUndo::done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE, _("Arrange in a grid")); } diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index f74c5d6e0..62f0f38aa 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -677,7 +677,7 @@ Transformation::applyPageMove(Inkscape::Selection *selection) } } - sp_document_done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM, + SPDocumentUndo::done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM, _("Move")); } @@ -734,7 +734,7 @@ Transformation::applyPageScale(Inkscape::Selection *selection) } } - sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, _("Scale")); } @@ -756,7 +756,7 @@ Transformation::applyPageRotate(Inkscape::Selection *selection) } } - sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, _("Rotate")); } @@ -815,7 +815,7 @@ Transformation::applyPageSkew(Inkscape::Selection *selection) } } - sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, _("Skew")); } @@ -842,7 +842,7 @@ Transformation::applyPageTransform(Inkscape::Selection *selection) sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform } - sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + SPDocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, _("Edit transformation matrix")); } diff --git a/src/ui/dialog/undo-history.cpp b/src/ui/dialog/undo-history.cpp index 8017af803..9e0922072 100644 --- a/src/ui/dialog/undo-history.cpp +++ b/src/ui/dialog/undo-history.cpp @@ -214,7 +214,7 @@ UndoHistory::_onListSelectionChange() _event_log->blockNotifications(); for ( --last ; curr_event != last ; ++curr_event ) { - sp_document_redo(_document); + SPDocumentUndo::redo(_document); } _event_log->blockNotifications(false); @@ -248,7 +248,7 @@ UndoHistory::_onListSelectionChange() while ( selected != last_selected ) { - sp_document_undo(_document); + SPDocumentUndo::undo(_document); if ( last_selected->parent() && last_selected == last_selected->parent()->children().begin() ) @@ -273,7 +273,7 @@ UndoHistory::_onListSelectionChange() while ( selected != last_selected ) { - sp_document_redo(_document); + SPDocumentUndo::redo(_document); if ( !last_selected->children().empty() ) { _event_log->setCurrEventParent(last_selected); @@ -317,10 +317,10 @@ UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::T EventLog::const_iterator last = curr_event_parent->children().end(); _event_log->blockNotifications(); - sp_document_redo(_document); + SPDocumentUndo::redo(_document); for ( --last ; curr_event != last ; ++curr_event ) { - sp_document_redo(_document); + SPDocumentUndo::redo(_document); } _event_log->blockNotifications(false); diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 2025a12d7..a455567e8 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -662,9 +662,9 @@ void MultiPathManipulator::_commit(CommitEvent cps) _selection.signal_update.emit(); invokeForAll(&PathManipulator::writeXML); if (key) { - sp_document_maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, reason); + SPDocumentUndo::maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, reason); } else { - sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); + SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); } signal_coords_changed.emit(); } @@ -673,7 +673,7 @@ void MultiPathManipulator::_commit(CommitEvent cps) void MultiPathManipulator::_done(gchar const *reason) { invokeForAll(&PathManipulator::update); invokeForAll(&PathManipulator::writeXML); - sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); + SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); signal_coords_changed.emit(); } diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 8e37b2c85..dec37cd1c 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -1387,13 +1387,13 @@ void PathManipulator::_removeNodesFromSelection() void PathManipulator::_commit(Glib::ustring const &annotation) { writeXML(); - sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, annotation.data()); + SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, annotation.data()); } void PathManipulator::_commit(Glib::ustring const &annotation, gchar const *key) { writeXML(); - sp_document_maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, + SPDocumentUndo::maybe_done(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, annotation.data()); } diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp index 34cf1d5e3..48dd59685 100644 --- a/src/ui/widget/color-picker.cpp +++ b/src/ui/widget/color-picker.cpp @@ -132,7 +132,7 @@ sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) (ptr->_preview).setRgba32 (rgba); if (ptr->_undo && SP_ACTIVE_DESKTOP) - sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, /* TODO: annotate */ "color-picker.cpp:130"); ptr->on_changed (rgba); diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index e9f09f574..cc38de24f 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -96,7 +96,7 @@ EntityLineEntry::on_changed() SPDocument *doc = SP_ACTIVE_DOCUMENT; Glib::ustring text = static_cast<Gtk::Entry*>(_packable)->get_text(); if (rdf_set_work_entity (doc, _entity, text.c_str())) - sp_document_done (doc, SP_VERB_NONE, + SPDocumentUndo::done (doc, SP_VERB_NONE, /* TODO: annotate */ "entity-entry.cpp:101"); _wr->setUpdating (false); } @@ -141,7 +141,7 @@ EntityMultiLineEntry::on_changed() Gtk::TextView *tv = static_cast<Gtk::TextView*>(s->get_child()); Glib::ustring text = tv->get_buffer()->get_text(); if (rdf_set_work_entity (doc, _entity, text.c_str())) - sp_document_done (doc, SP_VERB_NONE, + SPDocumentUndo::done (doc, SP_VERB_NONE, /* TODO: annotate */ "entity-entry.cpp:146"); _wr->setUpdating (false); } diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp index f25192b2a..da096f25d 100644 --- a/src/ui/widget/layer-selector.cpp +++ b/src/ui/widget/layer-selector.cpp @@ -583,7 +583,7 @@ void LayerSelector::_prepareLabelRenderer( void LayerSelector::_lockLayer(bool lock) { if ( _layer && SP_IS_ITEM(_layer) ) { SP_ITEM(_layer)->setLocked(lock); - sp_document_done(sp_desktop_document(_desktop), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_NONE, lock? _("Lock layer") : _("Unlock layer")); } } @@ -591,7 +591,7 @@ void LayerSelector::_lockLayer(bool lock) { void LayerSelector::_hideLayer(bool hide) { if ( _layer && SP_IS_ITEM(_layer) ) { SP_ITEM(_layer)->setHidden(hide); - sp_document_done(sp_desktop_document(_desktop), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_NONE, hide? _("Hide layer") : _("Unhide layer")); } } diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index a5f1d89be..a4a789840 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -64,7 +64,7 @@ LicenseItem::on_toggled() _wr.setUpdating (true); rdf_set_license (SP_ACTIVE_DOCUMENT, _lic->details ? _lic : 0); - sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, + SPDocumentUndo::done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, /* TODO: annotate */ "licensor.cpp:65"); _wr.setUpdating (false); static_cast<Gtk::Entry*>(_eep->_packable)->set_text (_lic->uri); diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index bfc291bc0..f5e4657b1 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -168,7 +168,7 @@ ObjectCompositeSettings::_blendBlurValueChanged() SP_OBJECT_STYLE_MODIFIED_FLAG )); } - sp_document_maybe_done (document, _blur_tag.c_str(), _verb_code, + SPDocumentUndo::maybe_done (document, _blur_tag.c_str(), _verb_code, _("Change blur")); // resume interruptibility @@ -208,7 +208,7 @@ ObjectCompositeSettings::_opacityValueChanged() sp_repr_css_attr_unref (css); - sp_document_maybe_done (sp_desktop_document (desktop), _opacity_tag.c_str(), _verb_code, + SPDocumentUndo::maybe_done (sp_desktop_document (desktop), _opacity_tag.c_str(), _verb_code, _("Change opacity")); // resume interruptibility diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 1f70a26fd..33adc85d0 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -413,7 +413,7 @@ PageSizer::setDim (double w, double h, bool changeList) // changing the page size. The SVG's origin however is in the upper left corner, so we must compensate for this Geom::Translate const vert_offset(Geom::Point(0, (old_height - h))); SP_GROUP(SP_ROOT(doc->root))->translateChildItems(vert_offset); - sp_document_done (doc, SP_VERB_NONE, _("Set page size")); + SPDocumentUndo::done (doc, SP_VERB_NONE, _("Set page size")); } if ( w != h ) { diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index db31d08d3..16422f1b2 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -349,14 +349,14 @@ RegisteredColorPicker::on_changed (guint32 rgba) gchar c[32]; sp_svg_write_color(c, sizeof(c), rgba); - bool saved = sp_document_get_undo_sensitive (local_doc); - sp_document_set_undo_sensitive (local_doc, false); + bool saved = SPDocumentUndo::get_undo_sensitive (local_doc); + SPDocumentUndo::set_undo_sensitive (local_doc, false); local_repr->setAttribute(_ckey.c_str(), c); sp_repr_set_css_double(local_repr, _akey.c_str(), (rgba & 0xff) / 255.0); - sp_document_set_undo_sensitive (local_doc, saved); + SPDocumentUndo::set_undo_sensitive (local_doc, saved); local_doc->setModifiedSinceSave(); - sp_document_done (local_doc, SP_VERB_NONE, + SPDocumentUndo::done (local_doc, SP_VERB_NONE, /* TODO: annotate */ "registered-widget.cpp: RegisteredColorPicker::on_changed"); _wr->setUpdating (false); diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index 7aefbb90e..dec8cd111 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -104,16 +104,16 @@ protected: local_doc = sp_desktop_document(dt); } - bool saved = sp_document_get_undo_sensitive (local_doc); - sp_document_set_undo_sensitive (local_doc, false); + bool saved = SPDocumentUndo::get_undo_sensitive (local_doc); + SPDocumentUndo::set_undo_sensitive (local_doc, false); if (!write_undo) local_repr->setAttribute(_key.c_str(), svgstr); - sp_document_set_undo_sensitive (local_doc, saved); + SPDocumentUndo::set_undo_sensitive (local_doc, saved); local_doc->setModifiedSinceSave(); if (write_undo) { local_repr->setAttribute(_key.c_str(), svgstr); - sp_document_done (local_doc, event_type, event_description); + SPDocumentUndo::done (local_doc, event_type, event_description); } } diff --git a/src/ui/widget/ruler.cpp b/src/ui/widget/ruler.cpp index 0afc0da3e..9fac48145 100644 --- a/src/ui/widget/ruler.cpp +++ b/src/ui/widget/ruler.cpp @@ -152,7 +152,7 @@ Ruler::on_button_release_event(GdkEventButton *evb) sp_repr_set_svg_double(repr, "position", guide_pos_dt); SP_OBJECT_REPR(_dt->namedview)->appendChild(repr); Inkscape::GC::release(repr); - sp_document_done(sp_desktop_document(_dt), SP_VERB_NONE, + SPDocumentUndo::done(sp_desktop_document(_dt), SP_VERB_NONE, /* TODO: annotate */ "ruler.cpp:157"); } _dt->set_coordinate_status(event_dt); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index a8f9f9c60..9a94113eb 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -464,7 +464,7 @@ void SelectedStyle::dragDataReceived( GtkWidget */*widget*/, sp_repr_css_set_property( css, (tracker->item == SS_FILL) ? "fill":"stroke", c ); sp_desktop_set_style( tracker->parent->_desktop, css ); sp_repr_css_attr_unref( css ); - sp_document_done( sp_desktop_document(tracker->parent->_desktop) , SP_VERB_NONE, + SPDocumentUndo::done( sp_desktop_document(tracker->parent->_desktop) , SP_VERB_NONE, _("Drop color")); } } @@ -477,7 +477,7 @@ void SelectedStyle::on_fill_remove() { sp_repr_css_set_property (css, "fill", "none"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Remove fill")); } @@ -486,7 +486,7 @@ void SelectedStyle::on_stroke_remove() { sp_repr_css_set_property (css, "stroke", "none"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Remove stroke")); } @@ -495,7 +495,7 @@ void SelectedStyle::on_fill_unset() { sp_repr_css_unset_property (css, "fill"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Unset fill")); } @@ -511,7 +511,7 @@ void SelectedStyle::on_stroke_unset() { sp_repr_css_unset_property (css, "stroke-dasharray"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Unset stroke")); } @@ -520,7 +520,7 @@ void SelectedStyle::on_fill_opaque() { sp_repr_css_set_property (css, "fill-opacity", "1"); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Make fill opaque")); } @@ -529,7 +529,7 @@ void SelectedStyle::on_stroke_opaque() { sp_repr_css_set_property (css, "stroke-opacity", "1"); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Make fill opaque")); } @@ -541,7 +541,7 @@ void SelectedStyle::on_fill_lastused() { sp_repr_css_set_property (css, "fill", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Apply last set color to fill")); } @@ -553,7 +553,7 @@ void SelectedStyle::on_stroke_lastused() { sp_repr_css_set_property (css, "stroke", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Apply last set color to stroke")); } @@ -564,7 +564,7 @@ void SelectedStyle::on_fill_lastselected() { sp_repr_css_set_property (css, "fill", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Apply last selected color to fill")); } @@ -575,7 +575,7 @@ void SelectedStyle::on_stroke_lastselected() { sp_repr_css_set_property (css, "stroke", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Apply last selected color to stroke")); } @@ -595,7 +595,7 @@ void SelectedStyle::on_fill_invert() { sp_repr_css_set_property (css, "fill", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Invert fill")); } @@ -615,7 +615,7 @@ void SelectedStyle::on_stroke_invert() { sp_repr_css_set_property (css, "stroke", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Invert stroke")); } @@ -627,7 +627,7 @@ void SelectedStyle::on_fill_white() { sp_repr_css_set_property (css, "fill-opacity", "1"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("White fill")); } @@ -639,7 +639,7 @@ void SelectedStyle::on_stroke_white() { sp_repr_css_set_property (css, "stroke-opacity", "1"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("White stroke")); } @@ -651,7 +651,7 @@ void SelectedStyle::on_fill_black() { sp_repr_css_set_property (css, "fill-opacity", "1.0"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Black fill")); } @@ -663,7 +663,7 @@ void SelectedStyle::on_stroke_black() { sp_repr_css_set_property (css, "stroke-opacity", "1.0"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Black stroke")); } @@ -706,7 +706,7 @@ void SelectedStyle::on_fill_paste() { sp_repr_css_set_property (css, "fill", text.c_str()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Paste fill")); } } @@ -724,7 +724,7 @@ void SelectedStyle::on_stroke_paste() { sp_repr_css_set_property (css, "stroke", text.c_str()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Paste stroke")); } } @@ -778,7 +778,7 @@ void SelectedStyle::on_fillstroke_swap() { sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Swap fill and stroke")); } @@ -853,7 +853,7 @@ SelectedStyle::on_opacity_click(GdkEventButton *event) sp_repr_css_set_property (css, "opacity", opacity); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document (_desktop), SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::done (sp_desktop_document (_desktop), SP_VERB_DIALOG_FILL_STROKE, _("Change opacity")); return true; } @@ -888,7 +888,7 @@ void SelectedStyle::on_popup_preset(int i) { // FIXME: update dash patterns! sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_SWATCHES, + SPDocumentUndo::done (sp_desktop_document(_desktop), SP_VERB_DIALOG_SWATCHES, _("Change stroke width")); } @@ -1147,7 +1147,7 @@ void SelectedStyle::on_opacity_changed () { sp_canvas_force_full_redraw_after_interruptions(sp_desktop_canvas(_desktop), 0); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_maybe_done (sp_desktop_document (_desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE, + SPDocumentUndo::maybe_done (sp_desktop_document (_desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE, _("Change opacity")); // resume interruptibility sp_canvas_end_forced_full_redraws(sp_desktop_canvas(_desktop)); @@ -1274,19 +1274,19 @@ RotateableSwatch::do_motion(double by, guint modifier) { if (modifier == 3) { // Alt, do nothing } else if (modifier == 2) { // saturation - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust saturation"))); double ch = hsl[1]; parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>saturation</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, without modifiers to adjust hue"), ch - diff, ch, diff); } else if (modifier == 1) { // lightness - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust lightness"))); double ch = hsl[2]; parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>lightness</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, without modifiers to adjust hue"), ch - diff, ch, diff); } else { // hue - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust hue"))); double ch = hsl[0]; parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>hue</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Shift</b> to adjust saturation, with <b>Ctrl</b> to adjust lightness"), ch - diff, ch, diff); @@ -1315,15 +1315,15 @@ RotateableSwatch::do_release(double by, guint modifier) { if (modifier == 3) { // Alt, do nothing } else if (modifier == 2) { // saturation - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust saturation")); } else if (modifier == 1) { // lightness - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust lightness")); } else { // hue - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust hue")); } @@ -1397,7 +1397,7 @@ RotateableStrokeWidth::do_motion(double by, guint modifier) { if (modifier == 3) { // Alt, do nothing } else { double diff = value_adjust(startvalue, by, modifier, false); - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width"))); parent->getDesktop()->event_context->_message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>stroke width</b>: was %.3g, now <b>%.3g</b> (diff %.3g)"), startvalue, startvalue + diff, diff); } @@ -1411,7 +1411,7 @@ RotateableStrokeWidth::do_release(double by, guint modifier) { } else { value_adjust(startvalue, by, modifier, true); startvalue_set = false; - sp_document_maybe_done (sp_desktop_document(parent->getDesktop()), undokey, + SPDocumentUndo::maybe_done (sp_desktop_document(parent->getDesktop()), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width"))); } diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index 3a36127f4..84c6a0de2 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -186,11 +186,11 @@ ToleranceSlider::update (double val) _wr->setUpdating (true); SPDocument *doc = sp_desktop_document(dt); - bool saved = sp_document_get_undo_sensitive (doc); - sp_document_set_undo_sensitive (doc, false); + bool saved = SPDocumentUndo::get_undo_sensitive (doc); + SPDocumentUndo::set_undo_sensitive (doc, false); Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); repr->setAttribute(_key.c_str(), os.str().c_str()); - sp_document_set_undo_sensitive (doc, saved); + SPDocumentUndo::set_undo_sensitive (doc, saved); doc->setModifiedSinceSave(); |
