2013-09-27 18:52:34 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 CERN
|
|
|
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <tool/tool_action.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class COMMON_ACTIONS
|
|
|
|
*
|
2014-02-04 15:03:56 +00:00
|
|
|
* Gathers all the actions that are shared by tools. The instance of COMMON_ACTION is created
|
|
|
|
* inside of ACTION_MANAGER object that registers the actions.
|
2013-09-27 18:52:34 +00:00
|
|
|
*/
|
|
|
|
class COMMON_ACTIONS
|
|
|
|
{
|
|
|
|
public:
|
2014-03-24 07:45:05 +00:00
|
|
|
// Selection Tool
|
2013-09-27 18:52:34 +00:00
|
|
|
/// Activation of the selection tool
|
|
|
|
static TOOL_ACTION selectionActivate;
|
|
|
|
|
2014-02-04 15:03:56 +00:00
|
|
|
/// Select a single item under the cursor position
|
|
|
|
static TOOL_ACTION selectionSingle;
|
|
|
|
|
|
|
|
/// Clears the current selection
|
|
|
|
static TOOL_ACTION selectionClear;
|
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Edit Tool
|
2013-12-03 16:11:22 +00:00
|
|
|
/// Activation of the edit tool
|
|
|
|
static TOOL_ACTION editActivate;
|
|
|
|
|
2013-09-27 18:52:34 +00:00
|
|
|
/// Rotation of selected objects
|
|
|
|
static TOOL_ACTION rotate;
|
|
|
|
|
|
|
|
/// Flipping of selected objects
|
|
|
|
static TOOL_ACTION flip;
|
2013-12-03 14:57:09 +00:00
|
|
|
|
|
|
|
/// Activation of the edit tool
|
|
|
|
static TOOL_ACTION properties;
|
2013-12-09 10:01:05 +00:00
|
|
|
|
|
|
|
/// Deleting a BOARD_ITEM
|
|
|
|
static TOOL_ACTION remove;
|
2014-02-06 14:09:38 +00:00
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Drawing Tool
|
2014-02-06 14:09:38 +00:00
|
|
|
/// Activation of the drawing tool (line)
|
2014-02-06 16:12:37 +00:00
|
|
|
static TOOL_ACTION drawLine;
|
|
|
|
|
|
|
|
/// Activation of the drawing tool (circle)
|
|
|
|
static TOOL_ACTION drawCircle;
|
2014-02-10 09:58:58 +00:00
|
|
|
|
|
|
|
/// Activation of the drawing tool (arc)
|
|
|
|
static TOOL_ACTION drawArc;
|
2014-02-10 14:40:25 +00:00
|
|
|
|
|
|
|
/// Activation of the drawing tool (text)
|
2014-04-01 12:06:19 +00:00
|
|
|
static TOOL_ACTION placeText;
|
2014-02-11 13:38:44 +00:00
|
|
|
|
|
|
|
/// Activation of the drawing tool (dimension)
|
|
|
|
static TOOL_ACTION drawDimension;
|
2014-02-11 16:15:33 +00:00
|
|
|
|
2014-02-13 15:10:32 +00:00
|
|
|
/// Activation of the drawing tool (drawing a ZONE)
|
|
|
|
static TOOL_ACTION drawZone;
|
|
|
|
|
2014-02-13 15:24:33 +00:00
|
|
|
/// Activation of the drawing tool (drawing a keepout area)
|
|
|
|
static TOOL_ACTION drawKeepout;
|
|
|
|
|
2014-02-11 16:15:33 +00:00
|
|
|
/// Activation of the drawing tool (placing a TARGET)
|
|
|
|
static TOOL_ACTION placeTarget;
|
2014-02-13 11:46:39 +00:00
|
|
|
|
|
|
|
/// Activation of the drawing tool (placing a MODULE)
|
|
|
|
static TOOL_ACTION placeModule;
|
2014-02-17 17:21:00 +00:00
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Push and Shove Router Tool
|
2014-02-17 17:21:00 +00:00
|
|
|
/// Activation of the Push and Shove router
|
|
|
|
static TOOL_ACTION routerActivate;
|
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Point Editor
|
2014-02-28 15:53:28 +00:00
|
|
|
/// Update edit points
|
|
|
|
static TOOL_ACTION pointEditorUpdate;
|
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// View controls
|
|
|
|
static TOOL_ACTION zoomIn;
|
|
|
|
static TOOL_ACTION zoomOut;
|
2014-03-24 16:20:23 +00:00
|
|
|
static TOOL_ACTION zoomInCenter;
|
|
|
|
static TOOL_ACTION zoomOutCenter;
|
2014-03-24 07:45:05 +00:00
|
|
|
static TOOL_ACTION zoomCenter;
|
|
|
|
static TOOL_ACTION zoomFitScreen;
|
|
|
|
|
|
|
|
// Display modes
|
|
|
|
static TOOL_ACTION trackDisplayMode;
|
|
|
|
static TOOL_ACTION padDisplayMode;
|
|
|
|
static TOOL_ACTION viaDisplayMode;
|
|
|
|
static TOOL_ACTION highContrastMode;
|
|
|
|
static TOOL_ACTION highContrastInc;
|
|
|
|
static TOOL_ACTION highContrastDec;
|
|
|
|
|
|
|
|
// Layer control
|
|
|
|
static TOOL_ACTION layerTop;
|
|
|
|
static TOOL_ACTION layerInner1;
|
|
|
|
static TOOL_ACTION layerInner2;
|
|
|
|
static TOOL_ACTION layerInner3;
|
|
|
|
static TOOL_ACTION layerInner4;
|
|
|
|
static TOOL_ACTION layerInner5;
|
|
|
|
static TOOL_ACTION layerInner6;
|
|
|
|
static TOOL_ACTION layerBottom;
|
|
|
|
static TOOL_ACTION layerNext;
|
|
|
|
static TOOL_ACTION layerPrev;
|
|
|
|
static TOOL_ACTION layerAlphaInc;
|
|
|
|
static TOOL_ACTION layerAlphaDec;
|
|
|
|
|
|
|
|
// Grid control
|
|
|
|
static TOOL_ACTION gridFast1;
|
|
|
|
static TOOL_ACTION gridFast2;
|
|
|
|
static TOOL_ACTION gridNext;
|
|
|
|
static TOOL_ACTION gridPrev;
|
|
|
|
|
|
|
|
// Track & via size control
|
|
|
|
static TOOL_ACTION trackWidthInc;
|
|
|
|
static TOOL_ACTION trackWidthDec;
|
|
|
|
static TOOL_ACTION viaSizeInc;
|
|
|
|
static TOOL_ACTION viaSizeDec;
|
|
|
|
|
|
|
|
// Miscellaneous
|
|
|
|
static TOOL_ACTION resetCoords;
|
|
|
|
static TOOL_ACTION switchUnits;
|
|
|
|
static TOOL_ACTION showHelp;
|
|
|
|
|
2014-02-17 17:21:00 +00:00
|
|
|
/**
|
|
|
|
* Function TranslateLegacyId()
|
|
|
|
* Translates legacy tool ids to the corresponding TOOL_ACTION name.
|
|
|
|
* @param aId is legacy tool id to be translated.
|
|
|
|
* @return std::string is name of the corresponding TOOL_ACTION. It may be empty, if there is
|
|
|
|
* no corresponding TOOL_ACTION.
|
|
|
|
*/
|
|
|
|
static std::string TranslateLegacyId( int aId );
|
2013-09-27 18:52:34 +00:00
|
|
|
};
|