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>
|
|
|
|
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GERBVIEW_CONTROL_H
|
|
|
|
#define GERBVIEW_CONTROL_H
|
|
|
|
|
|
|
|
#include <tool/tool_interactive.h>
|
|
|
|
|
2020-10-08 23:51:05 +00:00
|
|
|
class EDA_DRAW_PANEL_GAL;
|
2020-10-04 16:16:42 +00:00
|
|
|
class GERBVIEW_FRAME;
|
2017-09-17 22:44:30 +00:00
|
|
|
|
|
|
|
/**
|
2020-01-10 14:31:00 +00:00
|
|
|
* PCBNEW_CONTROL
|
2017-09-17 22:44:30 +00:00
|
|
|
*
|
|
|
|
* Handles actions that are shared between different frames in pcbnew.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class GERBVIEW_CONTROL : public TOOL_INTERACTIVE
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GERBVIEW_CONTROL();
|
2019-06-09 21:57:23 +00:00
|
|
|
~GERBVIEW_CONTROL() override { }
|
2017-09-17 22:44:30 +00:00
|
|
|
|
|
|
|
/// @copydoc TOOL_INTERACTIVE::Reset()
|
|
|
|
void Reset( RESET_REASON aReason ) override;
|
|
|
|
|
|
|
|
// Display modes
|
2018-03-04 21:59:12 +00:00
|
|
|
int DisplayControl( const TOOL_EVENT& aEvent );
|
2017-09-17 22:44:30 +00:00
|
|
|
|
|
|
|
// Layer control
|
|
|
|
int LayerNext( const TOOL_EVENT& aEvent );
|
|
|
|
int LayerPrev( const TOOL_EVENT& aEvent );
|
2020-10-08 23:51:05 +00:00
|
|
|
int ClearLayer( const TOOL_EVENT& aEvent );
|
|
|
|
int ClearAllLayers( const TOOL_EVENT& aEvent );
|
|
|
|
int ReloadAllLayers( const TOOL_EVENT& aEvent );
|
2017-09-17 22:44:30 +00:00
|
|
|
|
2020-05-03 22:02:07 +00:00
|
|
|
// Files
|
|
|
|
int OpenGerber( const TOOL_EVENT& aEvent );
|
|
|
|
int OpenDrillFile( const TOOL_EVENT& aEvent );
|
|
|
|
int OpenJobFile( const TOOL_EVENT& aEvent );
|
|
|
|
int OpenZipFile( const TOOL_EVENT& aEvent );
|
|
|
|
|
2020-10-08 23:51:05 +00:00
|
|
|
int ToggleLayerManager( const TOOL_EVENT& aEvent );
|
|
|
|
|
2017-09-17 22:44:30 +00:00
|
|
|
// Highlight control
|
|
|
|
int HighlightControl( const TOOL_EVENT& aEvent );
|
|
|
|
|
2018-03-04 21:59:12 +00:00
|
|
|
// Miscellaneous
|
2020-10-08 22:59:16 +00:00
|
|
|
int ExportToPcbnew( const TOOL_EVENT& aEvent );
|
2019-05-28 23:23:58 +00:00
|
|
|
int UpdateMessagePanel( const TOOL_EVENT& aEvent );
|
2019-06-02 18:58:09 +00:00
|
|
|
int Print( const TOOL_EVENT& aEvent );
|
2018-03-04 21:59:12 +00:00
|
|
|
|
2017-09-17 22:44:30 +00:00
|
|
|
///> Sets up handlers for various events.
|
|
|
|
void setTransitions() override;
|
|
|
|
|
2020-10-08 23:51:05 +00:00
|
|
|
protected:
|
|
|
|
EDA_DRAW_PANEL_GAL* canvas()
|
|
|
|
{
|
|
|
|
return m_frame->GetCanvas();
|
|
|
|
}
|
|
|
|
|
2017-09-17 22:44:30 +00:00
|
|
|
private:
|
|
|
|
GERBVIEW_FRAME* m_frame;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|