2017-02-21 12:42:08 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013-2016 CERN
|
2024-01-23 01:02:50 +00:00
|
|
|
* Copyright (C) 2016-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-02-21 12:42:08 +00:00
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ACTIONS_H
|
|
|
|
#define __ACTIONS_H
|
|
|
|
|
|
|
|
#include <tool/tool_action.h>
|
2021-06-06 17:26:26 +00:00
|
|
|
#include <tool/tool_event.h>
|
2017-02-21 12:42:08 +00:00
|
|
|
|
2019-06-09 21:57:23 +00:00
|
|
|
#define LEGACY_HK_NAME( x ) x
|
|
|
|
|
2017-02-21 12:42:08 +00:00
|
|
|
/**
|
2020-12-27 00:41:04 +00:00
|
|
|
* Gather all the actions that are shared by tools.
|
2017-02-21 12:42:08 +00:00
|
|
|
*
|
2020-12-27 00:41:04 +00:00
|
|
|
* The instance of a subclass of ACTIONS is created inside of #ACTION_MANAGER object that
|
|
|
|
* registers the actions.
|
2017-02-21 12:42:08 +00:00
|
|
|
*/
|
|
|
|
class ACTIONS
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual ~ACTIONS() {};
|
|
|
|
|
2019-05-24 23:36:31 +00:00
|
|
|
// Generic document actions
|
|
|
|
static TOOL_ACTION doNew; // sadly 'new' is a reserved word
|
2019-05-28 13:51:47 +00:00
|
|
|
static TOOL_ACTION newLibrary;
|
2019-06-02 18:58:09 +00:00
|
|
|
static TOOL_ACTION addLibrary;
|
2019-05-24 23:36:31 +00:00
|
|
|
static TOOL_ACTION open;
|
|
|
|
static TOOL_ACTION save;
|
|
|
|
static TOOL_ACTION saveAs;
|
2022-04-24 16:38:34 +00:00
|
|
|
static TOOL_ACTION saveCopy;
|
2019-05-24 23:36:31 +00:00
|
|
|
static TOOL_ACTION saveAll;
|
2019-05-28 13:51:47 +00:00
|
|
|
static TOOL_ACTION revert;
|
2019-05-26 15:36:40 +00:00
|
|
|
static TOOL_ACTION pageSettings;
|
2019-05-24 23:36:31 +00:00
|
|
|
static TOOL_ACTION print;
|
|
|
|
static TOOL_ACTION plot;
|
|
|
|
static TOOL_ACTION quit;
|
2022-09-14 22:28:09 +00:00
|
|
|
static TOOL_ACTION ddAddLibrary; // for drag and drop lib
|
2024-06-08 13:00:18 +00:00
|
|
|
static TOOL_ACTION openWithTextEditor;
|
2019-05-24 23:36:31 +00:00
|
|
|
|
|
|
|
// Generic edit actions
|
2017-02-06 16:00:51 +00:00
|
|
|
static TOOL_ACTION cancelInteractive;
|
2022-12-29 16:55:05 +00:00
|
|
|
static TOOL_ACTION finishInteractive;
|
2019-06-21 09:49:27 +00:00
|
|
|
static TOOL_ACTION showContextMenu;
|
2019-05-14 19:21:10 +00:00
|
|
|
static TOOL_ACTION undo;
|
|
|
|
static TOOL_ACTION redo;
|
|
|
|
static TOOL_ACTION cut;
|
|
|
|
static TOOL_ACTION copy;
|
|
|
|
static TOOL_ACTION paste;
|
2019-09-02 18:23:46 +00:00
|
|
|
static TOOL_ACTION pasteSpecial;
|
2020-08-19 22:15:44 +00:00
|
|
|
static TOOL_ACTION selectAll;
|
2023-09-06 23:44:39 +00:00
|
|
|
static TOOL_ACTION unselectAll;
|
2019-05-24 23:36:31 +00:00
|
|
|
static TOOL_ACTION duplicate;
|
|
|
|
static TOOL_ACTION doDelete; // sadly 'delete' is a reserved word
|
2019-07-31 12:10:13 +00:00
|
|
|
static TOOL_ACTION deleteTool;
|
2023-11-21 23:43:48 +00:00
|
|
|
static TOOL_ACTION leftJustify;
|
|
|
|
static TOOL_ACTION centerJustify;
|
|
|
|
static TOOL_ACTION rightJustify;
|
2024-01-28 18:28:54 +00:00
|
|
|
static TOOL_ACTION expandAll;
|
|
|
|
static TOOL_ACTION collapseAll;
|
2019-05-19 21:04:04 +00:00
|
|
|
|
2024-01-15 17:29:55 +00:00
|
|
|
// Tables
|
|
|
|
static TOOL_ACTION selectRows;
|
|
|
|
static TOOL_ACTION selectColumns;
|
|
|
|
static TOOL_ACTION selectTable;
|
|
|
|
static TOOL_ACTION addRowAbove;
|
|
|
|
static TOOL_ACTION addRowBelow;
|
|
|
|
static TOOL_ACTION addColBefore;
|
|
|
|
static TOOL_ACTION addColAfter;
|
|
|
|
static TOOL_ACTION deleteRows;
|
|
|
|
static TOOL_ACTION deleteColumns;
|
|
|
|
static TOOL_ACTION mergeCells;
|
|
|
|
static TOOL_ACTION unmergeCells;
|
2024-02-03 13:43:41 +00:00
|
|
|
static TOOL_ACTION editTable;
|
2024-01-15 17:29:55 +00:00
|
|
|
|
2019-05-19 21:04:04 +00:00
|
|
|
// Find and Replace
|
2022-09-25 15:56:41 +00:00
|
|
|
static TOOL_ACTION showSearch;
|
2019-05-15 22:49:48 +00:00
|
|
|
static TOOL_ACTION find;
|
2019-05-19 21:04:04 +00:00
|
|
|
static TOOL_ACTION findAndReplace;
|
|
|
|
static TOOL_ACTION findNext;
|
2023-01-26 14:36:41 +00:00
|
|
|
static TOOL_ACTION findPrevious;
|
2019-05-19 21:04:04 +00:00
|
|
|
static TOOL_ACTION findNextMarker;
|
|
|
|
static TOOL_ACTION replaceAndFindNext;
|
|
|
|
static TOOL_ACTION replaceAll;
|
|
|
|
static TOOL_ACTION updateFind;
|
2017-02-06 16:00:51 +00:00
|
|
|
|
2020-12-01 22:35:11 +00:00
|
|
|
// RC Lists
|
|
|
|
static TOOL_ACTION prevMarker;
|
|
|
|
static TOOL_ACTION nextMarker;
|
|
|
|
static TOOL_ACTION excludeMarker;
|
|
|
|
|
2017-02-20 18:10:20 +00:00
|
|
|
// View controls
|
2019-04-11 01:23:34 +00:00
|
|
|
static TOOL_ACTION zoomRedraw;
|
2017-02-20 18:10:20 +00:00
|
|
|
static TOOL_ACTION zoomIn;
|
|
|
|
static TOOL_ACTION zoomOut;
|
|
|
|
static TOOL_ACTION zoomInCenter;
|
|
|
|
static TOOL_ACTION zoomOutCenter;
|
2024-01-23 01:02:50 +00:00
|
|
|
static TOOL_ACTION zoomInHorizontally;
|
|
|
|
static TOOL_ACTION zoomOutHorizontally;
|
|
|
|
static TOOL_ACTION zoomInVertically;
|
|
|
|
static TOOL_ACTION zoomOutVertically;
|
2017-02-20 18:10:20 +00:00
|
|
|
static TOOL_ACTION zoomCenter;
|
|
|
|
static TOOL_ACTION zoomFitScreen;
|
2020-09-11 07:51:00 +00:00
|
|
|
static TOOL_ACTION zoomFitObjects; // Zooms to bbox of items on screen (except page border)
|
2017-02-20 18:10:20 +00:00
|
|
|
static TOOL_ACTION zoomPreset;
|
2017-08-31 02:35:30 +00:00
|
|
|
static TOOL_ACTION zoomTool;
|
2023-09-26 12:18:28 +00:00
|
|
|
static TOOL_ACTION zoomUndo;
|
|
|
|
static TOOL_ACTION zoomRedo;
|
2018-09-11 15:28:57 +00:00
|
|
|
static TOOL_ACTION centerContents;
|
2019-05-13 20:42:40 +00:00
|
|
|
static TOOL_ACTION toggleCursor;
|
|
|
|
static TOOL_ACTION toggleCursorStyle;
|
2019-06-02 18:58:09 +00:00
|
|
|
static TOOL_ACTION highContrastMode;
|
2020-07-11 17:40:23 +00:00
|
|
|
static TOOL_ACTION highContrastModeCycle;
|
2022-01-17 11:55:55 +00:00
|
|
|
static TOOL_ACTION toggleBoundingBoxes;
|
2017-02-20 18:10:20 +00:00
|
|
|
|
2019-07-04 20:56:21 +00:00
|
|
|
static TOOL_ACTION refreshPreview; // Similar to a synthetic mouseMoved event, but also
|
|
|
|
// used after a rotate, mirror, etc.
|
|
|
|
|
2020-02-07 17:06:24 +00:00
|
|
|
static TOOL_ACTION pinLibrary;
|
|
|
|
static TOOL_ACTION unpinLibrary;
|
2024-06-08 13:00:18 +00:00
|
|
|
static TOOL_ACTION showLibraryTree;
|
|
|
|
static TOOL_ACTION hideLibraryTree;
|
|
|
|
static TOOL_ACTION libraryTreeSearch;
|
2020-02-07 17:06:24 +00:00
|
|
|
|
2018-10-03 16:26:33 +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;
|
|
|
|
|
|
|
|
// Panning with keyboard
|
|
|
|
static TOOL_ACTION panUp;
|
|
|
|
static TOOL_ACTION panDown;
|
|
|
|
static TOOL_ACTION panLeft;
|
|
|
|
static TOOL_ACTION panRight;
|
|
|
|
|
2017-02-20 18:10:20 +00:00
|
|
|
// Grid control
|
|
|
|
static TOOL_ACTION gridFast1;
|
|
|
|
static TOOL_ACTION gridFast2;
|
2023-08-03 15:55:49 +00:00
|
|
|
static TOOL_ACTION gridFastCycle;
|
2017-02-20 18:10:20 +00:00
|
|
|
static TOOL_ACTION gridNext;
|
|
|
|
static TOOL_ACTION gridPrev;
|
|
|
|
static TOOL_ACTION gridSetOrigin;
|
|
|
|
static TOOL_ACTION gridResetOrigin;
|
|
|
|
static TOOL_ACTION gridPreset;
|
2019-05-13 20:42:40 +00:00
|
|
|
static TOOL_ACTION toggleGrid;
|
2023-07-23 17:51:42 +00:00
|
|
|
static TOOL_ACTION toggleGridOverrides;
|
2019-05-13 20:42:40 +00:00
|
|
|
static TOOL_ACTION gridProperties;
|
2023-08-26 12:29:24 +00:00
|
|
|
static TOOL_ACTION gridOrigin;
|
2019-05-13 20:42:40 +00:00
|
|
|
|
|
|
|
// Units
|
2020-10-03 23:34:23 +00:00
|
|
|
static TOOL_ACTION inchesUnits;
|
|
|
|
static TOOL_ACTION milsUnits;
|
|
|
|
static TOOL_ACTION millimetersUnits;
|
2020-10-04 16:14:37 +00:00
|
|
|
static TOOL_ACTION updateUnits;
|
2019-05-13 20:42:40 +00:00
|
|
|
static TOOL_ACTION toggleUnits;
|
2019-05-17 11:52:38 +00:00
|
|
|
static TOOL_ACTION togglePolarCoords;
|
2019-05-28 14:39:14 +00:00
|
|
|
static TOOL_ACTION resetLocalCoords;
|
2017-02-20 18:10:20 +00:00
|
|
|
|
2019-06-03 01:46:08 +00:00
|
|
|
// Common Tools
|
|
|
|
static TOOL_ACTION selectionTool;
|
|
|
|
static TOOL_ACTION measureTool;
|
2019-07-15 23:44:01 +00:00
|
|
|
static TOOL_ACTION pickerTool;
|
2022-11-07 19:10:24 +00:00
|
|
|
static TOOL_ACTION pickerSubTool;
|
2019-06-03 01:46:08 +00:00
|
|
|
|
2019-05-28 13:51:47 +00:00
|
|
|
// Misc
|
2023-09-26 16:25:06 +00:00
|
|
|
static TOOL_ACTION showProjectManager;
|
2019-06-02 23:17:27 +00:00
|
|
|
static TOOL_ACTION show3DViewer;
|
2019-06-04 18:46:52 +00:00
|
|
|
static TOOL_ACTION showSymbolBrowser;
|
2019-06-06 11:45:28 +00:00
|
|
|
static TOOL_ACTION showSymbolEditor;
|
2019-06-04 18:46:52 +00:00
|
|
|
static TOOL_ACTION showFootprintBrowser;
|
2019-06-06 11:45:28 +00:00
|
|
|
static TOOL_ACTION showFootprintEditor;
|
2019-06-03 13:49:17 +00:00
|
|
|
static TOOL_ACTION updatePcbFromSchematic;
|
2020-01-29 16:33:57 +00:00
|
|
|
static TOOL_ACTION updateSchematicFromPcb;
|
2023-06-21 01:57:20 +00:00
|
|
|
static TOOL_ACTION showProperties;
|
2019-06-09 21:57:23 +00:00
|
|
|
|
2019-06-21 09:49:27 +00:00
|
|
|
// Internal
|
|
|
|
static TOOL_ACTION updateMenu;
|
|
|
|
static TOOL_ACTION activatePointEditor;
|
2022-12-05 18:27:00 +00:00
|
|
|
static TOOL_ACTION cycleArcEditMode;
|
2021-11-23 20:51:37 +00:00
|
|
|
static TOOL_ACTION updatePreferences;
|
2024-01-15 17:29:55 +00:00
|
|
|
static TOOL_ACTION selectLibTreeColumns;
|
2019-06-21 09:49:27 +00:00
|
|
|
|
2019-06-09 21:57:23 +00:00
|
|
|
// Suite
|
2021-05-29 16:09:49 +00:00
|
|
|
static TOOL_ACTION openPreferences;
|
2019-06-02 23:17:27 +00:00
|
|
|
static TOOL_ACTION configurePaths;
|
|
|
|
static TOOL_ACTION showSymbolLibTable;
|
|
|
|
static TOOL_ACTION showFootprintLibTable;
|
2019-06-09 21:57:23 +00:00
|
|
|
static TOOL_ACTION gettingStarted;
|
|
|
|
static TOOL_ACTION help;
|
2023-10-04 19:42:35 +00:00
|
|
|
static TOOL_ACTION about;
|
2019-06-09 21:57:23 +00:00
|
|
|
static TOOL_ACTION listHotKeys;
|
2021-04-08 17:21:44 +00:00
|
|
|
static TOOL_ACTION donate;
|
2019-06-09 21:57:23 +00:00
|
|
|
static TOOL_ACTION getInvolved;
|
2020-05-25 00:39:15 +00:00
|
|
|
static TOOL_ACTION reportBug;
|
2019-05-28 13:51:47 +00:00
|
|
|
|
2024-01-20 23:35:29 +00:00
|
|
|
// API
|
|
|
|
static TOOL_ACTION pluginsReload;
|
|
|
|
|
2020-12-27 00:41:04 +00:00
|
|
|
///< Cursor control event types
|
2023-09-18 09:32:38 +00:00
|
|
|
enum CURSOR_EVENT_TYPE
|
|
|
|
{
|
|
|
|
CURSOR_NONE = 0,
|
|
|
|
CURSOR_UP,
|
|
|
|
CURSOR_UP_FAST,
|
|
|
|
CURSOR_DOWN,
|
|
|
|
CURSOR_DOWN_FAST,
|
|
|
|
CURSOR_LEFT,
|
|
|
|
CURSOR_LEFT_FAST,
|
|
|
|
CURSOR_RIGHT,
|
|
|
|
CURSOR_RIGHT_FAST,
|
|
|
|
CURSOR_CLICK,
|
|
|
|
CURSOR_DBL_CLICK,
|
|
|
|
CURSOR_RIGHT_CLICK
|
|
|
|
};
|
2017-02-21 12:42:08 +00:00
|
|
|
|
2020-12-27 00:41:04 +00:00
|
|
|
///< Remove event modifier flags
|
2023-09-18 09:32:38 +00:00
|
|
|
enum class REMOVE_FLAGS
|
|
|
|
{
|
|
|
|
NORMAL = 0x00,
|
|
|
|
ALT = 0x01,
|
|
|
|
CUT = 0x02
|
|
|
|
};
|
2017-02-21 12:42:08 +00:00
|
|
|
};
|
|
|
|
|
2019-04-21 23:45:34 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-27 00:41:04 +00:00
|
|
|
* Gather all the events that are shared by tools.
|
2019-04-21 23:45:34 +00:00
|
|
|
*/
|
|
|
|
class EVENTS
|
|
|
|
{
|
|
|
|
public:
|
2022-07-19 15:00:35 +00:00
|
|
|
const static TOOL_EVENT PointSelectedEvent;
|
2019-04-21 23:45:34 +00:00
|
|
|
const static TOOL_EVENT SelectedEvent;
|
|
|
|
const static TOOL_EVENT UnselectedEvent;
|
|
|
|
const static TOOL_EVENT ClearedEvent;
|
2019-05-08 18:56:03 +00:00
|
|
|
|
2022-11-18 00:45:14 +00:00
|
|
|
const static TOOL_EVENT ConnectivityChangedEvent;
|
|
|
|
|
2020-12-27 00:41:04 +00:00
|
|
|
///< Selected item had a property changed (except movement)
|
2019-05-08 18:56:03 +00:00
|
|
|
const static TOOL_EVENT SelectedItemsModified;
|
2020-08-15 18:18:04 +00:00
|
|
|
|
2020-12-27 00:41:04 +00:00
|
|
|
///< Selected items were moved, this can be very high frequency on the canvas, use with care
|
2020-08-15 18:18:04 +00:00
|
|
|
const static TOOL_EVENT SelectedItemsMoved;
|
2020-10-25 16:13:25 +00:00
|
|
|
|
2020-12-27 00:41:04 +00:00
|
|
|
///< Used to inform tools that the selection should temporarily be non-editable
|
2020-10-25 16:13:25 +00:00
|
|
|
const static TOOL_EVENT InhibitSelectionEditing;
|
|
|
|
const static TOOL_EVENT UninhibitSelectionEditing;
|
2021-09-05 20:37:52 +00:00
|
|
|
|
|
|
|
///< Used to inform tool that it should display the disambiguation menu
|
|
|
|
const static TOOL_EVENT DisambiguatePoint;
|
2023-05-31 02:06:49 +00:00
|
|
|
|
|
|
|
///< Used for hotkey feedback
|
|
|
|
const static TOOL_EVENT GridChangedByKeyEvent;
|
2023-06-18 03:47:26 +00:00
|
|
|
const static TOOL_EVENT ContrastModeChangedByKeyEvent;
|
2023-09-01 17:46:51 +00:00
|
|
|
|
|
|
|
const static TOOL_EVENT UndoRedoPreEvent;
|
|
|
|
const static TOOL_EVENT UndoRedoPostEvent;
|
|
|
|
|
2019-04-21 23:45:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __ACTIONS_H
|