You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

496 lines
16 KiB

11 years ago
11 years ago
11 years ago
11 years ago
6 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013-2016 CERN
  5. * Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * @author Maciej Suminski <maciej.suminski@cern.ch>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. #ifndef __PCB_ACTIONS_H
  27. #define __PCB_ACTIONS_H
  28. #include <tool/tool_action.h>
  29. #include <tool/actions.h>
  30. enum class ZONE_MODE
  31. {
  32. ADD, ///< Add a new zone/keepout with fresh settings
  33. CUTOUT, ///< Make a cutout to an existing zone
  34. SIMILAR, ///< Add a new zone with the same settings as an existing one
  35. GRAPHIC_POLYGON
  36. };
  37. /**
  38. * Gather all the actions that are shared by tools.
  39. *
  40. * The instance of PCB_ACTIONS is created inside of #ACTION_MANAGER object that registers
  41. * the actions.
  42. */
  43. class PCB_ACTIONS : public ACTIONS
  44. {
  45. public:
  46. // Selection Tool
  47. /// Activation of the selection tool
  48. static TOOL_ACTION selectionActivate;
  49. /// Select a single item under the cursor position
  50. static TOOL_ACTION selectionCursor;
  51. /// Clear the current selection
  52. static TOOL_ACTION selectionClear;
  53. /// Select an item (specified as the event parameter).
  54. static TOOL_ACTION selectItem;
  55. static TOOL_ACTION unselectItem;
  56. /// Select a list of items (specified as the event parameter)
  57. static TOOL_ACTION selectItems;
  58. static TOOL_ACTION unselectItems;
  59. /// Sets selection to specified items, zooms to fit, if enabled
  60. static TOOL_ACTION syncSelection;
  61. /// Sets selection to specified items with connected nets, zooms to fit, if enabled
  62. static TOOL_ACTION syncSelectionWithNets;
  63. /// Run a selection menu to select from a list of items
  64. static TOOL_ACTION selectionMenu;
  65. /// Select tracks between junctions or expands an existing selection to pads or the
  66. /// entire connection.
  67. static TOOL_ACTION selectConnection;
  68. /// Select all connections belonging to a single net.
  69. static TOOL_ACTION selectNet;
  70. /// Remove all connections belonging to a single net from the active selection
  71. static TOOL_ACTION deselectNet;
  72. /// Select all components on sheet from Eeschema crossprobing.
  73. static TOOL_ACTION selectOnSheetFromEeschema;
  74. /// Select all components on the same sheet as the selected footprint.
  75. static TOOL_ACTION selectSameSheet;
  76. /// Select symbols/pins on schematic corresponding to selected footprints/pads.
  77. static TOOL_ACTION selectOnSchematic;
  78. /// Filter the items in the current selection (invokes dialog)
  79. static TOOL_ACTION filterSelection;
  80. /// move or drag an item
  81. static TOOL_ACTION move;
  82. /// move with a reference point
  83. static TOOL_ACTION moveWithReference;
  84. /// copy command with manual reference point selection
  85. static TOOL_ACTION copyWithReference;
  86. /// Rotation of selected objects
  87. static TOOL_ACTION rotateCw;
  88. static TOOL_ACTION rotateCcw;
  89. /// Flipping of selected objects
  90. static TOOL_ACTION flip;
  91. /// Mirroring of selected items
  92. static TOOL_ACTION mirror;
  93. /// Update selected tracks & vias to the current track & via dimensions
  94. static TOOL_ACTION changeTrackWidth;
  95. /// Fillet (i.e. adds an arc tangent to) all selected straight tracks by a user defined radius
  96. static TOOL_ACTION filletTracks;
  97. /// Activation of the edit tool
  98. static TOOL_ACTION properties;
  99. /// Activation of the exact move tool
  100. static TOOL_ACTION moveExact;
  101. /// Activation of the duplication tool with incrementing (e.g. pad number)
  102. static TOOL_ACTION duplicateIncrement;
  103. /// Deleting a BOARD_ITEM
  104. static TOOL_ACTION remove;
  105. static TOOL_ACTION deleteFull;
  106. static TOOL_ACTION selectLayerPair;
  107. /// Break a single track into two segments at the cursor
  108. static TOOL_ACTION breakTrack;
  109. static TOOL_ACTION drag45Degree;
  110. static TOOL_ACTION dragFreeAngle;
  111. // Drawing Tool Activations
  112. static TOOL_ACTION drawLine;
  113. static TOOL_ACTION drawPolygon;
  114. static TOOL_ACTION drawRectangle;
  115. static TOOL_ACTION drawCircle;
  116. static TOOL_ACTION drawArc;
  117. static TOOL_ACTION placeImage;
  118. static TOOL_ACTION placeText;
  119. static TOOL_ACTION drawTextBox;
  120. static TOOL_ACTION drawAlignedDimension;
  121. static TOOL_ACTION drawCenterDimension;
  122. static TOOL_ACTION drawRadialDimension;
  123. static TOOL_ACTION drawOrthogonalDimension;
  124. static TOOL_ACTION drawLeader;
  125. static TOOL_ACTION drawZone;
  126. static TOOL_ACTION drawVia;
  127. static TOOL_ACTION drawRuleArea;
  128. static TOOL_ACTION drawZoneCutout;
  129. static TOOL_ACTION drawSimilarZone;
  130. static TOOL_ACTION placeCharacteristics;
  131. static TOOL_ACTION placeStackup;
  132. static TOOL_ACTION placeFootprint;
  133. static TOOL_ACTION placeImportedGraphics;
  134. static TOOL_ACTION setAnchor;
  135. static TOOL_ACTION deleteLastPoint;
  136. static TOOL_ACTION closeOutline;
  137. /// Increase width of currently drawn line
  138. static TOOL_ACTION incWidth;
  139. /// Decrease width of currently drawn line
  140. static TOOL_ACTION decWidth;
  141. /// Switch posture when drawing arc
  142. static TOOL_ACTION arcPosture;
  143. // Push and Shove Router Tool
  144. /// Activation of the Push and Shove router
  145. static TOOL_ACTION routeSingleTrack;
  146. /// Activation of the Push and Shove router (differential pair mode)
  147. static TOOL_ACTION routeDiffPair;
  148. /// Activation of the Push and Shove router (tune single line mode)
  149. static TOOL_ACTION routerTuneSingleTrace;
  150. /// Activation of the Push and Shove router (diff pair tuning mode)
  151. static TOOL_ACTION routerTuneDiffPair;
  152. /// Activation of the Push and Shove router (skew tuning mode)
  153. static TOOL_ACTION routerTuneDiffPairSkew;
  154. static TOOL_ACTION routerUndoLastSegment;
  155. static TOOL_ACTION routerContinueFromEnd;
  156. static TOOL_ACTION routerAttemptFinish;
  157. /// Activation of the Push and Shove settings dialogs
  158. static TOOL_ACTION routerSettingsDialog;
  159. static TOOL_ACTION routerDiffPairDialog;
  160. static TOOL_ACTION lengthTunerSettingsDialog;
  161. /// Actions to enable switching modes via hotkey assignments
  162. static TOOL_ACTION routerHighlightMode;
  163. static TOOL_ACTION routerShoveMode;
  164. static TOOL_ACTION routerWalkaroundMode;
  165. static TOOL_ACTION cycleRouterMode;
  166. /// Activation of the Push and Shove router (inline dragging mode)
  167. static TOOL_ACTION routerInlineDrag;
  168. // Point Editor
  169. static TOOL_ACTION pointEditorAddCorner;
  170. static TOOL_ACTION pointEditorRemoveCorner;
  171. // Group Tool
  172. static TOOL_ACTION groupProperties;
  173. static TOOL_ACTION pickNewGroupMember;
  174. // Placement Tool
  175. static TOOL_ACTION alignTop;
  176. static TOOL_ACTION alignBottom;
  177. static TOOL_ACTION alignLeft;
  178. static TOOL_ACTION alignRight;
  179. static TOOL_ACTION alignCenterX;
  180. static TOOL_ACTION alignCenterY;
  181. static TOOL_ACTION distributeHorizontally;
  182. static TOOL_ACTION distributeVertically;
  183. // Position Relative Tool
  184. /// Activation of the position relative tool
  185. static TOOL_ACTION positionRelative;
  186. /// Selection of anchor item for position relative tool
  187. static TOOL_ACTION selectpositionRelativeItem;
  188. // Display modes
  189. static TOOL_ACTION showRatsnest;
  190. static TOOL_ACTION ratsnestLineMode;
  191. static TOOL_ACTION netColorModeCycle;
  192. static TOOL_ACTION ratsnestModeCycle;
  193. static TOOL_ACTION trackDisplayMode;
  194. static TOOL_ACTION padDisplayMode;
  195. static TOOL_ACTION viaDisplayMode;
  196. static TOOL_ACTION zoneDisplayFilled;
  197. static TOOL_ACTION zoneDisplayOutline;
  198. static TOOL_ACTION zoneDisplayFractured;
  199. static TOOL_ACTION zoneDisplayTriangulated;
  200. static TOOL_ACTION zoneDisplayToggle;
  201. static TOOL_ACTION showPadNumbers;
  202. // Layer control
  203. static TOOL_ACTION layerTop;
  204. static TOOL_ACTION layerInner1;
  205. static TOOL_ACTION layerInner2;
  206. static TOOL_ACTION layerInner3;
  207. static TOOL_ACTION layerInner4;
  208. static TOOL_ACTION layerInner5;
  209. static TOOL_ACTION layerInner6;
  210. static TOOL_ACTION layerInner7;
  211. static TOOL_ACTION layerInner8;
  212. static TOOL_ACTION layerInner9;
  213. static TOOL_ACTION layerInner10;
  214. static TOOL_ACTION layerInner11;
  215. static TOOL_ACTION layerInner12;
  216. static TOOL_ACTION layerInner13;
  217. static TOOL_ACTION layerInner14;
  218. static TOOL_ACTION layerInner15;
  219. static TOOL_ACTION layerInner16;
  220. static TOOL_ACTION layerInner17;
  221. static TOOL_ACTION layerInner18;
  222. static TOOL_ACTION layerInner19;
  223. static TOOL_ACTION layerInner20;
  224. static TOOL_ACTION layerInner21;
  225. static TOOL_ACTION layerInner22;
  226. static TOOL_ACTION layerInner23;
  227. static TOOL_ACTION layerInner24;
  228. static TOOL_ACTION layerInner25;
  229. static TOOL_ACTION layerInner26;
  230. static TOOL_ACTION layerInner27;
  231. static TOOL_ACTION layerInner28;
  232. static TOOL_ACTION layerInner29;
  233. static TOOL_ACTION layerInner30;
  234. static TOOL_ACTION layerBottom;
  235. static TOOL_ACTION layerNext;
  236. static TOOL_ACTION layerPrev;
  237. static TOOL_ACTION layerAlphaInc;
  238. static TOOL_ACTION layerAlphaDec;
  239. static TOOL_ACTION layerToggle;
  240. static TOOL_ACTION layerChanged; // notification
  241. static TOOL_ACTION flipBoard;
  242. // Track & via size control
  243. static TOOL_ACTION trackWidthInc;
  244. static TOOL_ACTION trackWidthDec;
  245. static TOOL_ACTION viaSizeInc;
  246. static TOOL_ACTION viaSizeDec;
  247. static TOOL_ACTION trackViaSizeChanged; // notification
  248. // Zone actions
  249. static TOOL_ACTION zoneFill;
  250. static TOOL_ACTION zoneFillAll;
  251. static TOOL_ACTION zoneFillDirty;
  252. static TOOL_ACTION zoneUnfill;
  253. static TOOL_ACTION zoneUnfillAll;
  254. static TOOL_ACTION zoneMerge;
  255. /// Duplicate zone onto another layer
  256. static TOOL_ACTION zoneDuplicate;
  257. /// Scripting Actions
  258. static TOOL_ACTION pluginsReload;
  259. static TOOL_ACTION pluginsShowFolder;
  260. // Global edit tool
  261. static TOOL_ACTION boardSetup;
  262. static TOOL_ACTION editTracksAndVias;
  263. static TOOL_ACTION editTextAndGraphics;
  264. static TOOL_ACTION globalDeletions;
  265. static TOOL_ACTION cleanupTracksAndVias;
  266. static TOOL_ACTION cleanupGraphics;
  267. static TOOL_ACTION updateFootprint;
  268. static TOOL_ACTION updateFootprints;
  269. static TOOL_ACTION changeFootprint;
  270. static TOOL_ACTION changeFootprints;
  271. static TOOL_ACTION swapLayers;
  272. static TOOL_ACTION removeUnusedPads;
  273. static TOOL_ACTION importNetlist;
  274. static TOOL_ACTION importSpecctraSession;
  275. static TOOL_ACTION exportSpecctraDSN;
  276. static TOOL_ACTION generateGerbers;
  277. static TOOL_ACTION generateDrillFiles;
  278. static TOOL_ACTION generatePosFile;
  279. static TOOL_ACTION generateReportFile;
  280. static TOOL_ACTION generateD356File;
  281. static TOOL_ACTION generateBOM;
  282. static TOOL_ACTION listNets;
  283. static TOOL_ACTION runDRC;
  284. static TOOL_ACTION editFpInFpEditor;
  285. static TOOL_ACTION editLibFpInFpEditor;
  286. static TOOL_ACTION showLayersManager;
  287. static TOOL_ACTION showProperties;
  288. static TOOL_ACTION showPythonConsole;
  289. // Module editor tools
  290. static TOOL_ACTION showFootprintTree;
  291. static TOOL_ACTION hideFootprintTree;
  292. // We don't use ACTION::new here because we need to distinguish between New Library
  293. // and New Footprint.
  294. static TOOL_ACTION newFootprint;
  295. // Create a new footprint using the Footprint Wizard
  296. static TOOL_ACTION createFootprint;
  297. // We don't use ACTION::save here because we need to distinguish between saving to
  298. // the library and saving to the board (which have different tooltips and icons).
  299. static TOOL_ACTION saveToBoard;
  300. static TOOL_ACTION saveToLibrary;
  301. static TOOL_ACTION editFootprint;
  302. static TOOL_ACTION duplicateFootprint;
  303. static TOOL_ACTION renameFootprint;
  304. static TOOL_ACTION deleteFootprint;
  305. static TOOL_ACTION cutFootprint;
  306. static TOOL_ACTION copyFootprint;
  307. static TOOL_ACTION pasteFootprint;
  308. static TOOL_ACTION importFootprint;
  309. static TOOL_ACTION exportFootprint;
  310. static TOOL_ACTION footprintProperties;
  311. static TOOL_ACTION defaultPadProperties;
  312. static TOOL_ACTION checkFootprint;
  313. /// Activation of the drawing tool (placing a PAD)
  314. static TOOL_ACTION placePad;
  315. static TOOL_ACTION explodePad;
  316. static TOOL_ACTION recombinePad;
  317. /// Tool for quick pad enumeration
  318. static TOOL_ACTION enumeratePads;
  319. /// Tool for creating an array of objects
  320. static TOOL_ACTION createArray;
  321. /// Display footprint graphics as outlines
  322. static TOOL_ACTION graphicsOutlines;
  323. /// Display texts as lines
  324. static TOOL_ACTION textOutlines;
  325. // Pad tools
  326. /// Copy the selected pad's settings to the board design settings
  327. static TOOL_ACTION copyPadSettings;
  328. /// Copy the default pad settings to the selected pad
  329. static TOOL_ACTION applyPadSettings;
  330. /// Copy the current pad's settings to other pads in the footprint or on the board
  331. static TOOL_ACTION pushPadSettings;
  332. // Microwave tools
  333. static TOOL_ACTION microwaveCreateGap;
  334. static TOOL_ACTION microwaveCreateStub;
  335. static TOOL_ACTION microwaveCreateStubArc;
  336. static TOOL_ACTION microwaveCreateFunctionShape;
  337. static TOOL_ACTION microwaveCreateLine;
  338. // Constrained drawing
  339. static TOOL_ACTION toggleHV45Mode;
  340. // Locking
  341. static TOOL_ACTION toggleLock;
  342. static TOOL_ACTION lock;
  343. static TOOL_ACTION unlock;
  344. // Grouping
  345. static TOOL_ACTION group;
  346. static TOOL_ACTION ungroup;
  347. static TOOL_ACTION removeFromGroup;
  348. static TOOL_ACTION groupEnter;
  349. static TOOL_ACTION groupLeave;
  350. // Miscellaneous
  351. static TOOL_ACTION selectionTool;
  352. static TOOL_ACTION pickerTool;
  353. static TOOL_ACTION measureTool;
  354. static TOOL_ACTION drillOrigin;
  355. static TOOL_ACTION placeFileOrigin;
  356. static TOOL_ACTION appendBoard;
  357. static TOOL_ACTION showEeschema;
  358. static TOOL_ACTION boardStatistics;
  359. static TOOL_ACTION boardReannotate;
  360. static TOOL_ACTION repairBoard;
  361. static TOOL_ACTION repairFootprint;
  362. static TOOL_ACTION inspectClearance;
  363. static TOOL_ACTION inspectConstraints;
  364. // Appearance controls
  365. static TOOL_ACTION clearHighlight; // Turns off highlight and resets previous highlight
  366. static TOOL_ACTION highlightNet; // Highlights a net by code (cross-probe highlight)
  367. static TOOL_ACTION toggleLastNetHighlight; // Toggles between current and previous highlight
  368. static TOOL_ACTION toggleNetHighlight; // Toggles between highlight off and highlight on
  369. static TOOL_ACTION highlightNetSelection; // Turns on highlight and takes net from selection
  370. static TOOL_ACTION highlightItem; // Select component via cross-probe
  371. static TOOL_ACTION hideNet;
  372. static TOOL_ACTION showNet;
  373. // Ratsnest
  374. static TOOL_ACTION localRatsnestTool;
  375. static TOOL_ACTION hideDynamicRatsnest;
  376. static TOOL_ACTION updateLocalRatsnest;
  377. /// Find an item
  378. static TOOL_ACTION find;
  379. /// Find an item and start moving
  380. static TOOL_ACTION getAndPlace;
  381. static TOOL_ACTION autoplaceOffboardComponents;
  382. static TOOL_ACTION autoplaceSelectedComponents;
  383. // convert tool
  384. static TOOL_ACTION convertToPoly;
  385. static TOOL_ACTION convertToZone;
  386. static TOOL_ACTION convertToKeepout;
  387. static TOOL_ACTION convertToLines;
  388. static TOOL_ACTION convertToArc;
  389. static TOOL_ACTION convertToTracks;
  390. };
  391. #endif