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
|
|
|
|
*/
|
|
|
|
|
2015-02-18 00:04:47 +00:00
|
|
|
#ifndef __COMMON_ACTIONS_H
|
|
|
|
#define __COMMON_ACTIONS_H
|
|
|
|
|
2013-09-27 18:52:34 +00:00
|
|
|
#include <tool/tool_action.h>
|
2014-07-09 11:50:27 +00:00
|
|
|
#include <boost/optional.hpp>
|
|
|
|
|
|
|
|
class TOOL_EVENT;
|
2015-02-18 00:04:47 +00:00
|
|
|
class TOOL_MANAGER;
|
2013-09-27 18:52:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-07-09 11:50:27 +00:00
|
|
|
/// Select a single item under the cursor position
|
2014-11-21 10:49:28 +00:00
|
|
|
static TOOL_ACTION selectionCursor;
|
2014-07-09 11:50:27 +00:00
|
|
|
|
|
|
|
/// Clears the current selection
|
|
|
|
static TOOL_ACTION selectionClear;
|
|
|
|
|
2014-11-21 10:50:13 +00:00
|
|
|
/// Selects an item (specified as the event parameter).
|
|
|
|
static TOOL_ACTION selectItem;
|
|
|
|
|
|
|
|
/// Unselects an item (specified as the event parameter).
|
|
|
|
static TOOL_ACTION unselectItem;
|
|
|
|
|
2015-05-18 11:48:10 +00:00
|
|
|
/// Selects a connection between junctions.
|
2015-03-10 08:36:04 +00:00
|
|
|
static TOOL_ACTION selectConnection;
|
|
|
|
|
2015-05-18 11:48:10 +00:00
|
|
|
/// Selects whole copper connection.
|
|
|
|
static TOOL_ACTION selectCopper;
|
|
|
|
|
2015-03-10 08:36:04 +00:00
|
|
|
/// Selects all connections belonging to a single net.
|
|
|
|
static TOOL_ACTION selectNet;
|
|
|
|
|
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
|
|
|
|
2015-02-12 03:22:24 +00:00
|
|
|
/// Activation of the exact move tool
|
|
|
|
static TOOL_ACTION moveExact;
|
|
|
|
|
|
|
|
/// Activation of the duplication tool
|
|
|
|
static TOOL_ACTION duplicate;
|
|
|
|
|
|
|
|
/// Activation of the duplication tool with incrementing (e.g. pad number)
|
|
|
|
static TOOL_ACTION duplicateIncrement;
|
|
|
|
|
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-07-09 12:01:06 +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-07-09 13:02:56 +00:00
|
|
|
/// Activation of the drawing tool (placing a drawing from DXF file)
|
|
|
|
static TOOL_ACTION placeDXF;
|
|
|
|
|
2014-07-09 12:01:06 +00:00
|
|
|
/// Activation of the drawing tool (placing the footprint anchor)
|
|
|
|
static TOOL_ACTION setAnchor;
|
|
|
|
|
2014-08-04 12:23:19 +00:00
|
|
|
/// Increase width of currently drawn line
|
|
|
|
static TOOL_ACTION incWidth;
|
|
|
|
|
|
|
|
/// Decrease width of currently drawn line
|
|
|
|
static TOOL_ACTION decWidth;
|
|
|
|
|
|
|
|
/// Switch posture when drawing arc
|
|
|
|
static TOOL_ACTION arcPosture;
|
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Push and Shove Router Tool
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2014-02-17 17:21:00 +00:00
|
|
|
/// Activation of the Push and Shove router
|
2015-02-18 00:29:54 +00:00
|
|
|
static TOOL_ACTION routerActivateSingle;
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2015-02-18 00:29:54 +00:00
|
|
|
/// Activation of the Push and Shove router (differential pair mode)
|
|
|
|
static TOOL_ACTION routerActivateDiffPair;
|
|
|
|
|
|
|
|
/// Activation of the Push and Shove router (tune single line mode)
|
|
|
|
static TOOL_ACTION routerActivateTuneSingleTrace;
|
|
|
|
|
|
|
|
/// Activation of the Push and Shove router (diff pair tuning mode)
|
|
|
|
static TOOL_ACTION routerActivateTuneDiffPair;
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2015-02-18 00:29:54 +00:00
|
|
|
/// Activation of the Push and Shove router (skew tuning mode)
|
|
|
|
static TOOL_ACTION routerActivateTuneDiffPairSkew;
|
|
|
|
|
|
|
|
/// Activation of the Push and Shove settings dialogs
|
|
|
|
static TOOL_ACTION routerActivateSettingsDialog;
|
|
|
|
static TOOL_ACTION routerActivateDpDimensionsDialog;
|
2015-02-18 16:53:46 +00:00
|
|
|
|
2015-02-18 00:29:54 +00:00
|
|
|
|
|
|
|
/// Activation of the Push and Shove router (inline dragging mode)
|
|
|
|
static TOOL_ACTION routerInlineDrag;
|
2014-02-17 17:21:00 +00:00
|
|
|
|
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-07-09 14:50:31 +00:00
|
|
|
/// Break outline (insert additional points to an edge)
|
2015-06-19 15:32:33 +00:00
|
|
|
static TOOL_ACTION pointEditorAddCorner;
|
|
|
|
|
|
|
|
/// Removes a corner
|
|
|
|
static TOOL_ACTION pointEditorRemoveCorner;
|
2014-07-09 14:50:31 +00:00
|
|
|
|
2014-07-09 12:23:13 +00:00
|
|
|
// Placement tool
|
|
|
|
/// Align items to the top edge of selection bounding box
|
|
|
|
static TOOL_ACTION alignTop;
|
|
|
|
|
|
|
|
/// Align items to the bottom edge of selection bounding box
|
|
|
|
static TOOL_ACTION alignBottom;
|
|
|
|
|
|
|
|
/// Align items to the left edge of selection bounding box
|
|
|
|
static TOOL_ACTION alignLeft;
|
|
|
|
|
|
|
|
/// Align items to the right edge of selection bounding box
|
|
|
|
static TOOL_ACTION alignRight;
|
|
|
|
|
|
|
|
/// Distributes items evenly along the horizontal axis
|
|
|
|
static TOOL_ACTION distributeHorizontally;
|
|
|
|
|
|
|
|
/// Distributes items evenly along the vertical axis
|
|
|
|
static TOOL_ACTION distributeVertically;
|
|
|
|
|
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;
|
2015-04-30 08:46:02 +00:00
|
|
|
static TOOL_ACTION zoomPreset;
|
2014-03-24 07:45:05 +00:00
|
|
|
|
|
|
|
// Display modes
|
|
|
|
static TOOL_ACTION trackDisplayMode;
|
|
|
|
static TOOL_ACTION padDisplayMode;
|
|
|
|
static TOOL_ACTION viaDisplayMode;
|
2014-07-09 13:02:56 +00:00
|
|
|
static TOOL_ACTION zoneDisplayEnable;
|
|
|
|
static TOOL_ACTION zoneDisplayDisable;
|
|
|
|
static TOOL_ACTION zoneDisplayOutlines;
|
2014-03-24 07:45:05 +00:00
|
|
|
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;
|
2015-05-18 11:48:11 +00:00
|
|
|
static TOOL_ACTION layerToggle;
|
2014-03-24 07:45:05 +00:00
|
|
|
|
2014-07-09 14:25:50 +00:00
|
|
|
static TOOL_ACTION layerChanged; // notification
|
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Grid control
|
|
|
|
static TOOL_ACTION gridFast1;
|
|
|
|
static TOOL_ACTION gridFast2;
|
|
|
|
static TOOL_ACTION gridNext;
|
|
|
|
static TOOL_ACTION gridPrev;
|
2014-06-04 15:46:43 +00:00
|
|
|
static TOOL_ACTION gridSetOrigin;
|
2015-04-30 08:46:04 +00:00
|
|
|
static TOOL_ACTION gridPreset;
|
2014-03-24 07:45:05 +00:00
|
|
|
|
|
|
|
// Track & via size control
|
|
|
|
static TOOL_ACTION trackWidthInc;
|
|
|
|
static TOOL_ACTION trackWidthDec;
|
|
|
|
static TOOL_ACTION viaSizeInc;
|
|
|
|
static TOOL_ACTION viaSizeDec;
|
|
|
|
|
2014-05-13 09:22:51 +00:00
|
|
|
static TOOL_ACTION trackViaSizeChanged; // notification
|
|
|
|
|
2014-07-09 14:57:01 +00:00
|
|
|
// Zone actions
|
|
|
|
static TOOL_ACTION zoneFill;
|
|
|
|
static TOOL_ACTION zoneFillAll;
|
|
|
|
static TOOL_ACTION zoneUnfill;
|
2014-12-08 22:41:47 +00:00
|
|
|
static TOOL_ACTION zoneUnfillAll;
|
2015-06-19 15:32:33 +00:00
|
|
|
static TOOL_ACTION zoneMerge;
|
2014-07-09 13:02:56 +00:00
|
|
|
|
|
|
|
// Module editor tools
|
|
|
|
/// Activation of the drawing tool (placing a PAD)
|
|
|
|
static TOOL_ACTION placePad;
|
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
/// Tool for quick pad enumeration
|
|
|
|
static TOOL_ACTION enumeratePads;
|
|
|
|
|
2015-02-12 03:22:24 +00:00
|
|
|
/// Tool for creating an array of objects
|
|
|
|
static TOOL_ACTION createArray;
|
|
|
|
|
2014-07-09 13:02:56 +00:00
|
|
|
/// Copying module items to clipboard
|
|
|
|
static TOOL_ACTION copyItems;
|
|
|
|
|
|
|
|
/// Pasting module items from clipboard
|
|
|
|
static TOOL_ACTION pasteItems;
|
|
|
|
|
2014-07-09 13:10:32 +00:00
|
|
|
/// Display module edges as outlines
|
|
|
|
static TOOL_ACTION moduleEdgeOutlines;
|
|
|
|
|
|
|
|
/// Display module texts as outlines
|
|
|
|
static TOOL_ACTION moduleTextOutlines;
|
|
|
|
|
2015-06-30 12:08:24 +00:00
|
|
|
/// Cursor control with keyboard
|
|
|
|
static TOOL_ACTION cursorUp;
|
|
|
|
static TOOL_ACTION cursorDown;
|
|
|
|
static TOOL_ACTION cursorLeft;
|
|
|
|
static TOOL_ACTION cursorRight;
|
|
|
|
|
|
|
|
static TOOL_ACTION cursorUpFast;
|
|
|
|
static TOOL_ACTION cursorDownFast;
|
|
|
|
static TOOL_ACTION cursorLeftFast;
|
|
|
|
static TOOL_ACTION cursorRightFast;
|
|
|
|
|
|
|
|
static TOOL_ACTION cursorClick;
|
|
|
|
static TOOL_ACTION cursorDblClick;
|
|
|
|
|
2015-06-30 12:08:29 +00:00
|
|
|
// Panning with keyboard
|
|
|
|
static TOOL_ACTION panUp;
|
|
|
|
static TOOL_ACTION panDown;
|
|
|
|
static TOOL_ACTION panLeft;
|
|
|
|
static TOOL_ACTION panRight;
|
|
|
|
|
2014-03-24 07:45:05 +00:00
|
|
|
// Miscellaneous
|
2014-07-15 09:50:00 +00:00
|
|
|
static TOOL_ACTION selectionTool;
|
2015-06-18 15:51:51 +00:00
|
|
|
static TOOL_ACTION pickerTool;
|
2014-03-24 07:45:05 +00:00
|
|
|
static TOOL_ACTION resetCoords;
|
2014-07-09 13:10:32 +00:00
|
|
|
static TOOL_ACTION switchCursor;
|
2014-03-24 07:45:05 +00:00
|
|
|
static TOOL_ACTION switchUnits;
|
2015-06-18 15:51:51 +00:00
|
|
|
static TOOL_ACTION deleteItemCursor;
|
2015-06-18 15:51:50 +00:00
|
|
|
static TOOL_ACTION highlightNet;
|
2015-06-18 15:51:51 +00:00
|
|
|
static TOOL_ACTION highlightNetCursor;
|
|
|
|
static TOOL_ACTION drillOrigin;
|
2015-06-26 15:32:48 +00:00
|
|
|
static TOOL_ACTION crossProbeSchToPcb;
|
2015-09-03 15:35:41 +00:00
|
|
|
static TOOL_ACTION toggleLockModule;
|
2015-08-07 16:24:42 +00:00
|
|
|
static TOOL_ACTION appendBoard;
|
2014-03-24 07:45:05 +00:00
|
|
|
static TOOL_ACTION showHelp;
|
2014-07-09 11:50:27 +00:00
|
|
|
static TOOL_ACTION toBeDone;
|
2014-03-24 07:45:05 +00:00
|
|
|
|
2014-10-13 13:25:16 +00:00
|
|
|
/// Find an item
|
|
|
|
static TOOL_ACTION find;
|
|
|
|
|
2014-10-13 13:22:14 +00:00
|
|
|
/// Find an item and start moving
|
|
|
|
static TOOL_ACTION findMove;
|
|
|
|
|
2015-02-18 00:10:20 +00:00
|
|
|
static TOOL_ACTION editFootprintInFpEditor;
|
|
|
|
static TOOL_ACTION copyPadToSettings;
|
|
|
|
static TOOL_ACTION copySettingsToPads;
|
|
|
|
static TOOL_ACTION globalEditPads;
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
2014-07-09 11:50:27 +00:00
|
|
|
static boost::optional<TOOL_EVENT> TranslateLegacyId( int aId );
|
2015-06-30 12:08:24 +00:00
|
|
|
|
|
|
|
///> Cursor control event types
|
|
|
|
enum CURSOR_EVENT_TYPE { CURSOR_UP, CURSOR_DOWN, CURSOR_LEFT, CURSOR_RIGHT,
|
|
|
|
CURSOR_CLICK, CURSOR_DBL_CLICK, CURSOR_FAST_MOVE = 0x8000 };
|
2013-09-27 18:52:34 +00:00
|
|
|
};
|
2015-02-18 00:04:47 +00:00
|
|
|
|
2015-05-05 18:39:41 +00:00
|
|
|
void registerAllTools( TOOL_MANAGER* aToolManager );
|
2015-02-18 00:04:47 +00:00
|
|
|
|
|
|
|
#endif
|