From 6f85c122e081723e51e8064dd1c71dcce1e76315 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Mon, 7 May 2012 23:37:38 -0700 Subject: Follow-up conversion from bool. (bzr r11347) --- src/widgets/fill-style.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index d9d818643..fe24d0165 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -566,15 +566,19 @@ void FillNStroke::updateFromPaint() } if (!vector) { - SPGradient *gr = sp_gradient_vector_for_object( document, desktop, reinterpret_cast(i->data), kind == FILL, createSwatch ); + SPGradient *gr = sp_gradient_vector_for_object( document, + desktop, + reinterpret_cast(i->data), + (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE, + createSwatch ); if ( gr && createSwatch ) { gr->setSwatch(); } sp_item_set_gradient(SP_ITEM(i->data), gr, - gradient_type, kind == FILL); + gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE); } else { - sp_item_set_gradient(SP_ITEM(i->data), vector, gradient_type, kind == FILL); + sp_item_set_gradient(SP_ITEM(i->data), vector, gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE); } } } else { @@ -587,7 +591,7 @@ void FillNStroke::updateFromPaint() sp_repr_css_change_recursive(reinterpret_cast(i->data)->getRepr(), css, "style"); } - SPGradient *gr = sp_item_set_gradient(SP_ITEM(i->data), vector, gradient_type, kind == FILL); + SPGradient *gr = sp_item_set_gradient(SP_ITEM(i->data), vector, gradient_type, (kind == FILL) ? Inkscape::FOR_FILL : Inkscape::FOR_STROKE); psel->pushAttrsToGradient( gr ); } } -- cgit v1.2.3 From bc8ef04f993b3f17c55dbcbeac7d942994eb05d1 Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 1 Aug 2012 16:53:08 +0900 Subject: Fix for 1029302 : Fill/Stroke dialog does not update on tool change (bzr r11579) --- src/widgets/fill-style.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index fe24d0165..32619de1f 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -84,6 +84,7 @@ private: static void fillruleChangedCB( SPPaintSelector *psel, SPPaintSelector::FillRule mode, FillNStroke *self ); void selectionModifiedCB(guint flags); + void eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext); void dragFromPaint(); void updateFromPaint(); @@ -99,6 +100,7 @@ private: sigc::connection selectChangedConn; sigc::connection subselChangedConn; sigc::connection selectModifiedConn; + sigc::connection eventContextConn; }; } // namespace Inkscape @@ -133,7 +135,8 @@ FillNStroke::FillNStroke( FillOrStroke kind ) : update(false), selectChangedConn(), subselChangedConn(), - selectModifiedConn() + selectModifiedConn(), + eventContextConn() { // Add and connect up the paint selector widget: psel = sp_paint_selector_new(kind); @@ -169,6 +172,7 @@ FillNStroke::~FillNStroke() selectModifiedConn.disconnect(); subselChangedConn.disconnect(); selectChangedConn.disconnect(); + eventContextConn.disconnect(); } /** @@ -197,11 +201,13 @@ void FillNStroke::setDesktop(SPDesktop *desktop) selectModifiedConn.disconnect(); subselChangedConn.disconnect(); selectChangedConn.disconnect(); + eventContextConn.disconnect(); } this->desktop = desktop; if (desktop && desktop->selection) { selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &FillNStroke::performUpdate))); subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &FillNStroke::performUpdate))); + eventContextConn = desktop->connectEventContextChanged(sigc::hide(sigc::bind(sigc::mem_fun(*this, &FillNStroke::eventContextCB), (SPEventContext *)NULL))); // Must check flags, so can't call performUpdate() directly. selectModifiedConn = desktop->selection->connectModified(sigc::hide<0>(sigc::mem_fun(*this, &FillNStroke::selectionModifiedCB))); @@ -210,6 +216,16 @@ void FillNStroke::setDesktop(SPDesktop *desktop) } } +/** + * Listen to this "change in tool" event, in case a subselection tool (such as Gradient or Node) selection + * is changed back to a selection tool - especially needed for selected gradient stops. + */ +void FillNStroke::eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext) +{ + performUpdate(); +} + + /** * Gets the active fill or stroke style property, then sets the appropriate * color, alpha, gradient, pattern, etc. for the paint-selector. -- cgit v1.2.3 From cfe9c94712a2ff6849b123672e51b603f20e76ae Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 10 Jan 2013 23:30:09 -0800 Subject: Warning and dead code cleanup. (bzr r12014) --- 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 32619de1f..d4186cd93 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -220,7 +220,7 @@ void FillNStroke::setDesktop(SPDesktop *desktop) * Listen to this "change in tool" event, in case a subselection tool (such as Gradient or Node) selection * is changed back to a selection tool - especially needed for selected gradient stops. */ -void FillNStroke::eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext) +void FillNStroke::eventContextCB(SPDesktop * /*desktop*/, SPEventContext * /*eventcontext*/) { performUpdate(); } -- cgit v1.2.3 From 0cdd007ebf8dcfbd39c1d36ab53f43617eb692df Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 25 Mar 2013 17:42:31 +0000 Subject: Workaround usage of deprecated glib symbols in 3rd party libraries Fixed bugs: - https://launchpad.net/bugs/1122774 (bzr r12243) --- 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 d4186cd93..60e115f54 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -22,8 +22,8 @@ # include "config.h" #endif -#include #include +#include #include "verbs.h" -- cgit v1.2.3 From 3c82e8251460b21c8046a418a9fefb700db0a164 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Tue, 4 Jun 2013 01:52:40 -0700 Subject: Correct to compile against recent gtkmm, including updated macports versions. Fixes bug #1179338. Fixed bugs: - https://launchpad.net/bugs/1179338 (bzr r12346.1.1) --- src/widgets/fill-style.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index 60e115f54..6882e263e 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -22,6 +22,8 @@ # include "config.h" #endif +#include + #include #include -- cgit v1.2.3 From 72d8e897c6b67e46b2a613c4743ef9c13de25059 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Thu, 6 Jun 2013 06:44:11 -0700 Subject: Added configure/ifdef guards to only bring in the needed #include if glibmm has it. (bzr r12353) --- src/widgets/fill-style.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/fill-style.cpp') diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index 6882e263e..d9d62d3ec 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -22,7 +22,9 @@ # include "config.h" #endif +#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H #include +#endif #include #include -- cgit v1.2.3 From 55b451bf382e0c3d5ed8728e42fbb535acfa8a33 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Thu, 7 Nov 2013 21:44:00 +0100 Subject: First step of moving tools into appropriate namespaces. (bzr r12782) --- 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 d9d62d3ec..d1d318abe 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -88,7 +88,7 @@ private: static void fillruleChangedCB( SPPaintSelector *psel, SPPaintSelector::FillRule mode, FillNStroke *self ); void selectionModifiedCB(guint flags); - void eventContextCB(SPDesktop *desktop, SPEventContext *eventcontext); + void eventContextCB(SPDesktop *desktop, Inkscape::UI::Tools::ToolBase *eventcontext); void dragFromPaint(); void updateFromPaint(); @@ -211,7 +211,7 @@ void FillNStroke::setDesktop(SPDesktop *desktop) if (desktop && desktop->selection) { selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &FillNStroke::performUpdate))); subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &FillNStroke::performUpdate))); - eventContextConn = desktop->connectEventContextChanged(sigc::hide(sigc::bind(sigc::mem_fun(*this, &FillNStroke::eventContextCB), (SPEventContext *)NULL))); + eventContextConn = desktop->connectEventContextChanged(sigc::hide(sigc::bind(sigc::mem_fun(*this, &FillNStroke::eventContextCB), (Inkscape::UI::Tools::ToolBase *)NULL))); // Must check flags, so can't call performUpdate() directly. selectModifiedConn = desktop->selection->connectModified(sigc::hide<0>(sigc::mem_fun(*this, &FillNStroke::selectionModifiedCB))); @@ -224,7 +224,7 @@ void FillNStroke::setDesktop(SPDesktop *desktop) * Listen to this "change in tool" event, in case a subselection tool (such as Gradient or Node) selection * is changed back to a selection tool - especially needed for selected gradient stops. */ -void FillNStroke::eventContextCB(SPDesktop * /*desktop*/, SPEventContext * /*eventcontext*/) +void FillNStroke::eventContextCB(SPDesktop * /*desktop*/, Inkscape::UI::Tools::ToolBase * /*eventcontext*/) { performUpdate(); } -- cgit v1.2.3