KiCad PCB EDA Suite
pcbnew_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) 2014-2016 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef PCBNEW_CONTROL_H
26 #define PCBNEW_CONTROL_H
27 
28 #include <tool/tool_interactive.h>
29 #include <memory>
30 
31 namespace KIGFX {
32  class ORIGIN_VIEWITEM;
33 }
34 class PCB_BASE_FRAME;
35 
43 {
44 public:
47 
49  void Reset( RESET_REASON aReason ) override;
50 
51  // Display modes
52  int TrackDisplayMode( const TOOL_EVENT& aEvent );
53  int PadDisplayMode( const TOOL_EVENT& aEvent );
54  int ViaDisplayMode( const TOOL_EVENT& aEvent );
55  int ZoneDisplayMode( const TOOL_EVENT& aEvent );
56  int HighContrastMode( const TOOL_EVENT& aEvent );
57  int HighContrastInc( const TOOL_EVENT& aEvent );
58  int HighContrastDec( const TOOL_EVENT& aEvent );
59 
60  // Layer control
61  int LayerSwitch( const TOOL_EVENT& aEvent );
62  int LayerNext( const TOOL_EVENT& aEvent );
63  int LayerPrev( const TOOL_EVENT& aEvent );
64  int LayerToggle( const TOOL_EVENT& aEvent );
65  int LayerAlphaInc( const TOOL_EVENT& aEvent );
66  int LayerAlphaDec( const TOOL_EVENT& aEvent );
67 
68  int CursorControl( const TOOL_EVENT& aEvent );
69  int PanControl( const TOOL_EVENT& aEvent );
70 
71  // Grid control
72  int GridFast1( const TOOL_EVENT& aEvent );
73  int GridFast2( const TOOL_EVENT& aEvent );
74  int GridSetOrigin( const TOOL_EVENT& aEvent );
75  int GridResetOrigin( const TOOL_EVENT& aEvent );
76 
77  // Miscellaneous
78  int ResetCoords( const TOOL_EVENT& aEvent );
79  int SwitchCursor( const TOOL_EVENT& aEvent );
80  int SwitchUnits( const TOOL_EVENT& aEvent );
81  int DeleteItemCursor( const TOOL_EVENT& aEvent );
82  int AppendBoard( const TOOL_EVENT& aEvent );
83  int ShowHelp( const TOOL_EVENT& aEvent );
84  int ToBeDone( const TOOL_EVENT& aEvent );
85 
87  void SetTransitions() override;
88 
89 private:
92 
94  std::unique_ptr<KIGFX::ORIGIN_VIEWITEM> m_gridOrigin;
95 
97  void updateGrid();
98 };
99 
100 #endif
int SwitchCursor(const TOOL_EVENT &aEvent)
int PanControl(const TOOL_EVENT &aEvent)
int PadDisplayMode(const TOOL_EVENT &aEvent)
int HighContrastInc(const TOOL_EVENT &aEvent)
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
int LayerAlphaInc(const TOOL_EVENT &aEvent)
int HighContrastMode(const TOOL_EVENT &aEvent)
int LayerPrev(const TOOL_EVENT &aEvent)
int GridSetOrigin(const TOOL_EVENT &aEvent)
int LayerNext(const TOOL_EVENT &aEvent)
Class PCBNEW_CONTROL.
PCB_BASE_FRAME * m_frame
Pointer to the currently used edit frame.
int GridResetOrigin(const TOOL_EVENT &aEvent)
Class TOOL_EVENT.
Definition: tool_event.h:162
int LayerToggle(const TOOL_EVENT &aEvent)
int ZoneDisplayMode(const TOOL_EVENT &aEvent)
int GridFast1(const TOOL_EVENT &aEvent)
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
Grid origin marker.
int AppendBoard(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
int ResetCoords(const TOOL_EVENT &aEvent)
int ShowHelp(const TOOL_EVENT &aEvent)
int LayerAlphaDec(const TOOL_EVENT &aEvent)
int ViaDisplayMode(const TOOL_EVENT &aEvent)
int TrackDisplayMode(const TOOL_EVENT &aEvent)
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:80
int SwitchUnits(const TOOL_EVENT &aEvent)
int DeleteItemCursor(const TOOL_EVENT &aEvent)
int CursorControl(const TOOL_EVENT &aEvent)
int GridFast2(const TOOL_EVENT &aEvent)
int ToBeDone(const TOOL_EVENT &aEvent)
int LayerSwitch(const TOOL_EVENT &aEvent)
void updateGrid()
Applies the legacy canvas grid settings for GAL.
void SetTransitions() override
Sets up handlers for various events.
class PCB_BASE_FRAME basic PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer...
int HighContrastDec(const TOOL_EVENT &aEvent)