From 21fa74799d08edc54fa6506e3f78fab04215241a Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 26 Feb 2014 20:31:49 +0100 Subject: Added template functions as a casting-macro replacement. (bzr r13061) --- src/widgets/pencil-toolbar.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index e8296f735..7ad23bbbd 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -102,8 +102,16 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl) // in pen tool we have more options than in pencil tool; if one of them was chosen, we do any // preparatory work here - if (SP_IS_PEN_CONTEXT(desktop->event_context)) { - Inkscape::UI::Tools::PenTool *pc = SP_PEN_CONTEXT(desktop->event_context); + //if (SP_IS_PEN_CONTEXT(desktop->event_context)) { + // Inkscape::UI::Tools::PenTool *pc = SP_PEN_CONTEXT(desktop->event_context); + // sp_pen_context_set_polyline_mode(pc); + //} + + using namespace Inkscape::UI; + using Inkscape::UI::Tools::PenTool; + + if (Tool::is_a(desktop->event_context)) { + PenTool* pc = Tool::to(desktop->event_context); sp_pen_context_set_polyline_mode(pc); } } -- cgit v1.2.3 From 3aa344e9a40d97db7cd5a89671896bab70da33a4 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 2 Mar 2014 01:31:12 +0100 Subject: Added some consts. Turned functions to member functions. (bzr r13089) --- src/widgets/pencil-toolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 7ad23bbbd..eb55f9219 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -112,7 +112,7 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl) if (Tool::is_a(desktop->event_context)) { PenTool* pc = Tool::to(desktop->event_context); - sp_pen_context_set_polyline_mode(pc); + pc->setPolylineMode(); } } -- 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/pencil-toolbar.cpp | 51 +++++++++--------------------------------- 1 file changed, 11 insertions(+), 40 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index eb55f9219..6598e995a 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -28,56 +28,27 @@ # include "config.h" #endif -#include "ui/widget/spinbutton.h" #include -#include "toolbox.h" -#include "pencil-toolbar.h" -#include "../desktop.h" -#include "../desktop-handles.h" -#include "../desktop-style.h" -#include "../document-private.h" +#include "pencil-toolbar.h" +#include "desktop.h" #include "document-undo.h" -#include "../verbs.h" -#include "../inkscape.h" -//#include "../interface.h" -//#include "../connection-pool.h" -#include "../selection-chemistry.h" -#include "../selection.h" - -#include - -#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/attribute-record.h" -#include "../xml/node-event-vector.h" -#include "../xml/repr.h" -#include "ui/uxmanager.h" - -//#include "../ui/tool/control-point-selection.h" -//#include "ui/tools/node-tool.h" -//#include "../ui/tool/multi-path-manipulator.h" -#include "../ui/icon-names.h" - +#include "ege-adjustment-action.h" +#include "ege-select-one-action.h" +#include "ink-action.h" +#include "preferences.h" +#include "toolbox.h" +#include "tools-switch.h" +#include "ui/icon-names.h" #include "ui/tools/pen-tool.h" -//#include "../sp-namedview.h" -#include "../tools-switch.h" +#include "ui/uxmanager.h" +#include "widgets/spinbutton-events.h" using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; using Inkscape::UI::PrefPusher; - - //######################## //## Pen/Pencil ## //######################## -- cgit v1.2.3 From 2af3266fc2db760a1c8771e5945a0c94587d18e8 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 26 Mar 2014 22:14:16 +0100 Subject: Cleaned up includes of tools / revert experimental casting macro replacements from r13061 (bzr r13216) --- src/widgets/pencil-toolbar.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/widgets/pencil-toolbar.cpp') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 6598e995a..682de8594 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -73,16 +73,8 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl) // in pen tool we have more options than in pencil tool; if one of them was chosen, we do any // preparatory work here - //if (SP_IS_PEN_CONTEXT(desktop->event_context)) { - // Inkscape::UI::Tools::PenTool *pc = SP_PEN_CONTEXT(desktop->event_context); - // sp_pen_context_set_polyline_mode(pc); - //} - - using namespace Inkscape::UI; - using Inkscape::UI::Tools::PenTool; - - if (Tool::is_a(desktop->event_context)) { - PenTool* pc = Tool::to(desktop->event_context); + if (SP_IS_PEN_CONTEXT(desktop->event_context)) { + Inkscape::UI::Tools::PenTool *pc = SP_PEN_CONTEXT(desktop->event_context); pc->setPolylineMode(); } } -- cgit v1.2.3