1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2013-2017 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@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 __PCB_TEST_FRAME_H
26 #define __PCB_TEST_FRAME_H
27 
28 #include <wx/wx.h>
29 #include <wx/app.h>
30 
31 #include <memory>
32 
33 #include <pcb_draw_panel_gal.h>
34 
35 using std::unique_ptr;
36 
37 class PCB_DRAW_PANEL_GAL;
38 class BOARD;
39 
40 class TOOL_MANAGER;
41 class TOOL_DISPATCHER;
42 class ACTIONS;
43 
44 
45 namespace KIGFX {
46     class VIEW;
47 };
48 
49 class PCB_TEST_FRAME_BASE
50 {
51 public:
52     PCB_TEST_FRAME_BASE();
53     virtual ~PCB_TEST_FRAME_BASE();
54 
55     virtual void SetBoard( std::shared_ptr<BOARD> b);
56     virtual BOARD* LoadAndDisplayBoard ( const std::string& filename );
57 
GetPanel()58     std::shared_ptr < PCB_DRAW_PANEL_GAL > GetPanel() { return m_galPanel; }
GetBoard()59     std::shared_ptr < BOARD > GetBoard() { return m_board; }
60 
61     void LoadSettings();
62 
63 protected:
64 
65     void createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL_TYPE aGalType = PCB_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
createUserTools()66     virtual void createUserTools() {};
67 
68     std::shared_ptr < PCB_DRAW_PANEL_GAL > m_galPanel;
69     std::shared_ptr < BOARD > m_board;
70     KIGFX::GAL_DISPLAY_OPTIONS m_displayOptions;
71 
72 #ifdef USE_TOOL_MANAGER
73     unique_ptr < TOOL_MANAGER > m_toolManager;
74     unique_ptr < TOOL_DISPATCHER > m_toolDispatcher;
75     unique_ptr < ACTIONS > m_pcbActions;
76 #endif
77 };
78 
79 void SetTopFrame ( wxFrame* aFrame );
80 
81 #endif
82