diff options
Diffstat (limited to 'src/ui')
77 files changed, 305 insertions, 305 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 310df419e..c2465932b 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -37,7 +37,7 @@ #include "inkscape.h" #include "io/stringstream.h" #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-style.h" // for sp_desktop_set_style, used in _pasteStyle #include "document.h" #include "document-private.h" diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 94e524157..65bc94011 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -24,7 +24,7 @@ #include "align-and-distribute.h" #include <2geom/transforms.h> #include "ui/widget/spinbutton.h" -#include "desktop-handles.h" + #include "unclump.h" #include "document.h" #include "enums.h" @@ -123,10 +123,10 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) focus = selection->smallestItem(horiz); break; case PAGE: - b = sp_desktop_document(desktop)->preferredBounds(); + b = desktop->getDocument()->preferredBounds(); break; case DRAWING: - b = sp_desktop_document(desktop)->getRoot()->desktopPreferredBounds(); + b = desktop->getDocument()->getRoot()->desktopPreferredBounds(); break; case SELECTION: b = selection->preferredBounds(); @@ -152,7 +152,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) for (std::list<SPItem *>::iterator it(selected.begin()); it != selected.end(); ++it) { - sp_desktop_document (desktop)->ensureUpToDate(); + desktop->getDocument()->ensureUpToDate(); if (!sel_as_group) b = (*it)->desktopPreferredBounds(); if (b && (!focus || (*it) != focus)) { @@ -167,7 +167,7 @@ void ActionAlign::do_action(SPDesktop *desktop, int index) } if (changed) { - DocumentUndo::done( sp_desktop_document(desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done( desktop->getDocument() , SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Align")); } } @@ -337,7 +337,7 @@ private : prefs->setInt("/options/clonecompensation/value", saved_compensation); if (changed) { - DocumentUndo::done( sp_desktop_document(desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done( desktop->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Distribute")); } } @@ -463,7 +463,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(_dialog.getDesktop()->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Remove overlaps")); } }; @@ -494,7 +494,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(_dialog.getDesktop()->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Arrange connector network")); } }; @@ -587,7 +587,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(_dialog.getDesktop()->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Exchange Positions")); } }; @@ -621,7 +621,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(_dialog.getDesktop()->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Unclump")); } }; @@ -676,7 +676,7 @@ private : it != selected.end(); ++it) { - sp_desktop_document (desktop)->ensureUpToDate(); + desktop->getDocument()->ensureUpToDate(); Geom::OptRect item_box = !prefs_bbox ? (*it)->desktopVisualBounds() : (*it)->desktopGeometricBounds(); if (item_box) { // find new center, staying within bbox @@ -693,7 +693,7 @@ private : // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Randomize positions")); } }; @@ -796,7 +796,7 @@ private : } if (changed) { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Distribute text baselines")); } @@ -819,7 +819,7 @@ private : } if (changed) { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, _("Align text baselines")); } } diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index aa373e4f7..fede30b26 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -27,7 +27,7 @@ #include <gtkmm/adjustment.h> #include "desktop.h" -#include "desktop-handles.h" + #include "display/cairo-utils.h" #include "display/drawing.h" #include "display/drawing-context.h" @@ -2112,13 +2112,13 @@ void CloneTiler::clonetiler_unclump(GtkWidget */*widget*/, void *) } } - sp_desktop_document(desktop)->ensureUpToDate(); + desktop->getDocument()->ensureUpToDate(); unclump (to_unclump); g_slist_free (to_unclump); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER, + DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_CLONETILER, _("Unclump tiled clones")); } @@ -2172,7 +2172,7 @@ void CloneTiler::clonetiler_remove(GtkWidget */*widget*/, GtkWidget *dlg, bool d clonetiler_change_selection (selection, dlg); if (do_undo) { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER, + DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_CLONETILER, _("Delete tiled clones")); } } @@ -2251,7 +2251,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) clonetiler_remove (NULL, dlg, false); - double scale_units = Inkscape::Util::Quantity::convert(1, "px", &sp_desktop_document(desktop)->getSVGUnit()); + double scale_units = Inkscape::Util::Quantity::convert(1, "px", &desktop->getDocument()->getSVGUnit()); double shiftx_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shiftx_per_i", 0, -10000, 10000); double shifty_per_i = 0.01 * prefs->getDoubleLimited(prefs_path + "shifty_per_i", 0, -10000, 10000); @@ -2337,7 +2337,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) SPItem *item = dynamic_cast<SPItem *>(obj); if (dotrace) { - clonetiler_trace_setup (sp_desktop_document(desktop), 1.0, item); + clonetiler_trace_setup (desktop->getDocument(), 1.0, item); } Geom::Point center; @@ -2611,21 +2611,21 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) parent->getRepr()->appendChild(clone); if (blur > 0.0) { - SPObject *clone_object = sp_desktop_document(desktop)->getObjectByRepr(clone); + SPObject *clone_object = desktop->getDocument()->getObjectByRepr(clone); double perimeter = perimeter_original * t.descrim(); double radius = blur * perimeter; // this is necessary for all newly added clones to have correct bboxes, // otherwise filters won't work: - sp_desktop_document(desktop)->ensureUpToDate(); + desktop->getDocument()->ensureUpToDate(); // it's hard to figure out exact width/height of the tile without having an object // that we can take bbox of; however here we only need a lower bound so that blur // margins are not too small, and the perimeter should work - SPFilter *constructed = new_filter_gaussian_blur(sp_desktop_document(desktop), radius, t.descrim(), t.expansionX(), t.expansionY(), perimeter, perimeter); + SPFilter *constructed = new_filter_gaussian_blur(desktop->getDocument(), radius, t.descrim(), t.expansionX(), t.expansionY(), perimeter, perimeter); sp_style_set_property_url (clone_object, "filter", constructed, false); } if (center_set) { - SPObject *clone_object = sp_desktop_document(desktop)->getObjectByRepr(clone); + SPObject *clone_object = desktop->getDocument()->getObjectByRepr(clone); SPItem *item = dynamic_cast<SPItem *>(clone_object); if (clone_object && item) { clone_object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); @@ -2647,7 +2647,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) desktop->clearWaitingCursor(); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER, + DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_CLONETILER, _("Create tiled clones")); } diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index bab7e18e1..a49a47d5c 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -29,7 +29,7 @@ #include "color-item.h" #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "display/cairo-utils.h" #include "document.h" @@ -476,7 +476,7 @@ void ColorItem::_updatePreviews() { SPDesktop *desktop = SP_ACTIVE_DESKTOP; if ( desktop ) { - SPDocument* document = sp_desktop_document( desktop ); + SPDocument* document = desktop->getDocument(); Inkscape::XML::Node *rroot = document->getReprRoot(); if ( rroot ) { @@ -706,7 +706,7 @@ void ColorItem::buttonClicked(bool secondary) sp_desktop_set_style(desktop, css); sp_repr_css_attr_unref(css); - DocumentUndo::done( sp_desktop_document(desktop), SP_VERB_DIALOG_SWATCHES, descr.c_str() ); + DocumentUndo::done( desktop->getDocument(), SP_VERB_DIALOG_SWATCHES, descr.c_str() ); } } diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 6d8fe4b12..27d88bae7 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -25,7 +25,7 @@ #include "inkscape.h" #include "ui/tools/tool-base.h" #include "desktop.h" -#include "desktop-handles.h" + #include "shortcuts.h" #include "preferences.h" #include "ui/interface.h" diff --git a/src/ui/dialog/document-metadata.cpp b/src/ui/dialog/document-metadata.cpp index dc7f8158e..da1facc08 100644 --- a/src/ui/dialog/document-metadata.cpp +++ b/src/ui/dialog/document-metadata.cpp @@ -20,7 +20,7 @@ #include "document-metadata.h" #include "desktop.h" -#include "desktop-handles.h" + #include "inkscape.h" #include "rdf.h" #include "sp-namedview.h" diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 1d15ad32b..af7ca678a 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -26,7 +26,7 @@ #include "document-properties.h" #include "display/canvas-grid.h" #include "document.h" -#include "desktop-handles.h" + #include "desktop.h" #include "inkscape.h" #include "io/sys.h" @@ -188,7 +188,7 @@ void DocumentProperties::init() Inkscape::XML::Node *repr = getDesktop()->getNamedView()->getRepr(); repr->addListener (&_repr_events, this); - Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->getRoot()->getRepr(); + Inkscape::XML::Node *root = getDesktop()->getDocument()->getRoot()->getRepr(); root->addListener (&_repr_events, this); show_all_children(); @@ -199,7 +199,7 @@ DocumentProperties::~DocumentProperties() { Inkscape::XML::Node *repr = getDesktop()->getNamedView()->getRepr(); repr->removeListenerByData (this); - Inkscape::XML::Node *root = sp_desktop_document(getDesktop())->getRoot()->getRepr(); + Inkscape::XML::Node *root = getDesktop()->getDocument()->getRoot()->getRepr(); root->removeListenerByData (this); for (RDElist::iterator it = _rdflist.begin(); it != _rdflist.end(); ++it) @@ -1484,21 +1484,21 @@ void DocumentProperties::update() _rum_deflt.setUnit (nv->display_units->abbr); } - double doc_w = sp_desktop_document(dt)->getRoot()->width.value; - Glib::ustring doc_w_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->width.unit)->abbr; + double doc_w = dt->getDocument()->getRoot()->width.value; + Glib::ustring doc_w_unit = unit_table.getUnit(dt->getDocument()->getRoot()->width.unit)->abbr; if (doc_w_unit == "") { doc_w_unit = "px"; - } else if (doc_w_unit == "%" && sp_desktop_document(dt)->getRoot()->viewBox_set) { + } else if (doc_w_unit == "%" && dt->getDocument()->getRoot()->viewBox_set) { doc_w_unit = "px"; - doc_w = sp_desktop_document(dt)->getRoot()->viewBox.width(); + doc_w = dt->getDocument()->getRoot()->viewBox.width(); } - double doc_h = sp_desktop_document(dt)->getRoot()->height.value; - Glib::ustring doc_h_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->height.unit)->abbr; + double doc_h = dt->getDocument()->getRoot()->height.value; + Glib::ustring doc_h_unit = unit_table.getUnit(dt->getDocument()->getRoot()->height.unit)->abbr; if (doc_h_unit == "") { doc_h_unit = "px"; - } else if (doc_h_unit == "%" && sp_desktop_document(dt)->getRoot()->viewBox_set) { + } else if (doc_h_unit == "%" && dt->getDocument()->getRoot()->viewBox_set) { doc_h_unit = "px"; - doc_h = sp_desktop_document(dt)->getRoot()->viewBox.height(); + doc_h = dt->getDocument()->getRoot()->viewBox.height(); } _page_sizer.setDim(Inkscape::Util::Quantity(doc_w, doc_w_unit), Inkscape::Util::Quantity(doc_h, doc_h_unit)); _page_sizer.updateFitMarginsUI(nv->getRepr()); @@ -1603,7 +1603,7 @@ void DocumentProperties::_handleActivateDesktop(SPDesktop *desktop) { Inkscape::XML::Node *repr = desktop->getNamedView()->getRepr(); repr->addListener(&_repr_events, this); - Inkscape::XML::Node *root = sp_desktop_document(desktop)->getRoot()->getRepr(); + Inkscape::XML::Node *root = desktop->getDocument()->getRoot()->getRepr(); root->addListener(&_repr_events, this); update(); } @@ -1612,7 +1612,7 @@ void DocumentProperties::_handleDeactivateDesktop(SPDesktop *desktop) { Inkscape::XML::Node *repr = desktop->getNamedView()->getRepr(); repr->removeListenerByData(this); - Inkscape::XML::Node *root = sp_desktop_document(desktop)->getRoot()->getRepr(); + Inkscape::XML::Node *root = desktop->getDocument()->getRoot()->getRepr(); root->removeListenerByData(this); } @@ -1648,7 +1648,7 @@ void DocumentProperties::onNewGrid() { SPDesktop *dt = getDesktop(); Inkscape::XML::Node *repr = dt->getNamedView()->getRepr(); - SPDocument *doc = sp_desktop_document(dt); + SPDocument *doc = dt->getDocument(); Glib::ustring typestring = _grids_combo_gridtype.get_active_text(); CanvasGrid::writeNewGridToRepr(repr, doc, CanvasGrid::getGridTypeFromName(typestring.c_str())); @@ -1679,7 +1679,7 @@ void 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); - DocumentUndo::done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid")); + DocumentUndo::done(dt->getDocument(), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid")); } } diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 11dfa2db5..6d90c792e 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -54,7 +54,7 @@ #include "inkscape.h" #include "document.h" #include "document-undo.h" -#include "desktop-handles.h" + #include "sp-item.h" #include "selection.h" #include "file.h" @@ -101,7 +101,6 @@ #define EXPORT_COORD_PRECISION 3 -#include "../../desktop-handles.h" #include "../../document.h" #include "../../document-undo.h" #include "verbs.h" @@ -685,7 +684,7 @@ void Export::onSelectionModified ( guint /*flags*/ ) case SELECTION_DRAWING: if ( SP_ACTIVE_DESKTOP ) { SPDocument *doc; - doc = sp_desktop_document (SP_ACTIVE_DESKTOP); + doc = SP_ACTIVE_DESKTOP->getDocument(); Geom::OptRect bbox = doc->getRoot()->desktopVisualBounds(); if (bbox) { setArea ( bbox->left(), @@ -736,7 +735,7 @@ void Export::onAreaToggled () SPDocument *doc; Geom::OptRect bbox; bbox = Geom::Rect(Geom::Point(0.0, 0.0),Geom::Point(0.0, 0.0)); - doc = sp_desktop_document (SP_ACTIVE_DESKTOP); + doc = SP_ACTIVE_DESKTOP->getDocument(); /* Notice how the switch is used to 'fall through' here to get various backups. If you modify this without noticing you'll @@ -1003,7 +1002,7 @@ void Export::onExport () if (!desktop) return; SPNamedView *nv = desktop->getNamedView(); - SPDocument *doc = sp_desktop_document (desktop); + SPDocument *doc = desktop->getDocument(); bool exportSuccessful = false; @@ -1154,7 +1153,7 @@ void Export::onExport () prog_dlg->set_data("total", GINT_TO_POINTER(0)); /* Do export */ - ExportResult status = sp_export_png_file(sp_desktop_document(desktop), path.c_str(), + ExportResult status = sp_export_png_file(desktop->getDocument(), path.c_str(), Geom::Rect(Geom::Point(x0, y0), Geom::Point(x1, y1)), width, height, xdpi, ydpi, nv->pagecolor, onProgressCallback, (void*)prog_dlg, @@ -1472,7 +1471,7 @@ void Export::detectSize() { } break; case SELECTION_DRAWING: { - SPDocument *doc = sp_desktop_document (SP_ACTIVE_DESKTOP); + SPDocument *doc = SP_ACTIVE_DESKTOP->getDocument(); Geom::OptRect bbox = doc->getRoot()->desktopVisualBounds(); @@ -1485,7 +1484,7 @@ void Export::detectSize() { case SELECTION_PAGE: { SPDocument *doc; - doc = sp_desktop_document (SP_ACTIVE_DESKTOP); + doc = SP_ACTIVE_DESKTOP->getDocument(); Geom::Point x(0.0, 0.0); Geom::Point y(doc->getWidth().value("px"), diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index c55d55cda..8141f7696 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -16,7 +16,7 @@ */ #include "ui/widget/notebook-page.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "document.h" #include "fill-and-stroke.h" diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 228570c88..3da0e0043 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -33,7 +33,7 @@ #include <glibmm/stringutils.h> #include "desktop.h" -#include "desktop-handles.h" + #include "dir-util.h" #include "document.h" #include "document-undo.h" @@ -1416,7 +1416,7 @@ void FilterEffectsDialog::FilterModifier::setTargetDesktop(SPDesktop *desktop) _selectModifiedConn = desktop->selection->connectModified(sigc::hide<0>(sigc::mem_fun(*this, &FilterModifier::on_modified_selection))); } _doc_replaced = desktop->connectDocumentReplaced( sigc::mem_fun(*this, &FilterModifier::on_document_replaced)); - _resource_changed = sp_desktop_document(desktop)->connectResourcesChanged("filter",sigc::mem_fun(*this, &FilterModifier::update_filters)); + _resource_changed = desktop->getDocument()->connectResourcesChanged("filter",sigc::mem_fun(*this, &FilterModifier::update_filters)); _dialog.setDesktop(desktop); update_filters(); @@ -1537,7 +1537,7 @@ void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustri if(iter) { SPDesktop *desktop = _dialog.getDesktop(); - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = desktop->getDocument(); SPFilter* filter = (*iter)[_columns.filter]; Inkscape::Selection *sel = desktop->getSelection(); @@ -1571,7 +1571,7 @@ void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustri void FilterEffectsDialog::FilterModifier::update_filters() { SPDesktop* desktop = _dialog.getDesktop(); - SPDocument* document = sp_desktop_document(desktop); + SPDocument* document = desktop->getDocument(); const GSList* filters = document->getResourceList("filter"); _model->clear(); @@ -1627,7 +1627,7 @@ void FilterEffectsDialog::FilterModifier::filter_list_button_release(GdkEventBut void FilterEffectsDialog::FilterModifier::add_filter() { - SPDocument* doc = sp_desktop_document(_dialog.getDesktop()); + SPDocument* doc = _dialog.getDesktop()->getDocument(); SPFilter* filter = new_filter(doc); const int count = _model->children().size(); @@ -1937,7 +1937,7 @@ void FilterEffectsDialog::PrimitiveList::remove_selected() //XML Tree being used directly here while it shouldn't be. sp_repr_unparent(prim->getRepr()); - DocumentUndo::done(sp_desktop_document(_dialog.getDesktop()), SP_VERB_DIALOG_FILTER_EFFECTS, + DocumentUndo::done(_dialog.getDesktop()->getDocument(), SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter primitive")); update(); diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index be8250f88..6d8d64607 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -29,7 +29,7 @@ #include "document.h" #include "document-undo.h" #include "selection.h" -#include "desktop-handles.h" + #include "ui/dialog-events.h" #include "verbs.h" @@ -824,7 +824,7 @@ void Find::onAction() if (check_scope_layer.get_active()) { l = all_items (desktop->currentLayer(), l, hidden, locked); } else { - l = all_items(sp_desktop_document(desktop)->getRoot(), l, hidden, locked); + l = all_items(desktop->getDocument()->getRoot(), l, hidden, locked); } } guint all = g_slist_length (l); @@ -859,7 +859,7 @@ void Find::onAction() scroll_to_show_item(desktop, item); if (_action_replace) { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Replace text or property")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Replace text or property")); } } else { diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp index 82253417a..ae03bdf0e 100644 --- a/src/ui/dialog/font-substitution.cpp +++ b/src/ui/dialog/font-substitution.cpp @@ -28,7 +28,7 @@ #include "selection.h" #include "ui/dialog-events.h" -#include "desktop-handles.h" + #include "selection-chemistry.h" #include "preferences.h" diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index d60778bd0..d3ccb9bde 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -31,7 +31,7 @@ #include "verbs.h" #include "preferences.h" #include "inkscape.h" -#include "desktop-handles.h" + #include "selection.h" #include "document.h" #include "document-undo.h" @@ -165,7 +165,7 @@ void GridArrangeTab::arrange() grid_top = 99999; SPDesktop *desktop = Parent->getDesktop(); - sp_desktop_document(desktop)->ensureUpToDate(); + desktop->getDocument()->ensureUpToDate(); Inkscape::Selection *selection = desktop->getSelection(); const GSList *items = selection ? selection->itemList() : 0; @@ -347,7 +347,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h g_slist_free (current_row); } - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_SELECTION_ARRANGE, + DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_ARRANGE, _("Arrange in a grid")); } diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 221f9a1c0..af8e2cc31 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -24,7 +24,7 @@ #include "document-undo.h" #include "sp-guide.h" #include "sp-namedview.h" -#include "desktop-handles.h" + #include "ui/tools/tool-base.h" #include "widgets/desktop-widget.h" #include <glibmm/i18n.h> diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 25520ba8b..b908a90cb 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -35,7 +35,7 @@ #include "ui/widget/frame.h" #include "desktop.h" -#include "desktop-handles.h" + #include "display/drawing.h" #include "document.h" #include "inkscape.h" diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 31dddda7c..8d507d037 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -32,7 +32,7 @@ #include "util/units.h" #include <iostream> #include "enums.h" -#include "desktop-handles.h" + #include "extension/internal/gdkpixbuf-input.h" #include "message-stack.h" #include "style.h" diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index 779aa47fe..1b8fbb3f7 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -23,7 +23,7 @@ #include "document-undo.h" #include "layer-manager.h" #include "message-stack.h" -#include "desktop-handles.h" + #include "sp-object.h" #include "sp-item.h" #include "verbs.h" @@ -132,7 +132,7 @@ LayerPropertiesDialog::_apply() g_assert(_strategy != NULL); _strategy->perform(*this); - DocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), SP_VERB_NONE, _("Add layer")); _close(); @@ -364,7 +364,7 @@ void LayerPropertiesDialog::Rename::perform(LayerPropertiesDialog &dialog) { (gchar *)name.c_str(), FALSE ); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, + DocumentUndo::done(desktop->getDocument(), 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/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 2e96193b9..3b87597c8 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -23,7 +23,7 @@ #include <vector> #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "gtkmm/widget.h" @@ -510,7 +510,7 @@ LivePathEffectEditor::onRemove() if ( lpeitem ) { lpeitem->removeCurrentPathEffect(false); - DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Remove path effect") ); effect_list_reload(lpeitem); @@ -528,7 +528,7 @@ void LivePathEffectEditor::onUp() if ( lpeitem ) { lpeitem->upCurrentPathEffect(); - DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Move path effect up") ); effect_list_reload(lpeitem); @@ -545,7 +545,7 @@ void LivePathEffectEditor::onDown() if ( lpeitem ) { lpeitem->downCurrentPathEffect(); - DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Move path effect down") ); effect_list_reload(lpeitem); @@ -584,7 +584,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"); - DocumentUndo::done( sp_desktop_document(current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, + DocumentUndo::done( current_desktop->getDocument(), SP_VERB_DIALOG_LIVE_PATH_EFFECT, newValue ? _("Activate path effect") : _("Deactivate path effect")); } } diff --git a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp index 55a19fc51..1ca84e6b3 100644 --- a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp +++ b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp @@ -23,7 +23,7 @@ #include "document-undo.h" #include "layer-manager.h" #include "message-stack.h" -#include "desktop-handles.h" + #include "sp-object.h" #include "sp-item.h" #include "verbs.h" diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp index 55f938a48..a9e57970d 100644 --- a/src/ui/dialog/lpe-powerstroke-properties.cpp +++ b/src/ui/dialog/lpe-powerstroke-properties.cpp @@ -32,7 +32,7 @@ #include "document-undo.h" #include "layer-manager.h" #include "message-stack.h" -#include "desktop-handles.h" + #include "sp-object.h" #include "sp-item.h" #include "verbs.h" diff --git a/src/ui/dialog/object-attributes.cpp b/src/ui/dialog/object-attributes.cpp index 118a66097..f43a15225 100644 --- a/src/ui/dialog/object-attributes.cpp +++ b/src/ui/dialog/object-attributes.cpp @@ -22,7 +22,7 @@ #include "ui/dialog/dialog-manager.h" #include "desktop.h" -#include "desktop-handles.h" + #include "macros.h" #include "sp-anchor.h" #include "sp-image.h" diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp index ecfd057de..dfe211e94 100644 --- a/src/ui/dialog/object-properties.cpp +++ b/src/ui/dialog/object-properties.cpp @@ -28,7 +28,7 @@ #include "object-properties.h" #include "widgets/sp-attribute-widget.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "verbs.h" diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index 08cfba839..cc5decfd7 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -16,7 +16,7 @@ #include "verbs.h" #include "preferences.h" #include "inkscape.h" -#include "desktop-handles.h" + #include "selection.h" #include "document.h" #include "document-undo.h" @@ -399,7 +399,7 @@ void PolarArrangeTab::arrange() tmp = tmp->next; } - DocumentUndo::done(sp_desktop_document(parent->getDesktop()), SP_VERB_SELECTION_ARRANGE, + DocumentUndo::done(parent->getDesktop()->getDocument(), SP_VERB_SELECTION_ARRANGE, _("Arrange on ellipse")); } diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp index e42b58966..6da8acb20 100644 --- a/src/ui/dialog/spellcheck.cpp +++ b/src/ui/dialog/spellcheck.cpp @@ -22,7 +22,7 @@ #include "document.h" #include "selection.h" #include "desktop.h" -#include "desktop-handles.h" + #include "ui/tools-switch.h" #include "ui/tools/text-tool.h" #include "ui/interface.h" @@ -407,7 +407,7 @@ SpellCheck::init(SPDesktop *d) } #endif /* HAVE_ASPELL */ - _root = sp_desktop_document(desktop)->getRoot(); + _root = desktop->getDocument()->getRoot(); // empty the list of objects we've checked g_slist_free (_seen_objects); @@ -792,7 +792,7 @@ void SpellCheck::onAccept () // find the end of the word anew _end_w = _begin_w; _end_w.nextEndOfWord(); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Fix spelling")); } } diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 55eed9a99..bc228633d 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -30,7 +30,7 @@ #include "xml/repr.h" #include "sp-font-face.h" #include "desktop.h" -#include "desktop-handles.h" + #include "display/nr-svgfonts.h" #include "verbs.h" #include "sp-glyph.h" @@ -182,7 +182,7 @@ void SvgFontsDialog::on_kerning_value_changed(){ return; } - SPDocument* document = sp_desktop_document(this->getDesktop()); + SPDocument* document = this->getDesktop()->getDocument(); //TODO: I am unsure whether this is the correct way of calling SPDocumentUndo::maybe_done Glib::ustring undokey = "svgfonts:hkern:k:"; @@ -265,7 +265,7 @@ void SvgFontsDialog::update_sensitiveness(){ void SvgFontsDialog::update_fonts() { SPDesktop* desktop = this->getDesktop(); - SPDocument* document = sp_desktop_document(desktop); + SPDocument* document = desktop->getDocument(); const GSList* fonts = document->getResourceList("font"); _model->clear(); @@ -482,7 +482,7 @@ void SvgFontsDialog::update_glyphs(){ void SvgFontsDialog::add_glyph(){ const int count = _GlyphsListStore->children().size(); - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); /* SPGlyph* glyph =*/ new_glyph(doc, get_selected_spfont(), count+1); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph")); @@ -516,7 +516,7 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){ } Inkscape::MessageStack *msgStack = desktop->getMessageStack(); - SPDocument* doc = sp_desktop_document(desktop); + SPDocument* doc = desktop->getDocument(); Inkscape::Selection* sel = desktop->getSelection(); if (sel->isEmpty()){ char *msg = _("Select a <b>path</b> to define the curves of a glyph"); @@ -558,7 +558,7 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){ } Inkscape::MessageStack *msgStack = desktop->getMessageStack(); - SPDocument* doc = sp_desktop_document(desktop); + SPDocument* doc = desktop->getDocument(); Inkscape::Selection* sel = desktop->getSelection(); if (sel->isEmpty()){ char *msg = _("Select a <b>path</b> to define the curves of a glyph"); @@ -598,7 +598,7 @@ void SvgFontsDialog::reset_missing_glyph_description(){ return; } - SPDocument* doc = sp_desktop_document(desktop); + SPDocument* doc = desktop->getDocument(); SPObject* obj; for (obj = get_selected_spfont()->children; obj; obj=obj->next){ if (SP_IS_MISSING_GLYPH(obj)){ @@ -619,7 +619,7 @@ void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring& //XML Tree being directly used here while it shouldn't be. glyph->getRepr()->setAttribute("glyph-name", str.c_str()); - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name")); update_glyphs(); @@ -633,7 +633,7 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin //XML Tree being directly used here while it shouldn't be. glyph->getRepr()->setAttribute("unicode", str.c_str()); - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode")); update_glyphs(); @@ -645,7 +645,7 @@ void SvgFontsDialog::remove_selected_font(){ //XML Tree being directly used here while it shouldn't be. sp_repr_unparent(font->getRepr()); - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font")); update_fonts(); @@ -662,7 +662,7 @@ void SvgFontsDialog::remove_selected_glyph(){ //XML Tree being directly used here while it shouldn't be. sp_repr_unparent(glyph->getRepr()); - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph")); update_glyphs(); @@ -679,7 +679,7 @@ void SvgFontsDialog::remove_selected_kerning_pair(){ //XML Tree being directly used here while it shouldn't be. sp_repr_unparent(pair->getRepr()); - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); DocumentUndo::done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair")); update_glyphs(); @@ -750,7 +750,7 @@ void SvgFontsDialog::add_kerning_pair(){ if (this->kerning_pair) return; //We already have this kerning pair - SPDocument* document = sp_desktop_document(this->getDesktop()); + SPDocument* document = this->getDesktop()->getDocument(); Inkscape::XML::Document *xml_doc = document->getReprDoc(); // create a new hkern node @@ -864,7 +864,7 @@ void set_font_family(SPFont* font, char* str){ } void SvgFontsDialog::add_font(){ - SPDocument* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = this->getDesktop()->getDocument(); SPFont* font = new_font(doc); const int count = _model->children().size(); @@ -938,7 +938,7 @@ SvgFontsDialog::SvgFontsDialog() _FontsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::fonts_list_button_release)); create_fonts_popup_menu(_FontsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_font)); - _defs_observer.set(sp_desktop_document(this->getDesktop())->getDefs()); + _defs_observer.set(this->getDesktop()->getDocument()->getDefs()); _defs_observer.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::update_fonts)); _getContents()->show_all(); diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index df20adc61..772217fcd 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -28,7 +28,7 @@ #include "color-item.h" #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "document.h" #include "document-private.h" @@ -1061,7 +1061,7 @@ void SwatchesPanel::_updateFromSelection() Glib::ustring fillId; Glib::ustring strokeId; - SPStyle *tmpStyle = sp_style_new( sp_desktop_document(_currentDesktop) ); + SPStyle *tmpStyle = sp_style_new(_currentDesktop->getDocument()); int result = sp_desktop_query_style( _currentDesktop, tmpStyle, QUERY_STYLE_PROPERTY_FILL ); switch (result) { case QUERY_STYLE_SINGLE: diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 0ec071d06..bdba3e154 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -52,7 +52,7 @@ #include "selection.h" #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "inkscape.h" #include "sp-root.h" @@ -288,7 +288,7 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) : /**********************************************************/ currentDesktop = SP_ACTIVE_DESKTOP; - currentDocument = sp_desktop_document(currentDesktop); + currentDocument = currentDesktop->getDocument(); previewDocument = symbols_preview_doc(); /* Template to render symbols in */ previewDocument->ensureUpToDate(); /* Necessary? */ diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index f79d166f2..eff75b311 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -20,7 +20,7 @@ #include "template-load-tab.h" #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "file.h" @@ -68,8 +68,8 @@ void TemplateWidget::create() SPDesktop *desktop = SP_ACTIVE_DESKTOP; SPDesktop *desc = sp_file_new_default(); _current_template.tpl_effect->effect(desc); - DocumentUndo::clearUndo(sp_desktop_document(desc)); - sp_desktop_document(desc)->setModifiedSinceSave(false); + DocumentUndo::clearUndo(desc->getDocument()); + desc->getDocument()->setModifiedSinceSave(false); // Apply cx,cy etc. from document sp_namedview_window_from_document( desc ); diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index 0cbe41f78..229e82af4 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -41,7 +41,7 @@ extern "C" { #include "document.h" #include "desktop.h" #include "desktop-style.h" -#include "desktop-handles.h" + #include "document-undo.h" #include "selection.h" #include "style.h" @@ -344,7 +344,7 @@ void TextEdit::onReadSelection ( gboolean dostyle, gboolean /*docontent*/ ) Inkscape::FontLister* fontlister = Inkscape::FontLister::get_instance(); // This is normally done for us by text-toolbar but only when we are in text editing context - fontlister->update_font_list(sp_desktop_document(this->desktop)); + fontlister->update_font_list(this->desktop->getDocument()); fontlister->selection_update(); Glib::ustring fontspec = fontlister->get_fontspec(); @@ -583,7 +583,7 @@ void TextEdit::onApply() } // complete the transaction - DocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT, + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), SP_VERB_CONTEXT_TEXT, _("Set text style")); apply_button.set_sensitive ( false ); @@ -658,7 +658,7 @@ void TextEdit::onStartOffsetChange(GtkTextBuffer * /*text_buffer*/, TextEdit *se const gchar *sstr = gtk_combo_box_text_get_active_text(reinterpret_cast<GtkComboBoxText *>(self->startOffset)); tp->setAttribute("startOffset", sstr); - DocumentUndo::maybeDone(sp_desktop_document(SP_ACTIVE_DESKTOP), "startOffset", SP_VERB_CONTEXT_TEXT, _("Set text style")); + DocumentUndo::maybeDone(SP_ACTIVE_DESKTOP->getDocument(), "startOffset", SP_VERB_CONTEXT_TEXT, _("Set text style")); } } diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index d7cca13a8..233d99750 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -26,7 +26,7 @@ #include "document.h" #include "document-undo.h" #include "desktop.h" -#include "desktop-handles.h" + #include "transformation.h" #include "align-and-distribute.h" #include "inkscape.h" @@ -802,7 +802,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) } } - DocumentUndo::done( sp_desktop_document(selection->desktop()) , SP_VERB_DIALOG_TRANSFORM, + DocumentUndo::done( selection->desktop()->getDocument() , SP_VERB_DIALOG_TRANSFORM, _("Move")); } @@ -864,7 +864,7 @@ void Transformation::applyPageScale(Inkscape::Selection *selection) } } - DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM, _("Scale")); } @@ -889,7 +889,7 @@ void Transformation::applyPageRotate(Inkscape::Selection *selection) } } - DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM, _("Rotate")); } @@ -977,7 +977,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) } } - DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM, _("Skew")); } @@ -1007,7 +1007,7 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform } - DocumentUndo::done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + DocumentUndo::done(selection->desktop()->getDocument(), SP_VERB_DIALOG_TRANSFORM, _("Edit transformation matrix")); } diff --git a/src/ui/dialog/undo-history.cpp b/src/ui/dialog/undo-history.cpp index 53691cd37..a50a169eb 100644 --- a/src/ui/dialog/undo-history.cpp +++ b/src/ui/dialog/undo-history.cpp @@ -24,7 +24,7 @@ #include "document-undo.h" #include "inkscape.h" #include "verbs.h" -#include "desktop-handles.h" + #include "util/signal-blocker.h" #include "desktop.h" diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 7105e2cda..c02520218 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -23,7 +23,7 @@ #include <gtkmm/stock.h> #include "desktop.h" -#include "desktop-handles.h" + #include "ui/dialog-events.h" #include "document.h" #include "document-undo.h" @@ -363,7 +363,7 @@ void XmlTree::set_tree_desktop(SPDesktop *desktop) sel_changed_connection = desktop->getSelection()->connectChanged(sigc::hide(sigc::mem_fun(this, &XmlTree::on_desktop_selection_changed))); document_replaced_connection = desktop->connectDocumentReplaced(sigc::mem_fun(this, &XmlTree::on_document_replaced)); - set_tree_document(sp_desktop_document(desktop)); + set_tree_document(desktop->getDocument()); } else { set_tree_document(NULL); } @@ -493,7 +493,7 @@ void XmlTree::set_dt_select(Inkscape::XML::Node *repr) repr = repr->parent(); } // end of while loop - object = sp_desktop_document(current_desktop)->getObjectByRepr(repr); + object = current_desktop->getDocument()->getObjectByRepr(repr); } else { object = NULL; } diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 0649da3df..28a65e0b4 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -38,7 +38,7 @@ #include "path-prefix.h" #include "shortcuts.h" #include "document.h" -#include "desktop-handles.h" + #include "ui/interface.h" #include "desktop.h" #include "selection.h" @@ -1237,7 +1237,7 @@ sp_ui_drag_data_received(GtkWidget *widget, // move to mouse pointer { - sp_desktop_document(desktop)->ensureUpToDate(); + desktop->getDocument()->ensureUpToDate(); Geom::OptRect sel_bbox = selection->visualBounds(); if (sel_bbox) { Geom::Point m( desktop->point() - sel_bbox->midpoint() ); diff --git a/src/ui/object-edit.cpp b/src/ui/object-edit.cpp index ca550502d..fb99dfd59 100644 --- a/src/ui/object-edit.cpp +++ b/src/ui/object-edit.cpp @@ -28,7 +28,7 @@ #include "preferences.h" #include "style.h" #include "desktop.h" -#include "desktop-handles.h" + #include "sp-namedview.h" #include "live_effects/effect.h" #include "sp-pattern.h" diff --git a/src/ui/shape-editor.cpp b/src/ui/shape-editor.cpp index 0b9fc24c5..aec5cde27 100644 --- a/src/ui/shape-editor.cpp +++ b/src/ui/shape-editor.cpp @@ -14,7 +14,7 @@ #include <string.h> #include <glibmm/i18n.h> -#include "desktop-handles.h" +#include "desktop.h" #include "document.h" #include "gc-anchored.h" #include "knotholder.h" @@ -146,7 +146,7 @@ void ShapeEditor::set_item(SPItem *item, bool keep_knotholder) { void ShapeEditor::reset_item(bool keep_knotholder) { if (knotholder) { - SPObject *obj = sp_desktop_document(desktop)->getObjectByRepr(knotholder_listener_attached_for); /// note that it is not certain that this is an SPItem; it could be a LivePathEffectObject. + SPObject *obj = desktop->getDocument()->getObjectByRepr(knotholder_listener_attached_for); /// note that it is not certain that this is an SPItem; it could be a LivePathEffectObject. set_item(SP_ITEM(obj), keep_knotholder); } } diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index c1a76c715..bcf5c9fce 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -11,7 +11,7 @@ #include <gdkmm.h> #include <2geom/point.h> #include "desktop.h" -#include "desktop-handles.h" + #include "display/sp-canvas.h" #include "display/snap-indicator.h" #include "ui/tools/tool-base.h" diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index d7b35c974..f53cef5f4 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -14,7 +14,7 @@ #include "node.h" #include <glibmm/i18n.h> #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "live_effects/lpeobject.h" @@ -820,9 +820,9 @@ void MultiPathManipulator::_commit(CommitEvent cps) _selection.signal_update.emit(); invokeForAll(&PathManipulator::writeXML); if (key) { - DocumentUndo::maybeDone(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, reason); + DocumentUndo::maybeDone(_desktop->getDocument(), key, SP_VERB_CONTEXT_NODE, reason); } else { - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); + DocumentUndo::done(_desktop->getDocument(), SP_VERB_CONTEXT_NODE, reason); } signal_coords_changed.emit(); } @@ -831,7 +831,7 @@ void MultiPathManipulator::_commit(CommitEvent cps) void MultiPathManipulator::_done(gchar const *reason, bool alert_LPE) { invokeForAll(&PathManipulator::update, alert_LPE); invokeForAll(&PathManipulator::writeXML); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, reason); + DocumentUndo::done(_desktop->getDocument(), SP_VERB_CONTEXT_NODE, reason); signal_coords_changed.emit(); } diff --git a/src/ui/tool/node.cpp b/src/ui/tool/node.cpp index 8c22f7c6e..eeea47e4d 100644 --- a/src/ui/tool/node.cpp +++ b/src/ui/tool/node.cpp @@ -17,7 +17,7 @@ #include "display/sp-canvas.h" #include "display/sp-canvas-util.h" #include "desktop.h" -#include "desktop-handles.h" + #include "preferences.h" #include "snap.h" #include "snap-preferences.h" diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 9108dff29..c8b986824 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -23,7 +23,7 @@ #include <glibmm/i18n.h> #include "ui/tool/path-manipulator.h" #include "desktop.h" -#include "desktop-handles.h" + #include "display/sp-canvas.h" #include "display/sp-canvas-util.h" #include "display/curve.h" @@ -1621,13 +1621,13 @@ void PathManipulator::_removeNodesFromSelection() void PathManipulator::_commit(Glib::ustring const &annotation) { writeXML(); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_NODE, annotation.data()); + DocumentUndo::done(_desktop->getDocument(), SP_VERB_CONTEXT_NODE, annotation.data()); } void PathManipulator::_commit(Glib::ustring const &annotation, gchar const *key) { writeXML(); - DocumentUndo::maybeDone(sp_desktop_document(_desktop), key, SP_VERB_CONTEXT_NODE, + DocumentUndo::maybeDone(_desktop->getDocument(), key, SP_VERB_CONTEXT_NODE, annotation.data()); } diff --git a/src/ui/tool/selector.cpp b/src/ui/tool/selector.cpp index fe541e823..e4e701785 100644 --- a/src/ui/tool/selector.cpp +++ b/src/ui/tool/selector.cpp @@ -11,7 +11,7 @@ #include "control-point.h" #include "desktop.h" -#include "desktop-handles.h" + #include "display/sodipodi-ctrlrect.h" #include "ui/tools/tool-base.h" #include "preferences.h" diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp index 4b853d053..da2a54989 100644 --- a/src/ui/tool/transform-handle-set.cpp +++ b/src/ui/tool/transform-handle-set.cpp @@ -15,7 +15,7 @@ #include <glib/gi18n.h> #include <2geom/transforms.h> #include "desktop.h" -#include "desktop-handles.h" + #include "display/sodipodi-ctrlrect.h" #include "preferences.h" #include "snap.h" diff --git a/src/ui/tools-switch.cpp b/src/ui/tools-switch.cpp index 07d68471f..11313f550 100644 --- a/src/ui/tools-switch.cpp +++ b/src/ui/tools-switch.cpp @@ -18,7 +18,7 @@ #include "inkscape.h" #include "desktop.h" -#include "desktop-handles.h" + #include <glibmm/i18n.h> #include <xml/repr.h> diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp index 5fe03cf8e..b9206407a 100644 --- a/src/ui/tools/arc-tool.cpp +++ b/src/ui/tools/arc-tool.cpp @@ -29,7 +29,7 @@ #include "document-undo.h" #include "sp-namedview.h" #include "selection.h" -#include "desktop-handles.h" + #include "snap.h" #include "pixmaps/cursor-ellipse.xpm" #include "xml/repr.h" @@ -444,7 +444,7 @@ void ArcTool::finishItem() { desktop->getSelection()->set(this->arc); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC, _("Create ellipse")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_ARC, _("Create ellipse")); this->arc = NULL; } @@ -466,7 +466,7 @@ void ArcTool::cancel() { desktop->canvas->endForcedFullRedraws(); - DocumentUndo::cancel(sp_desktop_document(desktop)); + DocumentUndo::cancel(desktop->getDocument()); } } diff --git a/src/ui/tools/box3d-tool.cpp b/src/ui/tools/box3d-tool.cpp index 20751381d..f8ae685c4 100644 --- a/src/ui/tools/box3d-tool.cpp +++ b/src/ui/tools/box3d-tool.cpp @@ -26,7 +26,7 @@ #include "sp-namedview.h" #include "selection.h" #include "selection-chemistry.h" -#include "desktop-handles.h" + #include "snap.h" #include "display/curve.h" #include "display/sp-canvas-item.h" @@ -155,7 +155,7 @@ void Box3dTool::setup() { sigc::mem_fun(this, &Box3dTool::selection_changed) ); - this->_vpdrag = new Box3D::VPDrag(sp_desktop_document(this->desktop)); + this->_vpdrag = new Box3D::VPDrag(this->desktop->getDocument()); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -195,7 +195,7 @@ bool Box3dTool::item_handler(SPItem* item, GdkEvent* event) { bool Box3dTool::root_handler(GdkEvent* event) { static bool dragging; - SPDocument *document = sp_desktop_document (desktop); + SPDocument *document = desktop->getDocument(); Inkscape::Selection *selection = desktop->getSelection(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int const snaps = prefs->getInt("/options/rotationsnapsperpi/value", 12); @@ -589,7 +589,7 @@ void Box3dTool::finishItem() { this->extruded = false; if (this->box3d != NULL) { - SPDocument *doc = sp_desktop_document(this->desktop); + SPDocument *doc = this->desktop->getDocument(); if (!doc || !doc->getCurrentPersp3D()) { return; @@ -605,7 +605,7 @@ void Box3dTool::finishItem() { desktop->canvas->endForcedFullRedraws(); desktop->getSelection()->set(this->box3d); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_3DBOX, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_3DBOX, _("Create 3D box")); this->box3d = NULL; diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp index 36eccd93c..151ab5f89 100644 --- a/src/ui/tools/calligraphic-tool.cpp +++ b/src/ui/tools/calligraphic-tool.cpp @@ -47,7 +47,7 @@ #include "selection.h" #include "desktop.h" #include "desktop-events.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "message-context.h" #include "preferences.h" @@ -973,7 +973,7 @@ void CalligraphicTool::set_to_accumulated(bool unionize, bool subtract) { this->repr = NULL; } - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_CALLIGRAPHIC, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_CALLIGRAPHIC, _("Draw calligraphic stroke")); } diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index 3235d2356..26a4eadd5 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -79,7 +79,7 @@ #include "svg/svg.h" #include "desktop.h" #include "desktop-style.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "message-context.h" @@ -659,7 +659,7 @@ bool ConnectorTool::_handleButtonRelease(GdkEventButton const &revent) { bool ret = false; if ( revent.button == 1 && !this->space_panning ) { - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = desktop->getDocument(); SnapManager &m = desktop->namedview->snap_manager; Geom::Point const event_w(revent.x, revent.y); @@ -729,7 +729,7 @@ bool ConnectorTool::_handleKeyPress(guint const keyval) { break; case GDK_KEY_Escape: if (this->state == SP_CONNECTOR_CONTEXT_REROUTING) { - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = desktop->getDocument(); this->_reroutingFinish(NULL); @@ -754,7 +754,7 @@ bool ConnectorTool::_handleKeyPress(guint const keyval) { } void ConnectorTool::_reroutingFinish(Geom::Point *const p) { - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = desktop->getDocument(); // Clear the temporary path: this->red_curve->reset(); @@ -812,7 +812,7 @@ void ConnectorTool::_setSubsequentPoint(Geom::Point const p) { Avoid::Point dst(d[Geom::X], d[Geom::Y]); if (!this->newConnRef) { - Avoid::Router *router = sp_desktop_document(desktop)->router; + Avoid::Router *router = desktop->getDocument()->router; this->newConnRef = new Avoid::ConnRef(router); this->newConnRef->setEndpoint(Avoid::VertID::src, src); if (this->isOrthogonal) @@ -876,7 +876,7 @@ void ConnectorTool::_flushWhite(SPCurve *gc) { /* Now we have to go back to item coordinates at last */ c->transform(this->desktop->dt2doc()); - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = desktop->getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); if ( c && !c->is_empty() ) { @@ -1309,7 +1309,7 @@ void cc_selection_set_avoid(bool const set_avoid) return; } - SPDocument *document = sp_desktop_document(desktop); + SPDocument *document = desktop->getDocument(); Inkscape::Selection *selection = desktop->getSelection(); diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp index d9a906cb8..178e6636e 100644 --- a/src/ui/tools/dropper-tool.cpp +++ b/src/ui/tools/dropper-tool.cpp @@ -34,7 +34,7 @@ #include "sp-namedview.h" #include "sp-cursor.h" #include "desktop.h" -#include "desktop-handles.h" + #include "selection.h" #include "document.h" #include "document-undo.h" @@ -329,7 +329,7 @@ bool DropperTool::root_handler(GdkEvent* event) { } if (!(desktop->getSelection()->isEmpty())) { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_DROPPER, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_DROPPER, _("Set picked color")); } diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 2d86915c2..1b4dcfe25 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -44,7 +44,7 @@ #include "selection.h" #include "desktop.h" #include "desktop-events.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "message-context.h" #include "preferences.h" @@ -680,10 +680,10 @@ void EraserTool::set_to_accumulated() { if (selection->isEmpty()) { if ( eraserMode ) { - toWorkOn = sp_desktop_document(desktop)->getItemsPartiallyInBox(desktop->dkey, bounds); + toWorkOn = desktop->getDocument()->getItemsPartiallyInBox(desktop->dkey, bounds); } else { Inkscape::Rubberband *r = Inkscape::Rubberband::get(desktop); - toWorkOn = sp_desktop_document(desktop)->getItemsAtPoints(desktop->dkey, r->getPoints()); + toWorkOn = desktop->getDocument()->getItemsAtPoints(desktop->dkey, r->getPoints()); } toWorkOn = g_slist_remove( toWorkOn, acid ); @@ -767,9 +767,9 @@ void EraserTool::set_to_accumulated() { if ( workDone ) { - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ERASER, _("Draw eraser stroke")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_ERASER, _("Draw eraser stroke")); } else { - DocumentUndo::cancel(sp_desktop_document(desktop)); + DocumentUndo::cancel(desktop->getDocument()); } } diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp index b6808fbc2..82057f483 100644 --- a/src/ui/tools/flood-tool.cpp +++ b/src/ui/tools/flood-tool.cpp @@ -31,7 +31,7 @@ #include "color.h" #include "context-fns.h" #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "display/cairo-utils.h" #include "display/drawing-context.h" @@ -360,7 +360,7 @@ inline static bool check_if_pixel_is_paintable(guchar *px, unsigned char *trace_ * @param union_with_selection If true, merge the final SVG path with the current selection. */ static void do_trace(bitmap_coords_info bci, guchar *trace_px, SPDesktop *desktop, Geom::Affine transform, unsigned int min_x, unsigned int max_x, unsigned int min_y, unsigned int max_y, bool union_with_selection) { - SPDocument *document = sp_desktop_document(desktop); + SPDocument *document = desktop->getDocument(); unsigned char *trace_t; @@ -740,7 +740,7 @@ static bool sort_fill_queue_horizontal(Geom::Point a, Geom::Point b) { */ static void sp_flood_do_flood_fill(ToolBase *event_context, GdkEvent *event, bool union_with_selection, bool is_point_fill, bool is_touch_fill) { SPDesktop *desktop = event_context->desktop; - SPDocument *document = sp_desktop_document(desktop); + SPDocument *document = desktop->getDocument(); document->ensureUpToDate(); @@ -1096,7 +1096,7 @@ bool FloodTool::item_handler(SPItem* item, GdkEvent* event) { // Set style desktop->applyCurrentOrToolStyle(item, "/tools/paintbucket", false); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PAINTBUCKET, _("Set style on object")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_PAINTBUCKET, _("Set style on object")); ret = TRUE; } @@ -1231,7 +1231,7 @@ void FloodTool::finishItem() { desktop->getSelection()->set(this->item); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_PAINTBUCKET, _("Fill bounded area")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_PAINTBUCKET, _("Fill bounded area")); this->item = NULL; } diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index 14d9b8815..c9fe37135 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -27,7 +27,7 @@ #include <glibmm/i18n.h> #include "display/curve.h" #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "document.h" #include "ui/draw-anchor.h" @@ -667,7 +667,7 @@ static void spdc_flush_white(FreehandBase *dc, SPCurve *gc) : dc->desktop->dt2doc() ); SPDesktop *desktop = dc->desktop; - SPDocument *doc = sp_desktop_document(desktop); + SPDocument *doc = desktop->getDocument(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); if ( c && !c->is_empty() ) { @@ -865,7 +865,7 @@ void spdc_create_single_dot(ToolBase *ec, Geom::Point const &pt, char const *too desktop->getSelection()->set(item); desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating single dot")); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_NONE, _("Create single dot")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_NONE, _("Create single dot")); } } diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp index b674b6a8a..5da30da7b 100644 --- a/src/ui/tools/gradient-tool.cpp +++ b/src/ui/tools/gradient-tool.cpp @@ -23,7 +23,7 @@ #include "document.h" #include "selection.h" #include "desktop.h" -#include "desktop-handles.h" + #include "message-context.h" #include "message-stack.h" #include "pixmaps/cursor-gradient.xpm" @@ -464,7 +464,7 @@ sp_gradient_context_add_stop_near_point (GradientTool *rc, SPItem *item, Geom:: SPStop *newstop = ec->get_drag()->addStopNearPoint (item, mouse_p, tolerance/desktop->current_zoom()); - DocumentUndo::done(sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT, _("Add gradient stop")); ec->get_drag()->updateDraggers(); @@ -509,13 +509,13 @@ bool GradientTool::root_handler(GdkEvent* event) { SPGradientType new_type = (SPGradientType) prefs->getInt("/tools/gradient/newgradient", SP_GRADIENT_TYPE_LINEAR); Inkscape::PaintTarget fsmode = (prefs->getInt("/tools/gradient/newfillorstroke", 1) != 0) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE; - SPGradient *vector = sp_gradient_vector_for_object(sp_desktop_document(desktop), desktop, item, fsmode); + SPGradient *vector = sp_gradient_vector_for_object(desktop->getDocument(), desktop, item, fsmode); SPGradient *priv = sp_item_set_gradient(item, vector, new_type, fsmode); sp_gradient_reset_to_userspace(priv, item); } - DocumentUndo::done(sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT, _("Create default gradient")); } ret = TRUE; @@ -893,7 +893,7 @@ static void sp_gradient_drag(GradientTool &rc, Geom::Point const pt, guint /*sta { SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop; Inkscape::Selection *selection = desktop->getSelection(); - SPDocument *document = sp_desktop_document(desktop); + SPDocument *document = desktop->getDocument(); ToolBase *ec = SP_EVENT_CONTEXT(&rc); if (!selection->isEmpty()) { diff --git a/src/ui/tools/lpe-tool.cpp b/src/ui/tools/lpe-tool.cpp index 265c20ec8..c9b656397 100644 --- a/src/ui/tools/lpe-tool.cpp +++ b/src/ui/tools/lpe-tool.cpp @@ -30,7 +30,7 @@ #include "preferences.h" #include "ui/shape-editor.h" #include "selection.h" -#include "desktop-handles.h" + #include "document.h" #include "display/curve.h" #include "display/canvas-bpath.h" @@ -310,7 +310,7 @@ lpetool_try_construction(LpeTool *lc, Inkscape::LivePathEffect::EffectType const // TODO: should we check whether type represents a valid geometric construction? if (item && SP_IS_LPE_ITEM(item) && Inkscape::LivePathEffect::Effect::acceptsNumClicks(type) == 0) { - Inkscape::LivePathEffect::Effect::createAndApply(type, sp_desktop_document(lc->desktop), item); + Inkscape::LivePathEffect::Effect::createAndApply(type, lc->desktop->getDocument(), item); return true; } return false; @@ -360,7 +360,7 @@ lpetool_context_reset_limiting_bbox(LpeTool *lc) if (!prefs->getBool("/tools/lpetool/show_bbox", true)) return; - SPDocument *document = sp_desktop_document(lc->desktop); + SPDocument *document = lc->desktop->getDocument(); Geom::Point A, B; lpetool_get_limiting_bbox_corners(document, A, B); diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index 6fa409ada..b7e54b9c8 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -29,7 +29,7 @@ #include "pixmaps/cursor-measure.xpm" #include "preferences.h" #include "inkscape.h" -#include "desktop-handles.h" + #include "ui/tools/measure-tool.h" #include "ui/tools/freehand-base.h" #include "display/canvas-text.h" @@ -291,7 +291,7 @@ static void calculate_intersections(SPDesktop * /*desktop*/, SPItem* item, Geom: //TODO: consider only visible intersections Geom::Point intersection = lineseg[0].pointAt((*m).ta); double eps = 0.0001; - SPDocument* doc = sp_desktop_document(desktop); + SPDocument* doc = desktop->getDocument(); if (((*m).ta > eps && item == doc->getItemAtPoint(desktop->dkey, lineseg[0].pointAt((*m).ta - eps), false, NULL)) || ((*m).ta + eps < 1 && @@ -441,7 +441,7 @@ bool MeasureTool::root_handler(GdkEvent* event) { // TODO switch to a different variable name. The single letter 'l' is easy to misread. //select elements crossed by line segment: - GSList *items = sp_desktop_document(desktop)->getItemsAtPoints(desktop->dkey, points); + GSList *items = desktop->getDocument()->getItemsAtPoints(desktop->dkey, points); std::vector<double> intersection_times; for (GSList *l = items; l != NULL; l = l->next) { SPItem *item = static_cast<SPItem*>(l->data); diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp index d512fadb5..d333b932e 100644 --- a/src/ui/tools/mesh-tool.cpp +++ b/src/ui/tools/mesh-tool.cpp @@ -27,7 +27,7 @@ // General #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "macros.h" @@ -317,7 +317,7 @@ static void sp_mesh_context_split_near_point(MeshTool *rc, SPItem *item, Geom:: ec->get_drag()->addStopNearPoint (item, mouse_p, tolerance/desktop->current_zoom()); - DocumentUndo::done(sp_desktop_document (desktop), SP_VERB_CONTEXT_MESH, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_MESH, _("Split mesh row/column")); ec->get_drag()->updateDraggers(); @@ -488,13 +488,13 @@ bool MeshTool::root_handler(GdkEvent* event) { #ifdef DEBUG_MESH std::cout << "sp_mesh_context_root_handler: creating new mesh on: " << (fsmode == Inkscape::FOR_FILL ? "Fill" : "Stroke") << std::endl; #endif - SPGradient *vector = sp_gradient_vector_for_object(sp_desktop_document(desktop), desktop, item, fsmode); + SPGradient *vector = sp_gradient_vector_for_object(desktop->getDocument(), desktop, item, fsmode); SPGradient *priv = sp_item_set_gradient(item, vector, new_type, fsmode); sp_gradient_reset_to_userspace(priv, item); } - DocumentUndo::done(sp_desktop_document (desktop), SP_VERB_CONTEXT_MESH, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_MESH, _("Create default mesh")); } @@ -934,7 +934,7 @@ bool MeshTool::root_handler(GdkEvent* event) { static void sp_mesh_drag(MeshTool &rc, Geom::Point const /*pt*/, guint /*state*/, guint32 /*etime*/) { SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop; Inkscape::Selection *selection = desktop->getSelection(); - SPDocument *document = sp_desktop_document(desktop); + SPDocument *document = desktop->getDocument(); ToolBase *ec = SP_EVENT_CONTEXT(&rc); if (!selection->isEmpty()) { diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index a5d0df327..caec901a6 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -13,7 +13,7 @@ #include "ui/tool/curve-drag-point.h" #include <glib/gi18n.h> #include "desktop.h" -#include "desktop-handles.h" + #include "display/sp-canvas-group.h" #include "display/canvas-bpath.h" #include "display/curve.h" @@ -668,7 +668,7 @@ void NodeTool::select_area(Geom::Rect const &sel, GdkEventButton *event) { if (this->_multipath->empty()) { // if multipath is empty, select rubberbanded items rather than nodes Inkscape::Selection *selection = this->desktop->selection; - GSList *items = sp_desktop_document(this->desktop)->getItemsInBox(this->desktop->dkey, sel); + GSList *items = this->desktop->getDocument()->getItemsInBox(this->desktop->dkey, sel); selection->setList(items); g_slist_free(items); } else { diff --git a/src/ui/tools/node-tool.h b/src/ui/tools/node-tool.h index ab72f3632..20375e869 100644 --- a/src/ui/tools/node-tool.h +++ b/src/ui/tools/node-tool.h @@ -33,6 +33,8 @@ namespace Inkscape { } } +struct SPCanvasGroup; + #define INK_NODE_TOOL(obj) (dynamic_cast<Inkscape::UI::Tools::NodeTool*>((Inkscape::UI::Tools::ToolBase*)obj)) #define INK_IS_NODE_TOOL(obj) (dynamic_cast<const Inkscape::UI::Tools::NodeTool*>((const Inkscape::UI::Tools::ToolBase*)obj)) diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index adb5c2866..4587e88c8 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -23,7 +23,7 @@ #include "ui/tools/pen-tool.h" #include "sp-namedview.h" #include "desktop.h" -#include "desktop-handles.h" + #include "selection.h" #include "selection-chemistry.h" #include "ui/draw-anchor.h" diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index ecb3ca12a..28fed3a8f 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -20,7 +20,7 @@ #include "ui/tools/pencil-tool.h" #include "desktop.h" -#include "desktop-handles.h" + #include "selection.h" #include "selection-chemistry.h" #include "ui/draw-anchor.h" diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 69dfad025..9476ff624 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -28,7 +28,7 @@ #include "sp-namedview.h" #include "selection.h" #include "selection-chemistry.h" -#include "desktop-handles.h" + #include "snap.h" #include "desktop.h" #include "desktop-style.h" @@ -478,7 +478,7 @@ void RectTool::finishItem() { this->desktop->getSelection()->set(this->rect); - DocumentUndo::done(sp_desktop_document(this->desktop), SP_VERB_CONTEXT_RECT, _("Create rectangle")); + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_RECT, _("Create rectangle")); this->rect = NULL; } @@ -500,7 +500,7 @@ void RectTool::cancel(){ this->desktop->canvas->endForcedFullRedraws(); - DocumentUndo::cancel(sp_desktop_document(this->desktop)); + DocumentUndo::cancel(this->desktop->getDocument()); } } diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp index bdde76c31..939b1a0b3 100644 --- a/src/ui/tools/select-tool.cpp +++ b/src/ui/tools/select-tool.cpp @@ -38,7 +38,7 @@ #include "extension/dbus/document-interface.h" #endif #include "desktop.h" -#include "desktop-handles.h" + #include "sp-root.h" #include "preferences.h" #include "ui/tools-switch.h" @@ -208,7 +208,7 @@ bool SelectTool::sp_select_context_abort() { if (this->item) { // only undo if the item is still valid if (this->item->document) { - DocumentUndo::undo(sp_desktop_document(desktop)); + DocumentUndo::undo(desktop->getDocument()); } sp_object_unref( this->item, NULL); @@ -216,7 +216,7 @@ bool SelectTool::sp_select_context_abort() { // 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 - DocumentUndo::undo(sp_desktop_document(desktop)); + DocumentUndo::undo(desktop->getDocument()); } this->item = NULL; @@ -722,9 +722,9 @@ bool SelectTool::root_handler(GdkEvent* event) { if (r->getMode() == RUBBERBAND_MODE_RECT) { Geom::OptRect const b = r->getRectangle(); - items = sp_desktop_document(desktop)->getItemsInBox(desktop->dkey, *b); + items = desktop->getDocument()->getItemsInBox(desktop->dkey, *b); } else if (r->getMode() == RUBBERBAND_MODE_TOUCHPATH) { - items = sp_desktop_document(desktop)->getItemsAtPoints(desktop->dkey, r->getPoints()); + items = desktop->getDocument()->getItemsAtPoints(desktop->dkey, r->getPoints()); } _seltrans->resetState(); diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp index 7b11b8469..f208e1c43 100644 --- a/src/ui/tools/spiral-tool.cpp +++ b/src/ui/tools/spiral-tool.cpp @@ -27,7 +27,7 @@ #include "document-undo.h" #include "sp-namedview.h" #include "selection.h" -#include "desktop-handles.h" + #include "snap.h" #include "desktop.h" #include "desktop-style.h" @@ -418,7 +418,7 @@ void SpiralTool::finishItem() { this->desktop->canvas->endForcedFullRedraws(); this->desktop->getSelection()->set(this->spiral); - DocumentUndo::done(sp_desktop_document(this->desktop), SP_VERB_CONTEXT_SPIRAL, _("Create spiral")); + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPIRAL, _("Create spiral")); this->spiral = NULL; } @@ -440,7 +440,7 @@ void SpiralTool::cancel() { this->desktop->canvas->endForcedFullRedraws(); - DocumentUndo::cancel(sp_desktop_document(this->desktop)); + DocumentUndo::cancel(this->desktop->getDocument()); } } diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index 39c146351..a01c5c55b 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -33,7 +33,7 @@ #include "selection.h" #include "desktop.h" #include "desktop-events.h" -#include "desktop-handles.h" + #include "message-context.h" #include "pixmaps/cursor-spray.xpm" #include <boost/optional.hpp> @@ -735,15 +735,15 @@ bool SprayTool::root_handler(GdkEvent* event) { this->has_dilated = false; switch (this->mode) { case SPRAY_MODE_COPY: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPRAY, _("Spray with copies")); break; case SPRAY_MODE_CLONE: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPRAY, _("Spray with clones")); break; case SPRAY_MODE_SINGLE_PATH: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_SPRAY, _("Spray in single path")); break; } diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp index a5e46e5b7..df311f2d8 100644 --- a/src/ui/tools/star-tool.cpp +++ b/src/ui/tools/star-tool.cpp @@ -30,7 +30,7 @@ #include "document-undo.h" #include "sp-namedview.h" #include "selection.h" -#include "desktop-handles.h" + #include "snap.h" #include "desktop.h" #include "desktop-style.h" @@ -442,7 +442,7 @@ void StarTool::finishItem() { desktop->canvas->endForcedFullRedraws(); desktop->getSelection()->set(this->star); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_STAR, _("Create star")); this->star = NULL; @@ -465,7 +465,7 @@ void StarTool::cancel() { desktop->canvas->endForcedFullRedraws(); - DocumentUndo::cancel(sp_desktop_document(desktop)); + DocumentUndo::cancel(desktop->getDocument()); } } diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index e6dde0581..df0583d67 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -26,7 +26,7 @@ #include <sstream> #include "context-fns.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "desktop.h" #include "document.h" @@ -431,7 +431,7 @@ static void sp_text_context_setup_text(TextTool *tc) text_item->updateRepr(); text_item->doWriteTransform(text_item->getRepr(), text_item->transform, NULL, true); - DocumentUndo::done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + DocumentUndo::done(ec->desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Create text")); } @@ -471,7 +471,7 @@ static void insert_uni_char(TextTool *const tc) tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, u); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - DocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM, + DocumentUndo::done(tc->desktop->getDocument(), SP_VERB_DIALOG_TRANSFORM, _("Insert Unicode character")); } } @@ -662,7 +662,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_desktop_apply_style_tool(desktop, ft->getRepr(), "/tools/text", true); desktop->getSelection()->set(ft); desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created.")); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Create flowed text")); + DocumentUndo::done(desktop->getDocument(), 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.")); } @@ -801,7 +801,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No-break space")); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Insert no-break space")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Insert no-break space")); return TRUE; } break; @@ -837,7 +837,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_repr_css_set_property(css, "font-weight", "normal"); sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css); sp_repr_css_attr_unref(css); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Make bold")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Make bold")); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); return TRUE; @@ -854,7 +854,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_repr_css_set_property(css, "font-style", "italic"); sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css); sp_repr_css_attr_unref(css); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Make italic")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Make italic")); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); return TRUE; @@ -892,7 +892,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("New line")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("New line")); return TRUE; } case GDK_KEY_BackSpace: @@ -933,7 +933,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Backspace")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Backspace")); } return TRUE; case GDK_KEY_Delete: @@ -971,7 +971,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Delete")); + DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Delete")); } return TRUE; case GDK_KEY_Left: @@ -987,7 +987,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*-1, 0)); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:left", SP_VERB_CONTEXT_TEXT, _("Kern to the left")); + DocumentUndo::maybeDone(desktop->getDocument(), "kern:left", SP_VERB_CONTEXT_TEXT, _("Kern to the left")); } else { if (MOD__CTRL(event)) this->text_sel_end.cursorLeftWithControl(); @@ -1011,7 +1011,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*1, 0)); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:right", SP_VERB_CONTEXT_TEXT, _("Kern to the right")); + DocumentUndo::maybeDone(desktop->getDocument(), "kern:right", SP_VERB_CONTEXT_TEXT, _("Kern to the right")); } else { if (MOD__CTRL(event)) this->text_sel_end.cursorRightWithControl(); @@ -1035,7 +1035,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*-1)); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:up", SP_VERB_CONTEXT_TEXT, _("Kern up")); + DocumentUndo::maybeDone(desktop->getDocument(), "kern:up", SP_VERB_CONTEXT_TEXT, _("Kern up")); } else { if (MOD__CTRL(event)) this->text_sel_end.cursorUpWithControl(); @@ -1059,7 +1059,7 @@ bool TextTool::root_handler(GdkEvent* event) { sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*1)); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:down", SP_VERB_CONTEXT_TEXT, _("Kern down")); + DocumentUndo::maybeDone(desktop->getDocument(), "kern:down", SP_VERB_CONTEXT_TEXT, _("Kern down")); } else { if (MOD__CTRL(event)) this->text_sel_end.cursorDownWithControl(); @@ -1134,7 +1134,7 @@ bool TextTool::root_handler(GdkEvent* event) { } else { sp_te_adjust_rotation(this->text, this->text_sel_start, this->text_sel_end, desktop, -90); } - DocumentUndo::maybeDone(sp_desktop_document(desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT, _("Rotate counterclockwise")); + DocumentUndo::maybeDone(desktop->getDocument(), "textrot:ccw", SP_VERB_CONTEXT_TEXT, _("Rotate counterclockwise")); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); return TRUE; @@ -1154,7 +1154,7 @@ bool TextTool::root_handler(GdkEvent* event) { } else { sp_te_adjust_rotation(this->text, this->text_sel_start, this->text_sel_end, desktop, 90); } - DocumentUndo::maybeDone(sp_desktop_document(desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT, _("Rotate clockwise")); + DocumentUndo::maybeDone(desktop->getDocument(), "textrot:cw", SP_VERB_CONTEXT_TEXT, _("Rotate clockwise")); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); return TRUE; @@ -1170,13 +1170,13 @@ bool TextTool::root_handler(GdkEvent* event) { sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10); else sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract line spacing")); + DocumentUndo::maybeDone(desktop->getDocument(), "linespacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract line spacing")); } else { if (MOD__SHIFT(event)) sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10); else sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract letter spacing")); + DocumentUndo::maybeDone(desktop->getDocument(), "letterspacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract letter spacing")); } sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); @@ -1193,13 +1193,13 @@ bool TextTool::root_handler(GdkEvent* event) { sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10); else sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand line spacing")); + DocumentUndo::maybeDone(desktop->getDocument(), "linespacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand line spacing")); } else { if (MOD__SHIFT(event)) sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10); else sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1); - DocumentUndo::maybeDone(sp_desktop_document(desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand letter spacing"));\ + DocumentUndo::maybeDone(desktop->getDocument(), "letterspacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand letter spacing"));\ } sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); @@ -1328,7 +1328,7 @@ bool sp_text_paste_inline(ToolBase *ec) tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start); begin = end + 1; } - DocumentUndo::done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + DocumentUndo::done(ec->desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Paste text")); return true; @@ -1451,7 +1451,7 @@ bool TextTool::_styleSet(SPCSSAttr const *css) return false; // will get picked up by the parent and applied to the whole text object sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css); - DocumentUndo::done(sp_desktop_document(this->desktop), SP_VERB_CONTEXT_TEXT, + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Set text style")); sp_text_context_update_cursor(this); sp_text_context_update_text_selection(this); @@ -1661,7 +1661,7 @@ static void sp_text_context_forget_text(TextTool *tc) // the XML editor if ( text_repr && text_repr->parent() ) { sp_repr_unparent(text_repr); - SPDocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT, + SPDocumentUndo::done(tc->desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Remove empty text")); } } diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp index 8ce78b2d9..a07f2fb86 100644 --- a/src/ui/tools/tool-base.cpp +++ b/src/ui/tools/tool-base.cpp @@ -39,7 +39,7 @@ #include "xml/node-event-vector.h" #include "sp-cursor.h" #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-events.h" #include "desktop-style.h" #include "sp-namedview.h" diff --git a/src/ui/tools/tweak-tool.cpp b/src/ui/tools/tweak-tool.cpp index 2b77c9d7a..5e53fdb93 100644 --- a/src/ui/tools/tweak-tool.cpp +++ b/src/ui/tools/tweak-tool.cpp @@ -28,7 +28,7 @@ #include "selection.h" #include "desktop.h" #include "desktop-events.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "message-context.h" #include "pixmaps/cursor-tweak-move.xpm" @@ -1235,55 +1235,55 @@ bool TweakTool::root_handler(GdkEvent* event) { this->has_dilated = false; switch (this->mode) { case TWEAK_MODE_MOVE: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Move tweak")); break; case TWEAK_MODE_MOVE_IN_OUT: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Move in/out tweak")); break; case TWEAK_MODE_MOVE_JITTER: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Move jitter tweak")); break; case TWEAK_MODE_SCALE: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Scale tweak")); break; case TWEAK_MODE_ROTATE: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Rotate tweak")); break; case TWEAK_MODE_MORELESS: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Duplicate/delete tweak")); break; case TWEAK_MODE_PUSH: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Push path tweak")); break; case TWEAK_MODE_SHRINK_GROW: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Shrink/grow path tweak")); break; case TWEAK_MODE_ATTRACT_REPEL: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Attract/repel path tweak")); break; case TWEAK_MODE_ROUGHEN: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Roughen path tweak")); break; case TWEAK_MODE_COLORPAINT: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Color paint tweak")); break; case TWEAK_MODE_COLORJITTER: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Color jitter tweak")); break; case TWEAK_MODE_BLUR: - DocumentUndo::done(sp_desktop_document(SP_EVENT_CONTEXT(this)->desktop), + DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TWEAK, _("Blur tweak")); break; } diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp index 6b5a351f6..d4c4d394e 100644 --- a/src/ui/widget/color-picker.cpp +++ b/src/ui/widget/color-picker.cpp @@ -12,7 +12,7 @@ #include "color-picker.h" #include "inkscape.h" -#include "desktop-handles.h" +#include "desktop.h" #include "document.h" #include "document-undo.h" #include "ui/dialog-events.h" @@ -128,7 +128,7 @@ void sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) (ptr->_preview).setRgba32 (rgba); if (ptr->_undo && SP_ACTIVE_DESKTOP) - DocumentUndo::done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), SP_VERB_NONE, /* TODO: annotate */ "color-picker.cpp:130"); ptr->on_changed (rgba); diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 4754b9c23..242a99073 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -13,7 +13,7 @@ #include <glibmm/i18n.h> #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "inkscape.h" diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp index 7b1a8dbfb..dc89d233f 100644 --- a/src/ui/widget/layer-selector.cpp +++ b/src/ui/widget/layer-selector.cpp @@ -21,7 +21,7 @@ #include <glibmm/i18n.h> #include "desktop.h" -#include "desktop-handles.h" + #include "document.h" #include "document-undo.h" #include "layer-manager.h" @@ -601,7 +601,7 @@ void LayerSelector::_prepareLabelRenderer( void LayerSelector::_lockLayer(bool lock) { if ( _layer && SP_IS_ITEM(_layer) ) { SP_ITEM(_layer)->setLocked(lock); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_NONE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_NONE, lock? _("Lock layer") : _("Unlock layer")); } } @@ -609,7 +609,7 @@ void LayerSelector::_lockLayer(bool lock) { void LayerSelector::_hideLayer(bool hide) { if ( _layer && SP_IS_ITEM(_layer) ) { SP_ITEM(_layer)->setHidden(hide); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_NONE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_NONE, hide? _("Hide layer") : _("Unhide layer")); } } diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index b4cfa3231..7439a402c 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -17,7 +17,7 @@ #include <glibmm/i18n.h> #include "desktop.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "document.h" #include "document-undo.h" @@ -104,7 +104,7 @@ ObjectCompositeSettings::_blendBlurValueChanged() if (!desktop) { return; } - SPDocument *document = sp_desktop_document (desktop); + SPDocument *document = desktop->getDocument(); if (_blocked) return; @@ -195,7 +195,7 @@ ObjectCompositeSettings::_opacityValueChanged() sp_repr_css_attr_unref (css); - DocumentUndo::maybeDone(sp_desktop_document (desktop), _opacity_tag.c_str(), _verb_code, + DocumentUndo::maybeDone(desktop->getDocument(), _opacity_tag.c_str(), _verb_code, _("Change opacity")); // resume interruptibility @@ -219,7 +219,7 @@ ObjectCompositeSettings::_subjectChanged() { return; _blocked = true; - SPStyle *query = sp_style_new (sp_desktop_document(desktop)); + SPStyle *query = sp_style_new (desktop->getDocument()); int result = _subject->queryStyle(query, QUERY_STYLE_PROPERTY_MASTEROPACITY); switch (result) { diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index fb7f5abd7..d36c11ace 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -32,7 +32,7 @@ #include <2geom/transforms.h> -#include "desktop-handles.h" + #include "document.h" #include "desktop.h" #include "helper/action.h" @@ -477,7 +477,7 @@ PageSizer::setDim (Inkscape::Util::Quantity w, Inkscape::Util::Quantity h, bool _unit = w.unit->abbr; if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { - SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); + SPDocument *doc = SP_ACTIVE_DESKTOP->getDocument(); Inkscape::Util::Quantity const old_height = doc->getHeight(); doc->setWidth (w, changeSize); doc->setHeight (h, changeSize); @@ -608,7 +608,7 @@ PageSizer::fire_fit_canvas_to_selection_or_drawing() SPNamedView *nv; Inkscape::XML::Node *nv_repr; - if ((doc = sp_desktop_document(SP_ACTIVE_DESKTOP)) + if ((doc = SP_ACTIVE_DESKTOP->getDocument()) && (nv = sp_document_namedview(doc, 0)) && (nv_repr = nv->getRepr())) { _lockMarginUpdate = true; diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 39aa6c584..0cff25d88 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -34,7 +34,7 @@ #include "icon-size.h" #include "preferences.h" #include "desktop.h" -#include "desktop-handles.h" + #include "inkscape.h" #include "widgets/eek-preview.h" #include "ui/previewfillable.h" diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 7f3e6cd47..98028ed78 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -34,7 +34,7 @@ #include "desktop.h" #include "enums.h" #include "inkscape.h" -#include "desktop-handles.h" + #include "message-stack.h" #include "style.h" #include "selection.h" diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 02ab88418..bbf542987 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -37,7 +37,7 @@ #include "display/sp-canvas.h" #include "desktop.h" -#include "desktop-handles.h" + #include "sp-root.h" @@ -420,7 +420,7 @@ RegisteredColorPicker::on_changed (guint32 rgba) if (!dt) return; local_repr = dt->getNamedView()->getRepr(); - local_doc = sp_desktop_document(dt); + local_doc = dt->getDocument(); } gchar c[32]; diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 38944250c..93b4893f2 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -20,7 +20,7 @@ #include "ui/widget/color-preview.h" #include "selection.h" -#include "desktop-handles.h" + #include "style.h" #include "desktop-style.h" #include "sp-namedview.h" @@ -541,8 +541,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 ); - DocumentUndo::done( sp_desktop_document(tracker->parent->_desktop) , SP_VERB_NONE, - _("Drop color")); + DocumentUndo::done( tracker->parent->_desktop->getDocument(), SP_VERB_NONE, _("Drop color")); } } break; @@ -554,7 +553,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Remove fill")); } @@ -563,7 +562,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Remove stroke")); } @@ -572,7 +571,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Unset fill")); } @@ -588,7 +587,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Unset stroke")); } @@ -597,7 +596,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Make fill opaque")); } @@ -606,7 +605,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Make fill opaque")); } @@ -618,7 +617,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Apply last set color to fill")); } @@ -630,7 +629,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Apply last set color to stroke")); } @@ -641,7 +640,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Apply last selected color to fill")); } @@ -652,7 +651,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Apply last selected color to stroke")); } @@ -678,7 +677,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Invert fill")); } @@ -702,7 +701,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Invert stroke")); } @@ -714,7 +713,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("White fill")); } @@ -726,7 +725,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("White stroke")); } @@ -738,7 +737,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Black fill")); } @@ -750,7 +749,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Black stroke")); } @@ -793,7 +792,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Paste fill")); } } @@ -811,7 +810,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Paste stroke")); } } @@ -865,7 +864,7 @@ void SelectedStyle::on_fillstroke_swap() { sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Swap fill and stroke")); } @@ -940,7 +939,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, _("Change opacity")); return true; } @@ -967,7 +966,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); - DocumentUndo::done(sp_desktop_document(_desktop), SP_VERB_DIALOG_SWATCHES, + DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_SWATCHES, _("Change stroke width")); } @@ -978,7 +977,7 @@ SelectedStyle::update() return; // create temporary style - SPStyle *query = sp_style_new (sp_desktop_document(_desktop)); + SPStyle *query = sp_style_new (_desktop->getDocument()); for (int i = SS_FILL; i <= SS_STROKE; i++) { Gtk::EventBox *place = (i == SS_FILL)? &_fill_place : &_stroke_place; @@ -1244,7 +1243,7 @@ void SelectedStyle::on_opacity_changed () _desktop->getCanvas()->forceFullRedrawAfterInterruptions(0); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::maybeDone(sp_desktop_document(_desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::maybeDone(_desktop->getDocument(), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE, _("Change opacity")); // resume interruptibility _desktop->getCanvas()->endForcedFullRedraws(); @@ -1385,25 +1384,25 @@ RotateableSwatch::do_motion(double by, guint modifier) { diff = color_adjust(hsla, by, cc, modifier); if (modifier == 3) { // alpha - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust alpha"))); double ch = hsla[3]; parent->getDesktop()->event_context->message_context->setF(Inkscape::IMMEDIATE_MESSAGE, _("Adjusting <b>alpha</b>: was %.3g, now <b>%.3g</b> (diff %.3g); with <b>Ctrl</b> to adjust lightness, with <b>Shift</b> to adjust saturation, without modifiers to adjust hue"), ch - diff, ch, diff); } else if (modifier == 2) { // saturation - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust saturation"))); double ch = hsla[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, with <b>Alt</b> to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff); } else if (modifier == 1) { // lightness - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust lightness"))); double ch = hsla[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, with <b>Alt</b> to adjust alpha, without modifiers to adjust hue"), ch - diff, ch, diff); } else { // hue - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust hue"))); double ch = hsla[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>Alt</b> to adjust alpha, with <b>Ctrl</b> to adjust lightness"), ch - diff, ch, diff); @@ -1440,18 +1439,18 @@ RotateableSwatch::do_release(double by, guint modifier) { } if (modifier == 3) { // alpha - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust alpha")); } else if (modifier == 2) { // saturation - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust saturation")); } else if (modifier == 1) { // lightness - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust lightness")); } else { // hue - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, ("Adjust hue")); } @@ -1523,7 +1522,7 @@ RotateableStrokeWidth::do_motion(double by, guint modifier) { if (modifier == 3) { // Alt, do nothing } else { double diff = value_adjust(startvalue, by, modifier, false); - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), 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); } @@ -1537,7 +1536,7 @@ RotateableStrokeWidth::do_release(double by, guint modifier) { } else { value_adjust(startvalue, by, modifier, true); startvalue_set = false; - DocumentUndo::maybeDone(sp_desktop_document(parent->getDesktop()), undokey, + DocumentUndo::maybeDone(parent->getDesktop()->getDocument(), undokey, SP_VERB_DIALOG_FILL_STROKE, (_("Adjust stroke width"))); } diff --git a/src/ui/widget/style-subject.cpp b/src/ui/widget/style-subject.cpp index 1646b0fed..a48370d9b 100644 --- a/src/ui/widget/style-subject.cpp +++ b/src/ui/widget/style-subject.cpp @@ -11,7 +11,7 @@ #include "sp-object.h" #include "xml/sp-css-attr.h" #include "desktop-style.h" -#include "desktop-handles.h" + #include "selection.h" #include "style.h" diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index e798379f2..ff525c679 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -29,7 +29,7 @@ #include "document.h" #include "document-undo.h" #include "desktop.h" -#include "desktop-handles.h" + #include "sp-namedview.h" #include "registry.h" @@ -196,7 +196,7 @@ void ToleranceSlider::update (double val) _wr->setUpdating (true); - SPDocument *doc = sp_desktop_document(dt); + SPDocument *doc = dt->getDocument(); bool saved = DocumentUndo::getUndoSensitive(doc); DocumentUndo::setUndoSensitive(doc, false); Inkscape::XML::Node *repr = dt->getNamedView()->getRepr(); |
