From 30b6a43219b66aba1a9ebade8aca50910f2c25cc Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 10:39:39 -0500 Subject: Deprecate and remove sp_desktop_selection in favor of SPDesktop::getSelection (bzr r13809) --- src/widgets/fill-style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index d1d318abe..ead88ddf6 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -481,7 +481,7 @@ void FillNStroke::updateFromPaint() update = true; SPDocument *document = sp_desktop_document(desktop); - Inkscape::Selection *selection = sp_desktop_selection(desktop); + Inkscape::Selection *selection = desktop->getSelection(); GSList const *items = selection->itemList(); -- cgit v1.2.3 From 3e5209fe7e0dbeb9e7d8908141788c9fab22e948 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 15:11:39 -0500 Subject: Purge sp_desktop_canvas (bzr r13811) --- src/widgets/fill-style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index ead88ddf6..820a20126 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -516,7 +516,7 @@ void FillNStroke::updateFromPaint() { if (kind == FILL) { // FIXME: fix for GTK breakage, see comment in SelectedStyle::on_opacity_changed; here it results in losing release events - sp_desktop_canvas(desktop)->forceFullRedrawAfterInterruptions(0); + desktop->getCanvas()->forceFullRedrawAfterInterruptions(0); } psel->setFlatColor( desktop, @@ -527,7 +527,7 @@ void FillNStroke::updateFromPaint() if (kind == FILL) { // resume interruptibility - sp_desktop_canvas(desktop)->endForcedFullRedraws(); + desktop->getCanvas()->endForcedFullRedraws(); } // on release, toggle undo_label so that the next drag will not be lumped with this one -- cgit v1.2.3 From 3dbf9a08680c6d7252c79397dbf12082ead61bd7 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 16:58:32 -0500 Subject: Remove sp_desktop_document and finish cleanup of desktop-handles.h (bzr r13820) --- src/widgets/fill-style.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index 820a20126..fcdc9a36b 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -35,7 +35,7 @@ #include "desktop.h" #include "selection.h" -#include "desktop-handles.h" + #include "desktop-style.h" #include "display/sp-canvas.h" #include "document-private.h" @@ -480,7 +480,7 @@ void FillNStroke::updateFromPaint() } update = true; - SPDocument *document = sp_desktop_document(desktop); + SPDocument *document = desktop->getDocument(); Inkscape::Selection *selection = desktop->getSelection(); GSList const *items = selection->itemList(); @@ -522,7 +522,7 @@ void FillNStroke::updateFromPaint() psel->setFlatColor( desktop, (kind == FILL) ? "fill" : "stroke", (kind == FILL) ? "fill-opacity" : "stroke-opacity" ); - DocumentUndo::maybeDone(sp_desktop_document(desktop), (kind == FILL) ? undo_F_label : undo_S_label, SP_VERB_DIALOG_FILL_STROKE, + DocumentUndo::maybeDone(desktop->getDocument(), (kind == FILL) ? undo_F_label : undo_S_label, SP_VERB_DIALOG_FILL_STROKE, (kind == FILL) ? _("Set fill color") : _("Set stroke color")); if (kind == FILL) { -- cgit v1.2.3 From 05f2f043bdbadefa4ea435981e1a728420d6b93c Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 25 Dec 2014 20:30:29 +0100 Subject: Remove sp_style_new(). (bzr r13822.1.6) --- src/widgets/fill-style.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index fcdc9a36b..d60a92b8b 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -252,13 +252,13 @@ void FillNStroke::performUpdate() update = true; // create temporary style - SPStyle *query = sp_style_new(desktop->doc()); + SPStyle query(desktop->doc()); // query style from desktop into it. This returns a result flag and fills query with the style of subselection, if any, or selection - int result = sp_desktop_query_style(desktop, query, (kind == FILL) ? QUERY_STYLE_PROPERTY_FILL : QUERY_STYLE_PROPERTY_STROKE); + int result = sp_desktop_query_style(desktop, &query, (kind == FILL) ? QUERY_STYLE_PROPERTY_FILL : QUERY_STYLE_PROPERTY_STROKE); - SPIPaint &targPaint = (kind == FILL) ? query->fill : query->stroke; - SPIScale24 &targOpacity = (kind == FILL) ? query->fill_opacity : query->stroke_opacity; + SPIPaint &targPaint = (kind == FILL) ? query.fill : query.stroke; + SPIScale24 &targOpacity = (kind == FILL) ? query.fill_opacity : query.stroke_opacity; switch (result) { case QUERY_STYLE_NOTHING: @@ -272,11 +272,11 @@ void FillNStroke::performUpdate() case QUERY_STYLE_MULTIPLE_AVERAGED: // TODO: treat this slightly differently, e.g. display "averaged" somewhere in paint selector case QUERY_STYLE_MULTIPLE_SAME: { - SPPaintSelector::Mode pselmode = SPPaintSelector::getModeForStyle(*query, kind); + SPPaintSelector::Mode pselmode = SPPaintSelector::getModeForStyle(query, kind); psel->setMode(pselmode); if (kind == FILL) { - psel->setFillrule(query->fill_rule.computed == ART_WIND_RULE_NONZERO? + psel->setFillrule(query.fill_rule.computed == ART_WIND_RULE_NONZERO? SPPaintSelector::FILLRULE_NONZERO : SPPaintSelector::FILLRULE_EVENODD); } @@ -284,7 +284,7 @@ void FillNStroke::performUpdate() psel->setColorAlpha(targPaint.value.color, SP_SCALE24_TO_FLOAT(targOpacity.value)); } else if (targPaint.set && targPaint.isPaintserver()) { - SPPaintServer *server = (kind == FILL) ? query->getFillPaintServer() : query->getStrokePaintServer(); + SPPaintServer *server = (kind == FILL) ? query.getFillPaintServer() : query.getStrokePaintServer(); if (server && SP_IS_GRADIENT(server) && SP_GRADIENT(server)->getVector()->isSwatch()) { SPGradient *vector = SP_GRADIENT(server)->getVector(); @@ -318,8 +318,6 @@ void FillNStroke::performUpdate() } } - sp_style_unref(query); - update = false; } @@ -562,10 +560,10 @@ void FillNStroke::updateFromPaint() if (!vector) { /* No vector in paint selector should mean that we just changed mode */ - SPStyle *query = sp_style_new(desktop->doc()); - int result = objects_query_fillstroke(const_cast(items), query, kind == FILL); + SPStyle query(desktop->doc()); + int result = objects_query_fillstroke(const_cast(items), &query, kind == FILL); if (result == QUERY_STYLE_MULTIPLE_SAME) { - SPIPaint &targPaint = (kind == FILL) ? query->fill : query->stroke; + SPIPaint &targPaint = (kind == FILL) ? query.fill : query.stroke; SPColor common; if (!targPaint.isColor()) { common = sp_desktop_get_color(desktop, kind == FILL); @@ -577,7 +575,6 @@ void FillNStroke::updateFromPaint() vector->setSwatch(); } } - sp_style_unref(query); for (GSList const *i = items; i != NULL; i = i->next) { //FIXME: see above -- cgit v1.2.3