diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-03-18 18:17:44 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-03-18 18:17:44 +0000 |
| commit | 71508f76c3ddc33c41664599f9c10bf84d994d62 (patch) | |
| tree | 68f69fd8c5b36c4f5a288bb8b2521405724cf9ce /src/ui/tools | |
| parent | update to trunk (diff) | |
| parent | Latvian translation update (diff) | |
| download | inkscape-71508f76c3ddc33c41664599f9c10bf84d994d62.tar.gz inkscape-71508f76c3ddc33c41664599f9c10bf84d994d62.zip | |
update to trunk
(bzr r13879.1.11)
Diffstat (limited to 'src/ui/tools')
| -rw-r--r-- | src/ui/tools/arc-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/box3d-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/calligraphic-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/connector-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/dropper-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/flood-tool.cpp | 14 | ||||
| -rw-r--r-- | src/ui/tools/gradient-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/lpe-tool.cpp | 11 | ||||
| -rw-r--r-- | src/ui/tools/measure-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/mesh-tool.cpp | 26 | ||||
| -rw-r--r-- | src/ui/tools/node-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/pen-tool.cpp | 9 | ||||
| -rw-r--r-- | src/ui/tools/pencil-tool.cpp | 9 | ||||
| -rw-r--r-- | src/ui/tools/rect-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/select-tool.cpp | 9 | ||||
| -rw-r--r-- | src/ui/tools/spiral-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/spray-tool.cpp | 76 | ||||
| -rw-r--r-- | src/ui/tools/star-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/text-tool.cpp | 9 | ||||
| -rw-r--r-- | src/ui/tools/tweak-tool.cpp | 10 | ||||
| -rw-r--r-- | src/ui/tools/zoom-tool.cpp | 9 |
22 files changed, 44 insertions, 258 deletions
diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp index b9206407a..c6a9bb23a 100644 --- a/src/ui/tools/arc-tool.cpp +++ b/src/ui/tools/arc-tool.cpp @@ -48,20 +48,10 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createArcContext() { - return new ArcTool(); - } - - bool arcContextRegistered = ToolFactory::instance().registerObject("/tools/shapes/arc", createArcContext); -} - const std::string& ArcTool::getPrefsPath() { return ArcTool::prefsPath; } diff --git a/src/ui/tools/box3d-tool.cpp b/src/ui/tools/box3d-tool.cpp index f8ae685c4..538e0c7e2 100644 --- a/src/ui/tools/box3d-tool.cpp +++ b/src/ui/tools/box3d-tool.cpp @@ -52,20 +52,10 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createBox3dTool() { - return new Box3dTool(); - } - - bool Box3dToolRegistered = ToolFactory::instance().registerObject("/tools/shapes/3dbox", createBox3dTool); -} - const std::string& Box3dTool::getPrefsPath() { return Box3dTool::prefsPath; } diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp index 151ab5f89..15e6527a3 100644 --- a/src/ui/tools/calligraphic-tool.cpp +++ b/src/ui/tools/calligraphic-tool.cpp @@ -82,22 +82,12 @@ using Inkscape::DocumentUndo; #define DYNA_MIN_WIDTH 1.0e-6 -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { static void add_cap(SPCurve *curve, Geom::Point const &from, Geom::Point const &to, double rounding); -namespace { - ToolBase* createCalligraphicContext() { - return new CalligraphicTool(); - } - - bool calligraphicContextRegistered = ToolFactory::instance().registerObject("/tools/calligraphic", createCalligraphicContext); -} - const std::string& CalligraphicTool::getPrefsPath() { return CalligraphicTool::prefsPath; } diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index 26a4eadd5..d76b0d142 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -109,8 +109,6 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { @@ -147,14 +145,6 @@ static Inkscape::XML::NodeEventVector layer_repr_events = { NULL /* order_changed */ }; -namespace { - ToolBase* createConnectorContext() { - return new ConnectorTool(); - } - - bool connectorContextRegistered = ToolFactory::instance().registerObject("/tools/connector", createConnectorContext); -} - const std::string& ConnectorTool::getPrefsPath() { return ConnectorTool::prefsPath; } diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp index 9038628ee..bda9d8e8a 100644 --- a/src/ui/tools/dropper-tool.cpp +++ b/src/ui/tools/dropper-tool.cpp @@ -52,20 +52,10 @@ using Inkscape::DocumentUndo; static GdkCursor *cursor_dropper_fill = NULL; static GdkCursor *cursor_dropper_stroke = NULL; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createDropperContext() { - return new DropperTool(); - } - - bool dropperContextRegistered = ToolFactory::instance().registerObject("/tools/dropper", createDropperContext); -} - const std::string& DropperTool::getPrefsPath() { return DropperTool::prefsPath; } diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 1b4dcfe25..af0cbcb78 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -84,20 +84,10 @@ using Inkscape::DocumentUndo; #define DRAG_DEFAULT 1.0 #define DRAG_MAX 1.0 -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createEraserContext() { - return new EraserTool(); - } - - bool eraserContextRegistered = ToolFactory::instance().registerObject("/tools/eraser", createEraserContext); -} - const std::string& EraserTool::getPrefsPath() { return EraserTool::prefsPath; } diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp index e4c4e855d..bb8782dfa 100644 --- a/src/ui/tools/flood-tool.cpp +++ b/src/ui/tools/flood-tool.cpp @@ -74,20 +74,10 @@ using Inkscape::Display::ExtractARGB32; using Inkscape::Display::ExtractRGB32; using Inkscape::Display::AssembleARGB32; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createPaintbucketContext() { - return new FloodTool(); - } - - bool paintbucketContextRegistered = ToolFactory::instance().registerObject("/tools/paintbucket", createPaintbucketContext); -} - const std::string& FloodTool::getPrefsPath() { return FloodTool::prefsPath; } @@ -1097,8 +1087,8 @@ bool FloodTool::item_handler(SPItem* item, GdkEvent* event) { desktop->applyCurrentOrToolStyle(item, "/tools/paintbucket", false); DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_PAINTBUCKET, _("Set style on object")); - - ret = TRUE; + // Dead assignment: Value stored to 'ret' is never read + //ret = TRUE; } break; diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp index 5da30da7b..5be84eb76 100644 --- a/src/ui/tools/gradient-tool.cpp +++ b/src/ui/tools/gradient-tool.cpp @@ -51,22 +51,12 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { static void sp_gradient_drag(GradientTool &rc, Geom::Point const pt, guint state, guint32 etime); -namespace { - ToolBase* createGradientContext() { - return new GradientTool(); - } - - bool gradientContextRegistered = ToolFactory::instance().registerObject("/tools/gradient", createGradientContext); -} - const std::string& GradientTool::getPrefsPath() { return GradientTool::prefsPath; } diff --git a/src/ui/tools/lpe-tool.cpp b/src/ui/tools/lpe-tool.cpp index c9b656397..c0517578d 100644 --- a/src/ui/tools/lpe-tool.cpp +++ b/src/ui/tools/lpe-tool.cpp @@ -58,23 +58,12 @@ SubtoolEntry lpesubtools[] = { {Inkscape::LivePathEffect::MIRROR_SYMMETRY, "draw-geometry-mirror"} }; - -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { void sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer data); -namespace { - ToolBase* createLPEToolContext() { - return new LpeTool(); - } - - bool lpetoolContextRegistered = ToolFactory::instance().registerObject("/tools/lpetool", createLPEToolContext); -} - const std::string& LpeTool::getPrefsPath() { return LpeTool::prefsPath; } diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index b7e54b9c8..0875c29e0 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -49,22 +49,12 @@ using Inkscape::ControlManager; using Inkscape::CTLINE_SECONDARY; using Inkscape::Util::unit_table; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { std::vector<Inkscape::Display::TemporaryItem*> measure_tmp_items; -namespace { - ToolBase* createMeasureContext() { - return new MeasureTool(); - } - - bool measureContextRegistered = ToolFactory::instance().registerObject("/tools/measure", createMeasureContext); -} - const std::string& MeasureTool::getPrefsPath() { return MeasureTool::prefsPath; } diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp index d333b932e..67ed7aef1 100644 --- a/src/ui/tools/mesh-tool.cpp +++ b/src/ui/tools/mesh-tool.cpp @@ -48,27 +48,17 @@ // Mesh specific #include "ui/tools/mesh-tool.h" -#include "sp-mesh-gradient.h" +#include "sp-mesh.h" #include "display/sp-ctrlcurve.h" using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { static void sp_mesh_drag(MeshTool &rc, Geom::Point const pt, guint state, guint32 etime); -namespace { - ToolBase* createMeshContext() { - return new MeshTool(); - } - - bool meshContextRegistered = ToolFactory::instance().registerObject("/tools/mesh", createMeshContext); -} - const std::string& MeshTool::getPrefsPath() { return MeshTool::prefsPath; } @@ -172,9 +162,9 @@ void MeshTool::selection_changed(Inkscape::Selection* /*sel*/) { // if (style && (style->fill.isPaintserver())) { // SPPaintServer *server = item->style->getFillPaintServer(); - // if ( SP_IS_MESHGRADIENT(server) ) { + // if ( SP_IS_MESH(server) ) { - // SPMeshGradient *mg = SP_MESHGRADIENT(server); + // SPMesh *mg = SP_MESH(server); // guint rows = 0;//mg->array.patches.size(); // for ( guint i = 0; i < rows; ++i ) { @@ -337,8 +327,8 @@ sp_mesh_context_corner_operation (MeshTool *rc, MeshCornerOperation operation ) SPDocument *doc = NULL; GrDrag *drag = rc->_grdrag; - std::map<SPMeshGradient*, std::vector<guint> > points; - std::map<SPMeshGradient*, SPItem*> items; + std::map<SPMesh*, std::vector<guint> > points; + std::map<SPMesh*, SPItem*> items; // Get list of selected draggers for each mesh. // For all selected draggers @@ -352,7 +342,7 @@ sp_mesh_context_corner_operation (MeshTool *rc, MeshCornerOperation operation ) if( d->point_type != POINT_MG_CORNER ) continue; // Find the gradient - SPMeshGradient *gradient = SP_MESHGRADIENT( getGradient (d->item, d->fill_or_stroke) ); + SPMesh *gradient = SP_MESH( getGradient (d->item, d->fill_or_stroke) ); // Collect points together for same gradient points[gradient].push_back( d->point_i ); @@ -361,8 +351,8 @@ sp_mesh_context_corner_operation (MeshTool *rc, MeshCornerOperation operation ) } // Loop over meshes. - for( std::map<SPMeshGradient*, std::vector<guint> >::const_iterator iter = points.begin(); iter != points.end(); ++iter) { - SPMeshGradient *mg = SP_MESHGRADIENT( iter->first ); + for( std::map<SPMesh*, std::vector<guint> >::const_iterator iter = points.begin(); iter != points.end(); ++iter) { + SPMesh *mg = SP_MESH( iter->first ); if( iter->second.size() > 0 ) { guint noperation = 0; switch (operation) { diff --git a/src/ui/tools/node-tool.cpp b/src/ui/tools/node-tool.cpp index caec901a6..f8045a029 100644 --- a/src/ui/tools/node-tool.cpp +++ b/src/ui/tools/node-tool.cpp @@ -107,20 +107,10 @@ using Inkscape::ControlManager; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createNodesContext() { - return new NodeTool(); - } - - bool nodesContextRegistered = ToolFactory::instance().registerObject("/tools/nodes", createNodesContext); -} - const std::string& NodeTool::getPrefsPath() { return NodeTool::prefsPath; } diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp index 5174775c9..d28b7c27a 100644 --- a/src/ui/tools/pen-tool.cpp +++ b/src/ui/tools/pen-tool.cpp @@ -73,8 +73,6 @@ #include "live_effects/lpe-bspline.h" #include <2geom/nearest-point.h> -#include "ui/tool-factory.h" - #include "live_effects/effect.h" @@ -88,13 +86,6 @@ static Geom::Point pen_drag_origin_w(0, 0); static bool pen_within_tolerance = false; static int pen_last_paraxial_dir = 0; // last used direction in horizontal/vertical mode; 0 = horizontal, 1 = vertical const double handleCubicGap = 0.01; -namespace { - ToolBase* createPenContext() { - return new PenTool(); - } - - bool penContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pen", createPenContext); -} const std::string& PenTool::getPrefsPath() { return PenTool::prefsPath; diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index 28fed3a8f..db24c7432 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -43,7 +43,6 @@ #include "display/sp-canvas.h" #include "display/curve.h" #include "livarot/Path.h" -#include "ui/tool-factory.h" #include "ui/tool/event-utils.h" namespace Inkscape { @@ -55,14 +54,6 @@ static bool pencil_within_tolerance = false; static bool in_svg_plane(Geom::Point const &p) { return Geom::LInfty(p) < 1e18; } -namespace { - ToolBase* createPencilContext() { - return new PencilTool(); - } - - bool pencilContextRegistered = ToolFactory::instance().registerObject("/tools/freehand/pencil", createPencilContext); -} - const std::string& PencilTool::getPrefsPath() { return PencilTool::prefsPath; } diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 9476ff624..62a9006ea 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -46,20 +46,10 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createRectContext() { - return new RectTool(); - } - - bool rectContextRegistered = ToolFactory::instance().registerObject("/tools/shapes/rect", createRectContext); -} - const std::string& RectTool::getPrefsPath() { return RectTool::prefsPath; } diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp index 939b1a0b3..40b994968 100644 --- a/src/ui/tools/select-tool.cpp +++ b/src/ui/tools/select-tool.cpp @@ -49,7 +49,6 @@ #include "display/sp-canvas.h" #include "display/sp-canvas-item.h" #include "display/drawing-item.h" -#include "ui/tool-factory.h" using Inkscape::DocumentUndo; @@ -65,14 +64,6 @@ static GdkCursor *CursorSelectDragging = NULL; static gint rb_escaped = 0; // if non-zero, rubberband was canceled by esc, so the next button release should not deselect static gint drag_escaped = 0; // if non-zero, drag was canceled by esc -namespace { - ToolBase* createSelectContext() { - return new SelectTool(); - } - - bool selectContextRegistered = ToolFactory::instance().registerObject("/tools/select", createSelectContext); -} - const std::string& SelectTool::getPrefsPath() { return SelectTool::prefsPath; } diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp index f208e1c43..833fef18d 100644 --- a/src/ui/tools/spiral-tool.cpp +++ b/src/ui/tools/spiral-tool.cpp @@ -45,20 +45,10 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createSpiralContext() { - return new SpiralTool(); - } - - bool spiralContextRegistered = ToolFactory::instance().registerObject("/tools/shapes/spiral", createSpiralContext); -} - const std::string& SpiralTool::getPrefsPath() { return SpiralTool::prefsPath; } diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index a01c5c55b..ec7d10e13 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -84,20 +84,10 @@ using namespace std; // Please enable again when working on 1.0 #define ENABLE_SPRAY_MODE_SINGLE_PATH -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createSprayContext() { - return new SprayTool(); - } - - bool sprayContextRegistered = ToolFactory::instance().registerObject("/tools/spray", createSprayContext); -} - const std::string& SprayTool::getPrefsPath() { return SprayTool::prefsPath; } @@ -449,39 +439,41 @@ static bool sp_spray_recursive(SPDesktop *desktop, } i++; } - SPDocument *doc = parent_item->document; - Inkscape::XML::Document* xml_doc = doc->getReprDoc(); - Inkscape::XML::Node *old_repr = parent_item->getRepr(); - Inkscape::XML::Node *parent = old_repr->parent(); - - Geom::OptRect a = parent_item->documentVisualBounds(); - if (a) { - if (_fid <= population) { // Rules the population of objects sprayed - // Duplicates the parent item - Inkscape::XML::Node *copy = old_repr->duplicate(xml_doc); - parent->appendChild(copy); - SPObject *new_obj = doc->getObjectByRepr(copy); - item_copied = dynamic_cast<SPItem *>(new_obj); - - // Move around the cursor - Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); - - Geom::Point center = parent_item->getCenter(); - sp_spray_scale_rel(center, desktop, item_copied, Geom::Scale(_scale, _scale)); - sp_spray_scale_rel(center, desktop, item_copied, Geom::Scale(scale, scale)); - sp_spray_rotate_rel(center, desktop, item_copied, Geom::Rotate(angle)); - sp_item_move_rel(item_copied, Geom::Translate(move[Geom::X], -move[Geom::Y])); - - // Union and duplication - selection->clear(); - selection->add(item_copied); - if (unionResult) { // No need to add the very first item (initialized with NULL). - selection->add(unionResult); + if (parent_item) { + SPDocument *doc = parent_item->document; + Inkscape::XML::Document* xml_doc = doc->getReprDoc(); + Inkscape::XML::Node *old_repr = parent_item->getRepr(); + Inkscape::XML::Node *parent = old_repr->parent(); + + Geom::OptRect a = parent_item->documentVisualBounds(); + if (a) { + if (_fid <= population) { // Rules the population of objects sprayed + // Duplicates the parent item + Inkscape::XML::Node *copy = old_repr->duplicate(xml_doc); + parent->appendChild(copy); + SPObject *new_obj = doc->getObjectByRepr(copy); + item_copied = dynamic_cast<SPItem *>(new_obj); + + // Move around the cursor + Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); + + Geom::Point center = parent_item->getCenter(); + sp_spray_scale_rel(center, desktop, item_copied, Geom::Scale(_scale, _scale)); + sp_spray_scale_rel(center, desktop, item_copied, Geom::Scale(scale, scale)); + sp_spray_rotate_rel(center, desktop, item_copied, Geom::Rotate(angle)); + sp_item_move_rel(item_copied, Geom::Translate(move[Geom::X], -move[Geom::Y])); + + // Union and duplication + selection->clear(); + selection->add(item_copied); + if (unionResult) { // No need to add the very first item (initialized with NULL). + selection->add(unionResult); + } + sp_selected_path_union_skip_undo(selection, selection->desktop()); + selection->add(parent_item); + Inkscape::GC::release(copy); + did = true; } - sp_selected_path_union_skip_undo(selection, selection->desktop()); - selection->add(parent_item); - Inkscape::GC::release(copy); - did = true; } } #endif diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp index df311f2d8..9190ae57b 100644 --- a/src/ui/tools/star-tool.cpp +++ b/src/ui/tools/star-tool.cpp @@ -49,20 +49,10 @@ using Inkscape::DocumentUndo; -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createStarContext() { - return new StarTool(); - } - - bool starContextRegistered = ToolFactory::instance().registerObject("/tools/shapes/star", createStarContext); -} - const std::string& StarTool::getPrefsPath() { return StarTool::prefsPath; } diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index df0583d67..a2c0c81ae 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -52,7 +52,6 @@ #include "xml/node-event-vector.h" #include "xml/repr.h" #include <gtk/gtk.h> -#include "ui/tool-factory.h" using Inkscape::ControlManager; using Inkscape::DocumentUndo; @@ -71,14 +70,6 @@ static gint sptc_focus_in(GtkWidget *widget, GdkEventFocus *event, TextTool *tc) static gint sptc_focus_out(GtkWidget *widget, GdkEventFocus *event, TextTool *tc); static void sptc_commit(GtkIMContext *imc, gchar *string, TextTool *tc); -namespace { - ToolBase* createTextContext() { - return new TextTool(); - } - - bool textContextRegistered = ToolFactory::instance().registerObject("/tools/text", createTextContext); -} - const std::string& TextTool::getPrefsPath() { return TextTool::prefsPath; } diff --git a/src/ui/tools/tweak-tool.cpp b/src/ui/tools/tweak-tool.cpp index 5e53fdb93..80b52fba6 100644 --- a/src/ui/tools/tweak-tool.cpp +++ b/src/ui/tools/tweak-tool.cpp @@ -91,20 +91,10 @@ using Inkscape::DocumentUndo; #define DYNA_MIN_WIDTH 1.0e-6 -#include "ui/tool-factory.h" - namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createTweakContext() { - return new TweakTool(); - } - - bool tweakContextRegistered = ToolFactory::instance().registerObject("/tools/tweak", createTweakContext); -} - const std::string& TweakTool::getPrefsPath() { return TweakTool::prefsPath; } diff --git a/src/ui/tools/zoom-tool.cpp b/src/ui/tools/zoom-tool.cpp index b3fb78c8f..6a4d4dbbd 100644 --- a/src/ui/tools/zoom-tool.cpp +++ b/src/ui/tools/zoom-tool.cpp @@ -25,20 +25,11 @@ #include "selection-chemistry.h" #include "ui/tools/zoom-tool.h" -#include "ui/tool-factory.h" namespace Inkscape { namespace UI { namespace Tools { -namespace { - ToolBase* createZoomContext() { - return new ZoomTool(); - } - - bool zoomContextRegistered = ToolFactory::instance().registerObject("/tools/zoom", createZoomContext); -} - const std::string& ZoomTool::getPrefsPath() { return ZoomTool::prefsPath; } |
