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-2019 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 //
37 TOOL_ACTION GERBVIEW_ACTIONS::openGerber( "gerbview.Control.openGerber",
38  AS_GLOBAL, 0, "",
39  _( "Open Gerber Plot File(s)..." ),
40  _( "Open Gerber plot file(s) on the current layer. Previous data will be deleted" ),
42 
43 TOOL_ACTION GERBVIEW_ACTIONS::openDrillFile( "gerbview.Control.openDrillFile",
44  AS_GLOBAL, 0, "",
45  _( "Open Excellon Drill File(s)..." ),
46  _( "Open Excellon drill file(s) on the current layer. Previous data will be deleted" ),
48 
49 TOOL_ACTION GERBVIEW_ACTIONS::openJobFile( "gerbview.Control.openJobFile",
50  AS_GLOBAL, 0, "",
51  _( "Open Gerber Job File..." ),
52  _( "Open a Gerber job file and its associated gerber plot files" ),
54 
55 TOOL_ACTION GERBVIEW_ACTIONS::openZipFile( "gerbview.Control.openZipFile",
56  AS_GLOBAL, 0, "",
57  _( "Open Zip Archive File..." ),
58  _( "Open a zipped archive (Gerber and Drill) file" ),
59  BITMAPS::zip );
60 
61 TOOL_ACTION GERBVIEW_ACTIONS::toggleLayerManager( "gerbview.Control.toggleLayerManager",
62  AS_GLOBAL, 0, "",
63  _( "Show Layers Manager" ),
64  _( "Show or hide the layer manager" ),
66 
67 TOOL_ACTION GERBVIEW_ACTIONS::showDCodes( "gerbview.Inspection.showDCodes",
68  AS_GLOBAL, 0, "",
69  _( "List DCodes..." ),
70  _( "List D-codes defined in Gerber files" ),
72 
73 TOOL_ACTION GERBVIEW_ACTIONS::showSource( "gerbview.Inspection.showSource",
74  AS_GLOBAL, 0, "",
75  _( "Show Source..." ),
76  _( "Show source file for the current layer" ),
78 
79 TOOL_ACTION GERBVIEW_ACTIONS::exportToPcbnew( "gerbview.Control.exportToPcbnew",
80  AS_GLOBAL, 0, "",
81  _( "Export to PCB Editor..." ),
82  _( "Export data as a KiCad PCB file" ),
84 
85 TOOL_ACTION GERBVIEW_ACTIONS::clearLayer( "gerbview.Control.clearLayer",
86  AS_GLOBAL, 0, "",
87  _( "Clear Current Layer..." ), _( "Clear the selected graphic layer" ),
89 
90 TOOL_ACTION GERBVIEW_ACTIONS::clearAllLayers( "gerbview.Control.clearAllLayers",
91  AS_GLOBAL, 0, "",
92  _( "Clear All Layers" ),
93  _( "Clear all layers. All data will be deleted" ),
95 
96 TOOL_ACTION GERBVIEW_ACTIONS::reloadAllLayers( "gerbview.Control.reloadAllLayers",
97  AS_GLOBAL, 0, "",
98  _( "Reload All Layers" ),
99  _( "Reload all layers. All data will be reloaded" ),
100  BITMAPS::reload );
101 
102 TOOL_ACTION GERBVIEW_ACTIONS::layerChanged( "gerbview.Control.layerChanged",
103  AS_GLOBAL, 0, "", "", "",
105 
106 TOOL_ACTION GERBVIEW_ACTIONS::highlightClear( "gerbview.Control.highlightClear",
107  AS_GLOBAL, 0, "",
108  _( "Clear Highlight" ), _( "Clear Highlight" ),
109  BITMAPS::cancel );
110 
111 TOOL_ACTION GERBVIEW_ACTIONS::highlightNet( "gerbview.Control.highlightNet",
112  AS_GLOBAL, 0, "",
113  _( "Highlight Net" ), _( "Highlight Net" ),
115 
116 TOOL_ACTION GERBVIEW_ACTIONS::highlightComponent( "gerbview.Control.highlightComponent",
117  AS_GLOBAL, 0, "",
118  _( "Highlight Component" ), _( "Highlight Component" ),
119  BITMAPS::module );
120 
121 TOOL_ACTION GERBVIEW_ACTIONS::highlightAttribute( "gerbview.Control.highlightAttribute",
122  AS_GLOBAL, 0, "",
123  _( "Highlight Attribute" ), _( "Highlight Attribute" ),
124  BITMAPS::flag );
125 
126 TOOL_ACTION GERBVIEW_ACTIONS::highlightDCode( "gerbview.Control.highlightDCode",
127  AS_GLOBAL, 0, "",
128  _( "Highlight DCode" ), _( "Highlight DCode" ),
130 
131 TOOL_ACTION GERBVIEW_ACTIONS::layerNext( "gerbview.Control.layerNext",
132  AS_GLOBAL,
133  '+', LEGACY_HK_NAME( "Switch to Next Layer" ),
134  _( "Next Layer" ), _( "Next Layer" ) );
135 
136 TOOL_ACTION GERBVIEW_ACTIONS::layerPrev( "gerbview.Control.layerPrev",
137  AS_GLOBAL,
138  '-', LEGACY_HK_NAME( "Switch to Previous Layer" ),
139  _( "Previous Layer" ), _( "Previous Layer" ) );
140 
141 TOOL_ACTION GERBVIEW_ACTIONS::linesDisplayOutlines( "gerbview.Control.linesDisplayOutlines",
142  AS_GLOBAL,
143  'L', LEGACY_HK_NAME( "Gbr Lines Display Mode" ),
144  _( "Sketch Lines" ), _( "Show lines in outline mode" ),
146 
147 TOOL_ACTION GERBVIEW_ACTIONS::flashedDisplayOutlines( "gerbview.Control.flashedDisplayOutlines",
148  AS_GLOBAL,
149  'F', LEGACY_HK_NAME( "Gbr Flashed Display Mode" ),
150  _( "Sketch Flashed Items" ), _( "Show flashed items in outline mode" ),
152 
153 TOOL_ACTION GERBVIEW_ACTIONS::polygonsDisplayOutlines( "gerbview.Control.polygonsDisplayOutlines",
154  AS_GLOBAL,
155  'P', LEGACY_HK_NAME( "Gbr Polygons Display Mode" ),
156  _( "Sketch Polygons" ), _( "Show polygons in outline mode" ),
158 
159 TOOL_ACTION GERBVIEW_ACTIONS::negativeObjectDisplay( "gerbview.Control.negativeObjectDisplay",
160  AS_GLOBAL,
161  'N', LEGACY_HK_NAME( "Gbr Negative Obj Display Mode" ),
162  _( "Ghost Negative Objects" ), _( "Show negative objects in ghost color" ),
164 
165 TOOL_ACTION GERBVIEW_ACTIONS::dcodeDisplay( "gerbview.Control.dcodeDisplay",
166  AS_GLOBAL,
167  'D', LEGACY_HK_NAME( "DCodes Display Mode" ),
168  _( "Show DCodes" ), _( "Show dcode number" ),
170 
171 TOOL_ACTION GERBVIEW_ACTIONS::toggleDiffMode( "gerbview.Control.toggleDiffMode",
172  AS_GLOBAL, 0, "",
173  _( "Show in Differential Mode" ), _( "Show layers in diff (compare) mode" ),
175 
176 TOOL_ACTION GERBVIEW_ACTIONS::flipGerberView( "gerbview.Control.flipGerberView",
177  AS_GLOBAL, 0, "",
178  _( "Flip Gerber View" ), _( "Show as mirror image" ),
180 
181 
182 // GERBVIEW_SELECTION_TOOL
183 //
184 TOOL_ACTION GERBVIEW_ACTIONS::selectionActivate( "gerbview.InteractiveSelection",
185  AS_GLOBAL, 0, "",
186  "", "", // No description, it is not supposed to be shown anywhere
188 
189 TOOL_ACTION GERBVIEW_ACTIONS::selectItem( "gerbview.InteractiveSelection.SelectItem",
190  AS_GLOBAL );
191 
192 TOOL_ACTION GERBVIEW_ACTIONS::unselectItem( "gerbview.InteractiveSelection.UnselectItem",
193  AS_GLOBAL );
194 
195 TOOL_ACTION GERBVIEW_ACTIONS::selectionClear( "gerbview.InteractiveSelection.Clear",
196  AS_GLOBAL );
197 
198 
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION layerChanged
static TOOL_ACTION openDrillFile
#define LEGACY_HK_NAME(x)
Definition: actions.h:32
static TOOL_ACTION openGerber
static TOOL_ACTION showSource
static TOOL_ACTION clearAllLayers
static TOOL_ACTION layerNext
static TOOL_ACTION exportToPcbnew
static TOOL_ACTION toggleLayerManager
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
static TOOL_ACTION highlightNet
static TOOL_ACTION layerPrev
static TOOL_ACTION dcodeDisplay
static TOOL_ACTION negativeObjectDisplay
static TOOL_ACTION toggleDiffMode
static TOOL_ACTION flipGerberView
static TOOL_ACTION highlightAttribute
Action activates a tool.
Definition: tool_action.h:52
static TOOL_ACTION linesDisplayOutlines
static TOOL_ACTION openJobFile
static TOOL_ACTION flashedDisplayOutlines
#define _(s)
static TOOL_ACTION clearLayer
static TOOL_ACTION highlightClear
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION unselectItem
Unselects an item (specified as the event parameter).
static TOOL_ACTION polygonsDisplayOutlines
Represent a single user action.
Definition: tool_action.h:67
Action is a notification (it is by default passed to all tools)
Definition: tool_action.h:53
static TOOL_ACTION highlightDCode
static TOOL_ACTION showDCodes
static TOOL_ACTION reloadAllLayers
static TOOL_ACTION openZipFile
static TOOL_ACTION highlightComponent