KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gerbview_control.h
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-2021 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#ifndef GERBVIEW_CONTROL_H
22#define GERBVIEW_CONTROL_H
23
25
27class GERBVIEW_FRAME;
28
34{
35public:
37 ~GERBVIEW_CONTROL() override { }
38
40 void Reset( RESET_REASON aReason ) override;
41
42 // Display modes
43 int DisplayControl( const TOOL_EVENT& aEvent );
44
45 // Layer control
46 int LayerNext( const TOOL_EVENT& aEvent );
47 int LayerPrev( const TOOL_EVENT& aEvent );
48 int MoveLayerUp( const TOOL_EVENT& aEvent );
49 int MoveLayerDown( const TOOL_EVENT& aEvent );
50 int ClearLayer( const TOOL_EVENT& aEvent );
51 int ClearAllLayers( const TOOL_EVENT& aEvent );
52 int ReloadAllLayers( const TOOL_EVENT& aEvent );
53
54 // Files
55 int OpenAutodetected( const TOOL_EVENT& aEvent );
56 int OpenGerber( const TOOL_EVENT& aEvent );
57 int OpenDrillFile( const TOOL_EVENT& aEvent );
58 int OpenJobFile( const TOOL_EVENT& aEvent );
59 int OpenZipFile( const TOOL_EVENT& aEvent );
60
61 int ToggleLayerManager( const TOOL_EVENT& aEvent );
62
63 // Highlight control
64 int HighlightControl( const TOOL_EVENT& aEvent );
65
66 // Miscellaneous
67 int ExportToPcbnew( const TOOL_EVENT& aEvent );
68 int UpdateMessagePanel( const TOOL_EVENT& aEvent );
69 int Print( const TOOL_EVENT& aEvent );
70
71 // Drag and drop
72 int LoadZipfile( const TOOL_EVENT& aEvent );
73 int LoadGerbFiles( const TOOL_EVENT& aEvent );
74
76 void setTransitions() override;
77
78protected:
80 {
81 return m_frame->GetCanvas();
82 }
83
84private:
86};
87
88#endif
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Handle actions that are shared between different frames in Pcbnew.
EDA_DRAW_PANEL_GAL * canvas()
int OpenDrillFile(const TOOL_EVENT &aEvent)
int OpenAutodetected(const TOOL_EVENT &aEvent)
~GERBVIEW_CONTROL() override
int LayerNext(const TOOL_EVENT &aEvent)
int HighlightControl(const TOOL_EVENT &aEvent)
int MoveLayerDown(const TOOL_EVENT &aEvent)
int ClearLayer(const TOOL_EVENT &aEvent)
int LayerPrev(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int ReloadAllLayers(const TOOL_EVENT &aEvent)
GERBVIEW_FRAME * m_frame
int ToggleLayerManager(const TOOL_EVENT &aEvent)
int OpenJobFile(const TOOL_EVENT &aEvent)
int MoveLayerUp(const TOOL_EVENT &aEvent)
int ExportToPcbnew(const TOOL_EVENT &aEvent)
int OpenGerber(const TOOL_EVENT &aEvent)
int LoadGerbFiles(const TOOL_EVENT &aEvent)
Set up handlers for various events.
int ClearAllLayers(const TOOL_EVENT &aEvent)
int DisplayControl(const TOOL_EVENT &aEvent)
int LoadZipfile(const TOOL_EVENT &aEvent)
int OpenZipFile(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
Generic, UI-independent tool event.
Definition: tool_event.h:167
void Reset() override