2017-09-17 22:44:30 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2017 Jon Evans <jon@craftyjon.com>
|
2019-05-04 11:23:04 +00:00
|
|
|
* Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
2017-09-17 22:44:30 +00:00
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <tool/tool_manager.h>
|
|
|
|
#include <gerbview_id.h>
|
2019-06-17 00:34:21 +00:00
|
|
|
#include <bitmaps.h>
|
2017-09-17 22:44:30 +00:00
|
|
|
#include "gerbview_actions.h"
|
|
|
|
|
|
|
|
|
2019-06-17 00:34:21 +00:00
|
|
|
// Actions, being statically-defined, require specialized I18N handling. We continue to
|
|
|
|
// use the _() macro so that string harvesting by the I18N framework doesn't have to be
|
|
|
|
// specialized, but we don't translate on initialization and instead do it in the getters.
|
|
|
|
|
|
|
|
#undef _
|
|
|
|
#define _(s) s
|
|
|
|
|
|
|
|
|
|
|
|
// GERBVIEW_CONTROL
|
|
|
|
//
|
2021-08-16 18:42:46 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::openAutodetected( "gerbview.Control.openAutodetected",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Open Autodetected File(s)..." ),
|
|
|
|
_( "Open Autodetected file(s) on a new layer." ),
|
|
|
|
BITMAPS::load_gerber );
|
|
|
|
|
2020-05-03 22:02:07 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::openGerber( "gerbview.Control.openGerber",
|
|
|
|
AS_GLOBAL, 0, "",
|
2020-07-10 11:59:35 +00:00
|
|
|
_( "Open Gerber Plot File(s)..." ),
|
2021-08-16 18:42:46 +00:00
|
|
|
_( "Open Gerber plot file(s) on a new layer." ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::load_gerber );
|
2020-05-03 22:02:07 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::openDrillFile( "gerbview.Control.openDrillFile",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Open Excellon Drill File(s)..." ),
|
2021-08-16 18:42:46 +00:00
|
|
|
_( "Open Excellon drill file(s) on a new layer." ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::load_drill );
|
2020-05-03 22:02:07 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::openJobFile( "gerbview.Control.openJobFile",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Open Gerber Job File..." ),
|
2020-07-10 11:59:35 +00:00
|
|
|
_( "Open a Gerber job file and its associated gerber plot files" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::file_gerber_job );
|
2020-05-03 22:02:07 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::openZipFile( "gerbview.Control.openZipFile",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Open Zip Archive File..." ),
|
|
|
|
_( "Open a zipped archive (Gerber and Drill) file" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::zip );
|
2020-05-03 22:02:07 +00:00
|
|
|
|
2020-10-08 23:51:05 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::toggleLayerManager( "gerbview.Control.toggleLayerManager",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Show Layers Manager" ),
|
|
|
|
_( "Show or hide the layer manager" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::layers_manager );
|
2020-10-08 23:51:05 +00:00
|
|
|
|
2020-10-08 22:59:16 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::showDCodes( "gerbview.Inspection.showDCodes",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "List DCodes..." ),
|
|
|
|
_( "List D-codes defined in Gerber files" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::show_dcodenumber );
|
2020-10-08 22:59:16 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::showSource( "gerbview.Inspection.showSource",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Show Source..." ),
|
|
|
|
_( "Show source file for the current layer" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::tools );
|
2020-10-08 22:59:16 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::exportToPcbnew( "gerbview.Control.exportToPcbnew",
|
|
|
|
AS_GLOBAL, 0, "",
|
2021-02-18 15:49:35 +00:00
|
|
|
_( "Export to PCB Editor..." ),
|
|
|
|
_( "Export data as a KiCad PCB file" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::export_to_pcbnew );
|
2020-10-08 22:59:16 +00:00
|
|
|
|
2020-10-08 23:51:05 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::clearLayer( "gerbview.Control.clearLayer",
|
2020-10-08 22:59:16 +00:00
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Clear Current Layer..." ), _( "Clear the selected graphic layer" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::delete_sheet );
|
2020-10-08 22:59:16 +00:00
|
|
|
|
2020-10-08 23:51:05 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::clearAllLayers( "gerbview.Control.clearAllLayers",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Clear All Layers" ),
|
|
|
|
_( "Clear all layers. All data will be deleted" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::delete_gerber );
|
2020-10-08 23:51:05 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::reloadAllLayers( "gerbview.Control.reloadAllLayers",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Reload All Layers" ),
|
|
|
|
_( "Reload all layers. All data will be reloaded" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::reload );
|
2020-10-08 23:51:05 +00:00
|
|
|
|
2019-06-17 00:34:21 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::layerChanged( "gerbview.Control.layerChanged",
|
|
|
|
AS_GLOBAL, 0, "", "", "",
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::INVALID_BITMAP, AF_NOTIFY );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::highlightClear( "gerbview.Control.highlightClear",
|
|
|
|
AS_GLOBAL, 0, "",
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Clear Highlight" ), _( "Clear Highlight" ),
|
2021-03-13 17:45:33 +00:00
|
|
|
BITMAPS::cancel );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::highlightNet( "gerbview.Control.highlightNet",
|
|
|
|
AS_GLOBAL, 0, "",
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Highlight Net" ), _( "Highlight Net" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::general_ratsnest );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::highlightComponent( "gerbview.Control.highlightComponent",
|
|
|
|
AS_GLOBAL, 0, "",
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Highlight Component" ), _( "Highlight Component" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::module );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::highlightAttribute( "gerbview.Control.highlightAttribute",
|
|
|
|
AS_GLOBAL, 0, "",
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Highlight Attribute" ), _( "Highlight Attribute" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::flag );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
2021-03-13 17:45:33 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::highlightDCode( "gerbview.Control.highlightDCode",
|
|
|
|
AS_GLOBAL, 0, "",
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Highlight DCode" ), _( "Highlight DCode" ),
|
2021-03-13 17:45:33 +00:00
|
|
|
BITMAPS::show_dcodenumber );
|
|
|
|
|
2019-06-17 00:34:21 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::layerNext( "gerbview.Control.layerNext",
|
|
|
|
AS_GLOBAL,
|
2022-07-25 14:02:17 +00:00
|
|
|
WXK_PAGEDOWN, LEGACY_HK_NAME( "Switch to Next Layer" ),
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Next Layer" ), _( "Next Layer" ) );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::layerPrev( "gerbview.Control.layerPrev",
|
|
|
|
AS_GLOBAL,
|
2022-07-25 14:02:17 +00:00
|
|
|
WXK_PAGEUP, LEGACY_HK_NAME( "Switch to Previous Layer" ),
|
2022-02-05 19:31:22 +00:00
|
|
|
_( "Previous Layer" ), _( "Previous Layer" ) );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
2022-07-25 14:02:17 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::moveLayerUp( "gerbview.Control.moveLayerUp",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'+', "",
|
|
|
|
_( "Move Layer Up" ), _( "Move Current Layer Up" ),
|
|
|
|
BITMAPS::up );
|
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::moveLayerDown( "gerbview.Control.moveLayerDown",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'-', "",
|
|
|
|
_( "Move Layer Down" ), _( "Move Current Layer Down" ),
|
|
|
|
BITMAPS::down );
|
|
|
|
|
2019-06-17 00:34:21 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::linesDisplayOutlines( "gerbview.Control.linesDisplayOutlines",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'L', LEGACY_HK_NAME( "Gbr Lines Display Mode" ),
|
|
|
|
_( "Sketch Lines" ), _( "Show lines in outline mode" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::showtrack );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::flashedDisplayOutlines( "gerbview.Control.flashedDisplayOutlines",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'F', LEGACY_HK_NAME( "Gbr Flashed Display Mode" ),
|
|
|
|
_( "Sketch Flashed Items" ), _( "Show flashed items in outline mode" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::pad_sketch );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::polygonsDisplayOutlines( "gerbview.Control.polygonsDisplayOutlines",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'P', LEGACY_HK_NAME( "Gbr Polygons Display Mode" ),
|
|
|
|
_( "Sketch Polygons" ), _( "Show polygons in outline mode" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::opt_show_polygon );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::negativeObjectDisplay( "gerbview.Control.negativeObjectDisplay",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'N', LEGACY_HK_NAME( "Gbr Negative Obj Display Mode" ),
|
|
|
|
_( "Ghost Negative Objects" ), _( "Show negative objects in ghost color" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::gerbview_show_negative_objects );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::dcodeDisplay( "gerbview.Control.dcodeDisplay",
|
|
|
|
AS_GLOBAL,
|
|
|
|
'D', LEGACY_HK_NAME( "DCodes Display Mode" ),
|
|
|
|
_( "Show DCodes" ), _( "Show dcode number" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::show_dcodenumber );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::toggleDiffMode( "gerbview.Control.toggleDiffMode",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Show in Differential Mode" ), _( "Show layers in diff (compare) mode" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::gbr_select_mode2 );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
2020-07-26 04:20:07 +00:00
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::flipGerberView( "gerbview.Control.flipGerberView",
|
|
|
|
AS_GLOBAL, 0, "",
|
|
|
|
_( "Flip Gerber View" ), _( "Show as mirror image" ),
|
2021-03-08 02:59:07 +00:00
|
|
|
BITMAPS::flip_board );
|
2020-07-26 04:20:07 +00:00
|
|
|
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
// GERBVIEW_SELECTION_TOOL
|
|
|
|
//
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::selectionActivate( "gerbview.InteractiveSelection",
|
|
|
|
AS_GLOBAL, 0, "",
|
2021-03-08 02:59:07 +00:00
|
|
|
"", "", // No description, it is not supposed to be shown anywhere
|
|
|
|
BITMAPS::INVALID_BITMAP, AF_ACTIVATE );
|
2019-06-17 00:34:21 +00:00
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::selectItem( "gerbview.InteractiveSelection.SelectItem",
|
|
|
|
AS_GLOBAL );
|
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::unselectItem( "gerbview.InteractiveSelection.UnselectItem",
|
|
|
|
AS_GLOBAL );
|
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::selectionClear( "gerbview.InteractiveSelection.Clear",
|
|
|
|
AS_GLOBAL );
|
|
|
|
|
|
|
|
|
2022-09-14 22:28:09 +00:00
|
|
|
// Drag and drop
|
|
|
|
//
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::loadZipFile( "gerbview.Control.loadZipFile",
|
|
|
|
AS_GLOBAL );
|
|
|
|
|
|
|
|
TOOL_ACTION GERBVIEW_ACTIONS::loadGerbFiles( "gerbview.Control.loadGerbFiles",
|
|
|
|
AS_GLOBAL );
|