KiCad PCB EDA Suite
gerbview_actions.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2017 Jon Evans <[email protected]>
5 * Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <tool/tool_manager.h>
22#include <gerbview_id.h>
23#include <bitmaps.h>
24#include "gerbview_actions.h"
25
26
27// Actions, being statically-defined, require specialized I18N handling. We continue to
28// use the _() macro so that string harvesting by the I18N framework doesn't have to be
29// specialized, but we don't translate on initialization and instead do it in the getters.
30
31#undef _
32#define _(s) s
33
34
35// GERBVIEW_CONTROL
36//
37TOOL_ACTION GERBVIEW_ACTIONS::openAutodetected( "gerbview.Control.openAutodetected",
38 AS_GLOBAL, 0, "",
39 _( "Open Autodetected File(s)..." ),
40 _( "Open Autodetected file(s) on a new layer." ),
42
43TOOL_ACTION GERBVIEW_ACTIONS::openGerber( "gerbview.Control.openGerber",
44 AS_GLOBAL, 0, "",
45 _( "Open Gerber Plot File(s)..." ),
46 _( "Open Gerber plot file(s) on a new layer." ),
48
49TOOL_ACTION GERBVIEW_ACTIONS::openDrillFile( "gerbview.Control.openDrillFile",
50 AS_GLOBAL, 0, "",
51 _( "Open Excellon Drill File(s)..." ),
52 _( "Open Excellon drill file(s) on a new layer." ),
54
55TOOL_ACTION GERBVIEW_ACTIONS::openJobFile( "gerbview.Control.openJobFile",
56 AS_GLOBAL, 0, "",
57 _( "Open Gerber Job File..." ),
58 _( "Open a Gerber job file and its associated gerber plot files" ),
60
61TOOL_ACTION GERBVIEW_ACTIONS::openZipFile( "gerbview.Control.openZipFile",
62 AS_GLOBAL, 0, "",
63 _( "Open Zip Archive File..." ),
64 _( "Open a zipped archive (Gerber and Drill) file" ),
66
67TOOL_ACTION GERBVIEW_ACTIONS::toggleLayerManager( "gerbview.Control.toggleLayerManager",
68 AS_GLOBAL, 0, "",
69 _( "Show Layers Manager" ),
70 _( "Show or hide the layer manager" ),
72
73TOOL_ACTION GERBVIEW_ACTIONS::showDCodes( "gerbview.Inspection.showDCodes",
74 AS_GLOBAL, 0, "",
75 _( "List DCodes..." ),
76 _( "List D-codes defined in Gerber files" ),
78
79TOOL_ACTION GERBVIEW_ACTIONS::showSource( "gerbview.Inspection.showSource",
80 AS_GLOBAL, 0, "",
81 _( "Show Source..." ),
82 _( "Show source file for the current layer" ),
84
85TOOL_ACTION GERBVIEW_ACTIONS::exportToPcbnew( "gerbview.Control.exportToPcbnew",
86 AS_GLOBAL, 0, "",
87 _( "Export to PCB Editor..." ),
88 _( "Export data as a KiCad PCB file" ),
90
91TOOL_ACTION GERBVIEW_ACTIONS::clearLayer( "gerbview.Control.clearLayer",
92 AS_GLOBAL, 0, "",
93 _( "Clear Current Layer..." ), _( "Clear the selected graphic layer" ),
95
96TOOL_ACTION GERBVIEW_ACTIONS::clearAllLayers( "gerbview.Control.clearAllLayers",
97 AS_GLOBAL, 0, "",
98 _( "Clear All Layers" ),
99 _( "Clear all layers. All data will be deleted" ),
101
102TOOL_ACTION GERBVIEW_ACTIONS::reloadAllLayers( "gerbview.Control.reloadAllLayers",
103 AS_GLOBAL, 0, "",
104 _( "Reload All Layers" ),
105 _( "Reload all layers. All data will be reloaded" ),
107
108TOOL_ACTION GERBVIEW_ACTIONS::layerChanged( "gerbview.Control.layerChanged",
109 AS_GLOBAL, 0, "", "", "",
111
112TOOL_ACTION GERBVIEW_ACTIONS::highlightClear( "gerbview.Control.highlightClear",
113 AS_GLOBAL, 0, "",
114 _( "Clear Highlight" ), _( "Clear Highlight" ),
116
117TOOL_ACTION GERBVIEW_ACTIONS::highlightNet( "gerbview.Control.highlightNet",
118 AS_GLOBAL, 0, "",
119 _( "Highlight Net" ), _( "Highlight Net" ),
121
122TOOL_ACTION GERBVIEW_ACTIONS::highlightComponent( "gerbview.Control.highlightComponent",
123 AS_GLOBAL, 0, "",
124 _( "Highlight Component" ), _( "Highlight Component" ),
126
127TOOL_ACTION GERBVIEW_ACTIONS::highlightAttribute( "gerbview.Control.highlightAttribute",
128 AS_GLOBAL, 0, "",
129 _( "Highlight Attribute" ), _( "Highlight Attribute" ),
131
132TOOL_ACTION GERBVIEW_ACTIONS::highlightDCode( "gerbview.Control.highlightDCode",
133 AS_GLOBAL, 0, "",
134 _( "Highlight DCode" ), _( "Highlight DCode" ),
136
137TOOL_ACTION GERBVIEW_ACTIONS::layerNext( "gerbview.Control.layerNext",
138 AS_GLOBAL,
139 WXK_PAGEDOWN, LEGACY_HK_NAME( "Switch to Next Layer" ),
140 _( "Next Layer" ), _( "Next Layer" ) );
141
142TOOL_ACTION GERBVIEW_ACTIONS::layerPrev( "gerbview.Control.layerPrev",
143 AS_GLOBAL,
144 WXK_PAGEUP, LEGACY_HK_NAME( "Switch to Previous Layer" ),
145 _( "Previous Layer" ), _( "Previous Layer" ) );
146
147TOOL_ACTION GERBVIEW_ACTIONS::moveLayerUp( "gerbview.Control.moveLayerUp",
148 AS_GLOBAL,
149 '+', "",
150 _( "Move Layer Up" ), _( "Move Current Layer Up" ),
151 BITMAPS::up );
152
153TOOL_ACTION GERBVIEW_ACTIONS::moveLayerDown( "gerbview.Control.moveLayerDown",
154 AS_GLOBAL,
155 '-', "",
156 _( "Move Layer Down" ), _( "Move Current Layer Down" ),
158
159TOOL_ACTION GERBVIEW_ACTIONS::linesDisplayOutlines( "gerbview.Control.linesDisplayOutlines",
160 AS_GLOBAL,
161 'L', LEGACY_HK_NAME( "Gbr Lines Display Mode" ),
162 _( "Sketch Lines" ), _( "Show lines in outline mode" ),
164
165TOOL_ACTION GERBVIEW_ACTIONS::flashedDisplayOutlines( "gerbview.Control.flashedDisplayOutlines",
166 AS_GLOBAL,
167 'F', LEGACY_HK_NAME( "Gbr Flashed Display Mode" ),
168 _( "Sketch Flashed Items" ), _( "Show flashed items in outline mode" ),
170
171TOOL_ACTION GERBVIEW_ACTIONS::polygonsDisplayOutlines( "gerbview.Control.polygonsDisplayOutlines",
172 AS_GLOBAL,
173 'P', LEGACY_HK_NAME( "Gbr Polygons Display Mode" ),
174 _( "Sketch Polygons" ), _( "Show polygons in outline mode" ),
176
177TOOL_ACTION GERBVIEW_ACTIONS::negativeObjectDisplay( "gerbview.Control.negativeObjectDisplay",
178 AS_GLOBAL,
179 'N', LEGACY_HK_NAME( "Gbr Negative Obj Display Mode" ),
180 _( "Ghost Negative Objects" ), _( "Show negative objects in ghost color" ),
182
183TOOL_ACTION GERBVIEW_ACTIONS::dcodeDisplay( "gerbview.Control.dcodeDisplay",
184 AS_GLOBAL,
185 'D', LEGACY_HK_NAME( "DCodes Display Mode" ),
186 _( "Show DCodes" ), _( "Show dcode number" ),
188
189TOOL_ACTION GERBVIEW_ACTIONS::toggleDiffMode( "gerbview.Control.toggleDiffMode",
190 AS_GLOBAL, 0, "",
191 _( "Show in Differential Mode" ), _( "Show layers in differential compare mode" ),
193
194TOOL_ACTION GERBVIEW_ACTIONS::toggleXORMode( "gerbview.Control.toggleXORMode",
195 AS_GLOBAL, 0, "",
196 _( "Show in XOR Mode" ), _( "Show layers in exclusive-or compare mode" ),
198
199TOOL_ACTION GERBVIEW_ACTIONS::flipGerberView( "gerbview.Control.flipGerberView",
200 AS_GLOBAL, 0, "",
201 _( "Flip Gerber View" ), _( "Show as mirror image" ),
203
204
205// GERBVIEW_SELECTION_TOOL
206//
207TOOL_ACTION GERBVIEW_ACTIONS::selectionActivate( "gerbview.InteractiveSelection",
208 AS_GLOBAL, 0, "",
209 "", "", // No description, it is not supposed to be shown anywhere
211
212TOOL_ACTION GERBVIEW_ACTIONS::selectItem( "gerbview.InteractiveSelection.SelectItem",
213 AS_GLOBAL );
214
215TOOL_ACTION GERBVIEW_ACTIONS::unselectItem( "gerbview.InteractiveSelection.UnselectItem",
216 AS_GLOBAL );
217
218TOOL_ACTION GERBVIEW_ACTIONS::selectionClear( "gerbview.InteractiveSelection.Clear",
219 AS_GLOBAL );
220
221
222// Drag and drop
223//
224TOOL_ACTION GERBVIEW_ACTIONS::loadZipFile( "gerbview.Control.loadZipFile",
225 AS_GLOBAL );
226
227TOOL_ACTION GERBVIEW_ACTIONS::loadGerbFiles( "gerbview.Control.loadGerbFiles",
228 AS_GLOBAL );
#define LEGACY_HK_NAME(x)
Definition: actions.h:32
@ gerbview_show_negative_objects
@ gbr_select_mode2
@ general_ratsnest
@ delete_gerber
@ show_dcodenumber
@ delete_sheet
@ INVALID_BITMAP
@ file_gerber_job
@ layers_manager
@ gbr_select_mode1
@ opt_show_polygon
@ export_to_pcbnew
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION flashedDisplayOutlines
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
static TOOL_ACTION highlightAttribute
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION unselectItem
Unselects an item (specified as the event parameter).
static TOOL_ACTION showDCodes
static TOOL_ACTION highlightNet
static TOOL_ACTION toggleXORMode
static TOOL_ACTION loadZipFile
static TOOL_ACTION toggleLayerManager
static TOOL_ACTION openGerber
static TOOL_ACTION toggleDiffMode
static TOOL_ACTION clearAllLayers
static TOOL_ACTION layerNext
static TOOL_ACTION flipGerberView
static TOOL_ACTION openAutodetected
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION layerPrev
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION openDrillFile
static TOOL_ACTION polygonsDisplayOutlines
static TOOL_ACTION highlightComponent
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightDCode
static TOOL_ACTION showSource
static TOOL_ACTION moveLayerUp
static TOOL_ACTION moveLayerDown
static TOOL_ACTION layerChanged
static TOOL_ACTION loadGerbFiles
static TOOL_ACTION openJobFile
static TOOL_ACTION clearLayer
static TOOL_ACTION highlightClear
Represent a single user action.
Definition: tool_action.h:68
#define _(s)
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:45
@ AF_ACTIVATE
Action activates a tool.
Definition: tool_action.h:52
@ AF_NOTIFY
Action is a notification (it is by default passed to all tools)
Definition: tool_action.h:53