File indexing completed on 2024-12-22 04:09:14

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2006 Jan Hambrecht <jaham@gmx.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #include "KoPathToolFactory.h"
0008 #include "KoPathTool.h"
0009 #include "KoPathShape.h"
0010 #include <kis_action_registry.h>
0011 
0012 #include <KoIcon.h>
0013 #include <klocalizedstring.h>
0014 
0015 KoPathToolFactory::KoPathToolFactory()
0016         : KoToolFactoryBase("PathTool")
0017 {
0018     setToolTip(i18n("Edit Shapes Tool"));
0019     setSection(ToolBoxSection::Main);
0020     setIconName(koIconNameCStr("shape_handling"));
0021     setPriority(2);
0022     setActivationShapeId("flake/always,KoPathShape");
0023 }
0024 
0025 KoPathToolFactory::~KoPathToolFactory()
0026 {
0027 }
0028 
0029 KoToolBase * KoPathToolFactory::createTool(KoCanvasBase *canvas)
0030 {
0031     return new KoPathTool(canvas);
0032 }
0033 
0034 QList<QAction *> KoPathToolFactory::createActionsImpl()
0035 {
0036     KisActionRegistry *actionRegistry = KisActionRegistry::instance();
0037     QList<QAction *> actions;
0038     actions << actionRegistry->makeQAction("pathpoint-corner", this);
0039     actions << actionRegistry->makeQAction("pathpoint-smooth", this);
0040     actions << actionRegistry->makeQAction("pathpoint-symmetric", this);
0041     actions << actionRegistry->makeQAction("pathpoint-curve", this);
0042     actions << actionRegistry->makeQAction("pathpoint-line", this);
0043     actions << actionRegistry->makeQAction("pathsegment-line", this);
0044     actions << actionRegistry->makeQAction("pathsegment-curve", this);
0045     actions << actionRegistry->makeQAction("pathpoint-insert", this);
0046     actions << actionRegistry->makeQAction("pathpoint-remove", this);
0047     actions << actionRegistry->makeQAction("path-break-point", this);
0048     actions << actionRegistry->makeQAction("path-break-segment", this);
0049     actions << actionRegistry->makeQAction("pathpoint-join", this);
0050     actions << actionRegistry->makeQAction("pathpoint-merge", this);
0051     actions << actionRegistry->makeQAction("convert-to-path", this);
0052     return actions;
0053 }