From faa38f1f6a18d5f44ebef82c7834d6b26aac34db Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 23 Jul 2013 13:44:43 +0200 Subject: Fix spelling error in filename (bzr r12430) --- src/widgets/CMakeLists.txt | 4 +- src/widgets/Makefile_insert | 4 +- src/widgets/eraser-toolbar.cpp | 172 +++++++++++++++++++++++++++++++++++++++++ src/widgets/eraser-toolbar.h | 35 +++++++++ src/widgets/erasor-toolbar.cpp | 172 ----------------------------------------- src/widgets/erasor-toolbar.h | 35 --------- src/widgets/toolbox.cpp | 2 +- 7 files changed, 212 insertions(+), 212 deletions(-) create mode 100644 src/widgets/eraser-toolbar.cpp create mode 100644 src/widgets/eraser-toolbar.h delete mode 100644 src/widgets/erasor-toolbar.cpp delete mode 100644 src/widgets/erasor-toolbar.h (limited to 'src/widgets') diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 19410ee1d..fe4433153 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -6,7 +6,7 @@ set(widgets_SRC calligraphy-toolbar.cpp connector-toolbar.cpp dropper-toolbar.cpp - erasor-toolbar.cpp + eraser-toolbar.cpp lpe-toolbar.cpp measure-toolbar.cpp mesh-toolbar.cpp @@ -62,7 +62,7 @@ set(widgets_SRC calligraphy-toolbar.h connector-toolbar.h dropper-toolbar.h - erasor-toolbar.h + eraser-toolbar.h lpe-toolbar.h measure-toolbar.h mesh-toolbar.h diff --git a/src/widgets/Makefile_insert b/src/widgets/Makefile_insert index 46f0bd645..97713cbee 100644 --- a/src/widgets/Makefile_insert +++ b/src/widgets/Makefile_insert @@ -21,8 +21,8 @@ ink_common_sources += \ widgets/eek-preview.h \ widgets/ege-paint-def.cpp \ widgets/ege-paint-def.h \ - widgets/erasor-toolbar.cpp \ - widgets/erasor-toolbar.h \ + widgets/eraser-toolbar.cpp \ + widgets/eraser-toolbar.h \ widgets/fill-style.cpp \ widgets/fill-style.h \ widgets/fill-n-stroke-factory.h \ diff --git a/src/widgets/eraser-toolbar.cpp b/src/widgets/eraser-toolbar.cpp new file mode 100644 index 000000000..aca960c00 --- /dev/null +++ b/src/widgets/eraser-toolbar.cpp @@ -0,0 +1,172 @@ +/** + * @file + * Erasor 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 "ui/widget/spinbutton.h" +#include +#include "toolbox.h" +#include "eraser-toolbar.h" +#include "calligraphy-toolbar.h" + +#include "../desktop.h" +#include "../desktop-handles.h" +#include "document-undo.h" +#include "../verbs.h" +#include "../inkscape.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 "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" + + +using Inkscape::UnitTracker; +using Inkscape::UI::UXManager; +using Inkscape::DocumentUndo; +using Inkscape::UI::ToolboxFactory; +using Inkscape::UI::PrefPusher; + +//######################## +//## Eraser ## +//######################## + +static void sp_erc_width_value_changed( GtkAdjustment *adj, GObject *tbl ) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setDouble( "/tools/eraser/width", gtk_adjustment_get_value(adj) ); + update_presets_list(tbl); +} + +static void sp_erasertb_mode_changed( EgeSelectOneAction *act, GObject *tbl ) +{ + SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); + bool eraserMode = ege_select_one_action_get_active( act ) != 0; + if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setBool( "/tools/eraser/mode", eraserMode ); + } + + // only take action if run by the attr_changed listener + if (!g_object_get_data( tbl, "freeze" )) { + // in turn, prevent listener from responding + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) ); + + /* + if ( eraserMode != 0 ) { + } else { + } + */ + // TODO finish implementation + + g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); + } +} + +void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) +{ + { + GtkListStore* model = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ); + + GtkTreeIter iter; + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, + 0, _("Delete"), + 1, _("Delete objects touched by the eraser"), + 2, INKSCAPE_ICON("draw-eraser-delete-objects"), + -1 ); + + gtk_list_store_append( model, &iter ); + gtk_list_store_set( model, &iter, + 0, _("Cut"), + 1, _("Cut out from objects"), + 2, INKSCAPE_ICON("path-difference"), + -1 ); + + EgeSelectOneAction* act = ege_select_one_action_new( "EraserModeAction", (""), (""), NULL, GTK_TREE_MODEL(model) ); + g_object_set( act, "short_label", _("Mode:"), NULL ); + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + g_object_set_data( holder, "eraser_mode_action", act ); + + ege_select_one_action_set_appearance( act, "full" ); + ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE ); + g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL ); + ege_select_one_action_set_icon_column( act, 2 ); + ege_select_one_action_set_tooltip_column( act, 1 ); + + /// @todo Convert to boolean? + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gint eraserMode = prefs->getBool("/tools/eraser/mode") ? 1 : 0; + ege_select_one_action_set_active( act, eraserMode ); + g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_erasertb_mode_changed), holder ); + } + + { + /* Width */ + gchar const* labels[] = {_("(hairline)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad stroke)")}; + gdouble values[] = {1, 3, 5, 10, 15, 20, 30, 50, 75, 100}; + EgeAdjustmentAction *eact = create_adjustment_action( "EraserWidthAction", + _("Pen Width"), _("Width:"), + _("The width of the eraser pen (relative to the visible canvas area)"), + "/tools/eraser/width", 15, + GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-eraser", + 1, 100, 1.0, 10.0, + labels, values, G_N_ELEMENTS(labels), + sp_erc_width_value_changed, 1, 0); + ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT ); + gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); + gtk_action_set_sensitive( GTK_ACTION(eact), 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 : diff --git a/src/widgets/eraser-toolbar.h b/src/widgets/eraser-toolbar.h new file mode 100644 index 000000000..b1bb3a3fa --- /dev/null +++ b/src/widgets/eraser-toolbar.h @@ -0,0 +1,35 @@ +#ifndef SEEN_ERASOR_TOOLBAR_H +#define SEEN_ERASOR_TOOLBAR_H + +/** + * @file + * Erasor 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 + */ + +#include +class SPDesktop; + +void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder); + +#endif /* !SEEN_ERASOR_TOOLBAR_H */ diff --git a/src/widgets/erasor-toolbar.cpp b/src/widgets/erasor-toolbar.cpp deleted file mode 100644 index 2e074490d..000000000 --- a/src/widgets/erasor-toolbar.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/** - * @file - * Erasor 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 "ui/widget/spinbutton.h" -#include -#include "toolbox.h" -#include "erasor-toolbar.h" -#include "calligraphy-toolbar.h" - -#include "../desktop.h" -#include "../desktop-handles.h" -#include "document-undo.h" -#include "../verbs.h" -#include "../inkscape.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 "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" - - -using Inkscape::UnitTracker; -using Inkscape::UI::UXManager; -using Inkscape::DocumentUndo; -using Inkscape::UI::ToolboxFactory; -using Inkscape::UI::PrefPusher; - -//######################## -//## Eraser ## -//######################## - -static void sp_erc_width_value_changed( GtkAdjustment *adj, GObject *tbl ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setDouble( "/tools/eraser/width", gtk_adjustment_get_value(adj) ); - update_presets_list(tbl); -} - -static void sp_erasertb_mode_changed( EgeSelectOneAction *act, GObject *tbl ) -{ - SPDesktop *desktop = static_cast(g_object_get_data( tbl, "desktop" )); - bool eraserMode = ege_select_one_action_get_active( act ) != 0; - if (DocumentUndo::getUndoSensitive(sp_desktop_document(desktop))) { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setBool( "/tools/eraser/mode", eraserMode ); - } - - // only take action if run by the attr_changed listener - if (!g_object_get_data( tbl, "freeze" )) { - // in turn, prevent listener from responding - g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) ); - - /* - if ( eraserMode != 0 ) { - } else { - } - */ - // TODO finish implementation - - g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) ); - } -} - -void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder) -{ - { - GtkListStore* model = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING ); - - GtkTreeIter iter; - gtk_list_store_append( model, &iter ); - gtk_list_store_set( model, &iter, - 0, _("Delete"), - 1, _("Delete objects touched by the eraser"), - 2, INKSCAPE_ICON("draw-eraser-delete-objects"), - -1 ); - - gtk_list_store_append( model, &iter ); - gtk_list_store_set( model, &iter, - 0, _("Cut"), - 1, _("Cut out from objects"), - 2, INKSCAPE_ICON("path-difference"), - -1 ); - - EgeSelectOneAction* act = ege_select_one_action_new( "EraserModeAction", (""), (""), NULL, GTK_TREE_MODEL(model) ); - g_object_set( act, "short_label", _("Mode:"), NULL ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); - g_object_set_data( holder, "eraser_mode_action", act ); - - ege_select_one_action_set_appearance( act, "full" ); - ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE ); - g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL ); - ege_select_one_action_set_icon_column( act, 2 ); - ege_select_one_action_set_tooltip_column( act, 1 ); - - /// @todo Convert to boolean? - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gint eraserMode = prefs->getBool("/tools/eraser/mode") ? 1 : 0; - ege_select_one_action_set_active( act, eraserMode ); - g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_erasertb_mode_changed), holder ); - } - - { - /* Width */ - gchar const* labels[] = {_("(hairline)"), 0, 0, 0, _("(default)"), 0, 0, 0, 0, _("(broad stroke)")}; - gdouble values[] = {1, 3, 5, 10, 15, 20, 30, 50, 75, 100}; - EgeAdjustmentAction *eact = create_adjustment_action( "EraserWidthAction", - _("Pen Width"), _("Width:"), - _("The width of the eraser pen (relative to the visible canvas area)"), - "/tools/eraser/width", 15, - GTK_WIDGET(desktop->canvas), NULL, holder, TRUE, "altx-eraser", - 1, 100, 1.0, 10.0, - labels, values, G_N_ELEMENTS(labels), - sp_erc_width_value_changed, 1, 0); - ege_adjustment_action_set_appearance( eact, TOOLBAR_SLIDER_HINT ); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); - gtk_action_set_sensitive( GTK_ACTION(eact), 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 : diff --git a/src/widgets/erasor-toolbar.h b/src/widgets/erasor-toolbar.h deleted file mode 100644 index b1bb3a3fa..000000000 --- a/src/widgets/erasor-toolbar.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef SEEN_ERASOR_TOOLBAR_H -#define SEEN_ERASOR_TOOLBAR_H - -/** - * @file - * Erasor 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 - */ - -#include -class SPDesktop; - -void sp_eraser_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObject* holder); - -#endif /* !SEEN_ERASOR_TOOLBAR_H */ diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index ca593976f..98a0ff51e 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -79,7 +79,7 @@ #include "calligraphy-toolbar.h" #include "connector-toolbar.h" #include "dropper-toolbar.h" -#include "erasor-toolbar.h" +#include "eraser-toolbar.h" #include "gradient-toolbar.h" #include "lpe-toolbar.h" #include "mesh-toolbar.h" -- cgit v1.2.3