From 7572ee2641532716d219a9a11f03e87511ed0bab Mon Sep 17 00:00:00 2001 From: John Smith Date: Tue, 8 May 2012 14:21:59 +0900 Subject: Fix for 986446 : Refactor toolbox into tool specific files (bzr r11346) --- src/widgets/paintbucket-toolbar.cpp | 250 ++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 src/widgets/paintbucket-toolbar.cpp (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp new file mode 100644 index 000000000..58308ded0 --- /dev/null +++ b/src/widgets/paintbucket-toolbar.cpp @@ -0,0 +1,250 @@ +/** + * @file + * Paint bucket aux toolbar + */ +/* Authors: + * MenTaLguY + * Lauris Kaplinski + * bulia byak + * Frank Felfe + * John Cliff + * David Turner + * Josh Andler + * Jon A. Cruz + * Maximilian Albert + * Tavmjong Bah + * Abhishek Sharma + * Kris De Gussem + * + * Copyright (C) 2004 David Turner + * Copyright (C) 2003 MenTaLguY + * Copyright (C) 1999-2011 authors + * Copyright (C) 2001-2002 Ximian, Inc. + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + + +#include "toolbox.h" +#include "paintbucket-toolbar.h" + +#include "../desktop.h" +#include "../desktop-handles.h" +#include "document-undo.h" +#include "../verbs.h" +#include "../inkscape.h" +#include "../connection-pool.h" +#include "../selection-chemistry.h" +#include "../selection.h" +#include "../ege-adjustment-action.h" +#include "../ege-output-action.h" +#include "../ege-select-one-action.h" +#include "../ink-action.h" +#include "../ink-comboboxentry-action.h" +#include "../widgets/button.h" +#include "../widgets/spinbutton-events.h" +#include "ui/widget/spinbutton.h" +#include "../widgets/spw-utilities.h" +#include "../widgets/widget-sizes.h" +#include "../xml/node-event-vector.h" +#include "../xml/repr.h" +#include "ui/uxmanager.h" +#include "../ui/icon-names.h" +#include "../helper/unit-menu.h" +#include "../helper/units.h" +#include "../helper/unit-tracker.h" +#include "../pen-context.h" +#include "../sp-namedview.h" +#include "../flood-context.h" + +#include + + +using Inkscape::UnitTracker; +using Inkscape::UI::UXManager; +using Inkscape::DocumentUndo; +using Inkscape::UI::ToolboxFactory; +using Inkscape::UI::PrefPusher; + + + +//######################### +//## Paintbucket ## +//######################### + +static void paintbucket_channels_changed(EgeSelectOneAction* act, GObject* /*tbl*/) +{ + gint channels = ege_select_one_action_get_active( act ); + flood_channels_set_channels( channels ); +} + +static void paintbucket_threshold_changed(GtkAdjustment *adj, GObject * /*tbl*/) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setInt("/tools/paintbucket/threshold", (gint)gtk_adjustment_get_value(adj)); +} + +static void paintbucket_autogap_changed(EgeSelectOneAction* act, GObject * /*tbl*/) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setBool("/tools/paintbucket/autogap", ege_select_one_action_get_active( act )); +} + +static void paintbucket_offset_changed(GtkAdjustment *adj, GObject *tbl) +{ + UnitTracker* tracker = static_cast(g_object_get_data( tbl, "tracker" )); + SPUnit const *unit = tracker->getActiveUnit(); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + + // Don't adjust the offset value because we're saving the + // unit and it'll be correctly handled on load. + prefs->setDouble("/tools/paintbucket/offset", (gdouble)gtk_adjustment_get_value(adj)); + prefs->setString("/tools/paintbucket/offsetunits", sp_unit_get_abbreviation(unit)); +} + +static void paintbucket_defaults(GtkWidget *, GObject *tbl) +{ + // FIXME: make defaults settable via Inkscape Options + struct KeyValue { + char const *key; + double value; + } const key_values[] = { + {"threshold", 15}, + {"offset", 0.0} + }; + + for (unsigned i = 0; i < G_N_ELEMENTS(key_values); ++i) { + KeyValue const &kv = key_values[i]; + GtkAdjustment* adj = static_cast(g_object_get_data(tbl, kv.key)); + if ( adj ) { + gtk_adjustment_set_value(adj, kv.value); + } + } + + EgeSelectOneAction* channels_action = EGE_SELECT_ONE_ACTION( g_object_get_data (tbl, "channels_action" ) ); + ege_select_one_action_set_active( channels_action, FLOOD_CHANNELS_RGB ); + EgeSelectOneAction* autogap_action = EGE_SELECT_ONE_ACTION( g_object_get_data (tbl, "autogap_action" ) ); + ege_select_one_action_set_active( autogap_action, 0 ); +} + +void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) +{ + EgeAdjustmentAction* eact = 0; + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + + { + GtkListStore* model = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_INT ); + + GList* items = 0; + gint count = 0; + for ( items = flood_channels_dropdown_items_list(); items ; items = g_list_next(items) ) + { + GtkTreeIter iter; + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, 0, reinterpret_cast(items->data), 1, count, -1 ); + count++; + } + g_list_free( items ); + items = 0; + EgeSelectOneAction* act1 = ege_select_one_action_new( "ChannelsAction", _("Fill by"), (""), NULL, GTK_TREE_MODEL(model) ); + g_object_set( act1, "short_label", _("Fill by:"), NULL ); + ege_select_one_action_set_appearance( act1, "compact" ); + ege_select_one_action_set_active( act1, prefs->getInt("/tools/paintbucket/channels", 0) ); + g_signal_connect( G_OBJECT(act1), "changed", G_CALLBACK(paintbucket_channels_changed), holder ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act1) ); + g_object_set_data( holder, "channels_action", act1 ); + } + + // Spacing spinbox + { + eact = create_adjustment_action( + "ThresholdAction", + _("Fill Threshold"), _("Threshold:"), + _("The maximum allowed difference between the clicked pixel and the neighboring pixels to be counted in the fill"), + "/tools/paintbucket/threshold", 5, GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, + "inkscape:paintbucket-threshold", 0, 100.0, 1.0, 10.0, + 0, 0, 0, + paintbucket_threshold_changed, 1, 0 ); + + ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT ); + gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); + } + + // Create the units menu. + UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); + Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits"); + if (!stored_unit.empty()) { + tracker->setActiveUnit(sp_unit_get_by_abbreviation(stored_unit.data())); + } + g_object_set_data( holder, "tracker", tracker ); + { + GtkAction* act = tracker->createAction( "PaintbucketUnitsAction", _("Units"), ("") ); + gtk_action_group_add_action( mainActions, act ); + } + + // Offset spinbox + { + eact = create_adjustment_action( + "OffsetAction", + _("Grow/shrink by"), _("Grow/shrink by:"), + _("The amount to grow (positive) or shrink (negative) the created fill path"), + "/tools/paintbucket/offset", 0, GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, TRUE, + "inkscape:paintbucket-offset", -1e4, 1e4, 0.1, 0.5, + 0, 0, 0, + paintbucket_offset_changed, 1, 2); + tracker->addAdjustment( ege_adjustment_action_get_adjustment(eact) ); + + gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); + } + + /* Auto Gap */ + { + GtkListStore* model = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_INT ); + + GList* items = 0; + gint count = 0; + for ( items = flood_autogap_dropdown_items_list(); items ; items = g_list_next(items) ) + { + GtkTreeIter iter; + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, 0, reinterpret_cast(items->data), 1, count, -1 ); + count++; + } + g_list_free( items ); + items = 0; + EgeSelectOneAction* act2 = ege_select_one_action_new( "AutoGapAction", _("Close gaps"), (""), NULL, GTK_TREE_MODEL(model) ); + g_object_set( act2, "short_label", _("Close gaps:"), NULL ); + ege_select_one_action_set_appearance( act2, "compact" ); + ege_select_one_action_set_active( act2, prefs->getBool("/tools/paintbucket/autogap") ); + g_signal_connect( G_OBJECT(act2), "changed", G_CALLBACK(paintbucket_autogap_changed), holder ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act2) ); + g_object_set_data( holder, "autogap_action", act2 ); + } + + /* Reset */ + { + GtkAction* act = gtk_action_new( "PaintbucketResetAction", + _("Defaults"), + _("Reset paint bucket parameters to defaults (use Inkscape Preferences > Tools to change defaults)"), + GTK_STOCK_CLEAR ); + g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(paintbucket_defaults), holder ); + gtk_action_group_add_action( mainActions, act ); + gtk_action_set_sensitive( act, TRUE ); + } + +} + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : -- cgit v1.2.3 From 97507bc4eae716f9e4476c7d036096e3459970ef Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Mon, 28 May 2012 10:33:28 +0100 Subject: Build with GDK_DISABLE_DEPRECATED for Gtk+ 2 Fixed bugs: - https://launchpad.net/bugs/943207 (bzr r11431) --- src/widgets/paintbucket-toolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 58308ded0..bedba0859 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -29,6 +29,7 @@ #endif +#include "ui/widget/spinbutton.h" #include "toolbox.h" #include "paintbucket-toolbar.h" @@ -47,7 +48,6 @@ #include "../ink-comboboxentry-action.h" #include "../widgets/button.h" #include "../widgets/spinbutton-events.h" -#include "ui/widget/spinbutton.h" #include "../widgets/spw-utilities.h" #include "../widgets/widget-sizes.h" #include "../xml/node-event-vector.h" -- cgit v1.2.3 From aa042e930bc5cce596829086ce84f2c3c7c885ad Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sun, 17 Jun 2012 00:08:03 -0700 Subject: Removed outdated classes. Pruned header to not introduce extraneous includes. (bzr r11502) --- src/widgets/paintbucket-toolbar.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index bedba0859..a99350a44 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -29,6 +29,8 @@ #endif +#include + #include "ui/widget/spinbutton.h" #include "toolbox.h" #include "paintbucket-toolbar.h" -- 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/paintbucket-toolbar.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index a99350a44..73815b86d 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -28,10 +28,8 @@ # include "config.h" #endif - -#include - #include "ui/widget/spinbutton.h" +#include #include "toolbox.h" #include "paintbucket-toolbar.h" -- cgit v1.2.3 From 389b871cdea29ace85567863c439eb0537a36f54 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 21 Apr 2013 20:45:27 +0200 Subject: Cleaned up a bit. (bzr r11608.1.102) --- src/widgets/paintbucket-toolbar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 73815b86d..50031a427 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -79,7 +79,8 @@ using Inkscape::UI::PrefPusher; static void paintbucket_channels_changed(EgeSelectOneAction* act, GObject* /*tbl*/) { gint channels = ege_select_one_action_get_active( act ); - flood_channels_set_channels( channels ); + //flood_channels_set_channels( channels ); + SPFloodContext::set_channels(channels); } static void paintbucket_threshold_changed(GtkAdjustment *adj, GObject * /*tbl*/) -- cgit v1.2.3 From a2b755108f544e938705a364d2573b049e21f26f Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 17 Jul 2013 00:15:06 -0400 Subject: Ported "widgets/text-toolbar.cpp" and "widgets/paintbucket.cpp" (bzr r12380.1.11) --- src/widgets/paintbucket-toolbar.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 73815b86d..2c782da70 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -54,9 +54,8 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" +#include "util/units.h" +#include "ui/widget/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" #include "../flood-context.h" @@ -64,7 +63,7 @@ #include -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -97,13 +96,13 @@ static void paintbucket_autogap_changed(EgeSelectOneAction* act, GObject * /*tbl static void paintbucket_offset_changed(GtkAdjustment *adj, GObject *tbl) { UnitTracker* tracker = static_cast(g_object_get_data( tbl, "tracker" )); - SPUnit const *unit = tracker->getActiveUnit(); + Unit const unit = tracker->getActiveUnit(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); // Don't adjust the offset value because we're saving the // unit and it'll be correctly handled on load. prefs->setDouble("/tools/paintbucket/offset", (gdouble)gtk_adjustment_get_value(adj)); - prefs->setString("/tools/paintbucket/offsetunits", sp_unit_get_abbreviation(unit)); + prefs->setString("/tools/paintbucket/offsetunits", unit.abbr); } static void paintbucket_defaults(GtkWidget *, GObject *tbl) @@ -175,10 +174,12 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions } // Create the units menu. - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + Inkscape::Util::UnitTable unit_table; Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits"); if (!stored_unit.empty()) { - tracker->setActiveUnit(sp_unit_get_by_abbreviation(stored_unit.data())); + Unit u = unit_table.getUnit(stored_unit); + tracker->setActiveUnit(&u); } g_object_set_data( holder, "tracker", tracker ); { -- cgit v1.2.3 From ef3bfa7e8bb2996c4042314accc34f6a72f072e1 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Fri, 19 Jul 2013 14:19:03 -0400 Subject: Removed "helper/unit-menu.h" from "widgest/toolbar.*" and associated files. (bzr r12380.1.30) --- src/widgets/paintbucket-toolbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 2c782da70..3bb1fa24a 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -164,7 +164,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions "ThresholdAction", _("Fill Threshold"), _("Threshold:"), _("The maximum allowed difference between the clicked pixel and the neighboring pixels to be counted in the fill"), - "/tools/paintbucket/threshold", 5, GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, + "/tools/paintbucket/threshold", 5, GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:paintbucket-threshold", 0, 100.0, 1.0, 10.0, 0, 0, 0, paintbucket_threshold_changed, 1, 0 ); @@ -193,7 +193,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions "OffsetAction", _("Grow/shrink by"), _("Grow/shrink by:"), _("The amount to grow (positive) or shrink (negative) the created fill path"), - "/tools/paintbucket/offset", 0, GTK_WIDGET(desktop->canvas), NULL/*us*/, holder, TRUE, + "/tools/paintbucket/offset", 0, GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:paintbucket-offset", -1e4, 1e4, 0.1, 0.5, 0, 0, 0, paintbucket_offset_changed, 1, 2); -- cgit v1.2.3 From 6ae6c0bea96eef09907091279e0678aa5f83102d Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 4 Aug 2013 18:01:18 -0400 Subject: Switched to global UnitTable. (bzr r12380.1.62) --- src/widgets/paintbucket-toolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 3bb1fa24a..7c23379cd 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -68,6 +68,7 @@ using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; +using Inkscape::Util::unit_table; @@ -175,7 +176,6 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions // Create the units menu. UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); - Inkscape::Util::UnitTable unit_table; Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits"); if (!stored_unit.empty()) { Unit u = unit_table.getUnit(stored_unit); -- cgit v1.2.3 From 5614df9770b985070122b3c08b45902317c9bd15 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sun, 15 Sep 2013 19:07:21 -0400 Subject: Enable unit evaluation in toolbars. (bzr r12475.1.22) --- src/widgets/paintbucket-toolbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 7c23379cd..7ab3bed0a 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -168,7 +168,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions "/tools/paintbucket/threshold", 5, GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:paintbucket-threshold", 0, 100.0, 1.0, 10.0, 0, 0, 0, - paintbucket_threshold_changed, 1, 0 ); + paintbucket_threshold_changed, NULL /*unit tracker*/, 1, 0 ); ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); @@ -196,7 +196,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions "/tools/paintbucket/offset", 0, GTK_WIDGET(desktop->canvas), holder, TRUE, "inkscape:paintbucket-offset", -1e4, 1e4, 0.1, 0.5, 0, 0, 0, - paintbucket_offset_changed, 1, 2); + paintbucket_offset_changed, tracker, 1, 2); tracker->addAdjustment( ege_adjustment_action_get_adjustment(eact) ); gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); -- cgit v1.2.3 From a970dc423d59ea844bdb1af48d5d9419a5e2a287 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 13 Oct 2013 00:24:05 +0200 Subject: Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ? (bzr r12679) --- src/widgets/paintbucket-toolbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 028753b59..363fadd3d 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -98,13 +98,13 @@ static void paintbucket_autogap_changed(EgeSelectOneAction* act, GObject * /*tbl static void paintbucket_offset_changed(GtkAdjustment *adj, GObject *tbl) { UnitTracker* tracker = static_cast(g_object_get_data( tbl, "tracker" )); - Unit const unit = tracker->getActiveUnit(); + Unit const *unit = tracker->getActiveUnit(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); // Don't adjust the offset value because we're saving the // unit and it'll be correctly handled on load. prefs->setDouble("/tools/paintbucket/offset", (gdouble)gtk_adjustment_get_value(adj)); - prefs->setString("/tools/paintbucket/offsetunits", unit.abbr); + prefs->setString("/tools/paintbucket/offsetunits", unit->abbr); } static void paintbucket_defaults(GtkWidget *, GObject *tbl) @@ -179,8 +179,8 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); Glib::ustring stored_unit = prefs->getString("/tools/paintbucket/offsetunits"); if (!stored_unit.empty()) { - Unit u = unit_table.getUnit(stored_unit); - tracker->setActiveUnit(&u); + Unit const *u = unit_table.getUnit(stored_unit); + tracker->setActiveUnit(u); } g_object_set_data( holder, "tracker", tracker ); { -- 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/paintbucket-toolbar.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 363fadd3d..e0d406c04 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -80,7 +80,7 @@ static void paintbucket_channels_changed(EgeSelectOneAction* act, GObject* /*tbl { gint channels = ege_select_one_action_get_active( act ); //flood_channels_set_channels( channels ); - SPFloodContext::set_channels(channels); + Inkscape::UI::Tools::FloodTool::set_channels(channels); } static void paintbucket_threshold_changed(GtkAdjustment *adj, GObject * /*tbl*/) @@ -127,7 +127,7 @@ static void paintbucket_defaults(GtkWidget *, GObject *tbl) } EgeSelectOneAction* channels_action = EGE_SELECT_ONE_ACTION( g_object_get_data (tbl, "channels_action" ) ); - ege_select_one_action_set_active( channels_action, FLOOD_CHANNELS_RGB ); + ege_select_one_action_set_active( channels_action, Inkscape::UI::Tools::FLOOD_CHANNELS_RGB ); EgeSelectOneAction* autogap_action = EGE_SELECT_ONE_ACTION( g_object_get_data (tbl, "autogap_action" ) ); ege_select_one_action_set_active( autogap_action, 0 ); } @@ -142,7 +142,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions GList* items = 0; gint count = 0; - for ( items = flood_channels_dropdown_items_list(); items ; items = g_list_next(items) ) + for ( items = Inkscape::UI::Tools::flood_channels_dropdown_items_list(); items ; items = g_list_next(items) ) { GtkTreeIter iter; gtk_list_store_append( model, &iter ); @@ -209,7 +209,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions GList* items = 0; gint count = 0; - for ( items = flood_autogap_dropdown_items_list(); items ; items = g_list_next(items) ) + for ( items = Inkscape::UI::Tools::flood_autogap_dropdown_items_list(); items ; items = g_list_next(items) ) { GtkTreeIter iter; gtk_list_store_append( model, &iter ); -- cgit v1.2.3 From c04e30df241a3ee039077425bab9b9c37abe2854 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 9 Nov 2013 23:36:13 +0100 Subject: Moved and renamed some tool-related files. (bzr r12785) --- src/widgets/paintbucket-toolbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index e0d406c04..8c4de2b32 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -56,9 +56,9 @@ #include "../ui/icon-names.h" #include "util/units.h" #include "ui/widget/unit-tracker.h" -#include "../pen-context.h" +#include "ui/tools/pen-tool.h" #include "../sp-namedview.h" -#include "../flood-context.h" +#include "ui/tools/flood-tool.h" #include -- cgit v1.2.3 From c862d2996b29dcace346d6c2e746672fd9d1949d Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Thu, 2 Jan 2014 17:34:58 +0000 Subject: Fix Gtk+ 3.10 warnings: GtkStockItem is deprecated (bzr r12868) --- src/widgets/paintbucket-toolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index 8c4de2b32..a9962b209 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -232,7 +232,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions GtkAction* act = gtk_action_new( "PaintbucketResetAction", _("Defaults"), _("Reset paint bucket parameters to defaults (use Inkscape Preferences > Tools to change defaults)"), - GTK_STOCK_CLEAR ); + INKSCAPE_ICON("edit-clear")); g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(paintbucket_defaults), holder ); gtk_action_group_add_action( mainActions, act ); gtk_action_set_sensitive( act, TRUE ); -- cgit v1.2.3 From 7825ad6d1ac979689ac79d6497079aec36c6ae4b Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 2 Mar 2014 23:58:28 +0100 Subject: Fixed includes for tools. (bzr r13097) --- src/widgets/paintbucket-toolbar.cpp | 39 +++++++++---------------------------- 1 file changed, 9 insertions(+), 30 deletions(-) (limited to 'src/widgets/paintbucket-toolbar.cpp') diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp index a9962b209..e20811de8 100644 --- a/src/widgets/paintbucket-toolbar.cpp +++ b/src/widgets/paintbucket-toolbar.cpp @@ -28,40 +28,20 @@ # include "config.h" #endif -#include "ui/widget/spinbutton.h" #include -#include "toolbox.h" -#include "paintbucket-toolbar.h" -#include "../desktop.h" -#include "../desktop-handles.h" +#include "paintbucket-toolbar.h" +#include "desktop.h" #include "document-undo.h" -#include "../verbs.h" -#include "../inkscape.h" -#include "../connection-pool.h" -#include "../selection-chemistry.h" -#include "../selection.h" -#include "../ege-adjustment-action.h" -#include "../ege-output-action.h" -#include "../ege-select-one-action.h" -#include "../ink-action.h" -#include "../ink-comboboxentry-action.h" -#include "../widgets/button.h" -#include "../widgets/spinbutton-events.h" -#include "../widgets/spw-utilities.h" -#include "../widgets/widget-sizes.h" -#include "../xml/node-event-vector.h" -#include "../xml/repr.h" +#include "ege-adjustment-action.h" +#include "ege-select-one-action.h" +#include "preferences.h" +#include "toolbox.h" +#include "ui/icon-names.h" +#include "ui/tools/flood-tool.h" #include "ui/uxmanager.h" -#include "../ui/icon-names.h" -#include "util/units.h" #include "ui/widget/unit-tracker.h" -#include "ui/tools/pen-tool.h" -#include "../sp-namedview.h" -#include "ui/tools/flood-tool.h" - -#include - +#include "util/units.h" using Inkscape::UI::Widget::UnitTracker; using Inkscape::UI::UXManager; @@ -71,7 +51,6 @@ using Inkscape::UI::PrefPusher; using Inkscape::Util::unit_table; - //######################### //## Paintbucket ## //######################### -- cgit v1.2.3