You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.6 KiB

  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. #ifndef __PCB_TEST_FRAME_H
  25. #define __PCB_TEST_FRAME_H
  26. #include <wx/wx.h>
  27. #include <wx/app.h>
  28. #include <memory>
  29. #include <pcb_draw_panel_gal.h>
  30. using std::unique_ptr;
  31. class PCB_DRAW_PANEL_GAL;
  32. class BOARD;
  33. class TOOL_MANAGER;
  34. class TOOL_DISPATCHER;
  35. class ACTIONS;
  36. namespace KIGFX {
  37. class VIEW;
  38. };
  39. // Define a new application type
  40. class GAL_TEST_APP : public wxApp
  41. {
  42. public:
  43. virtual bool OnInit() override;
  44. virtual void OnInitCmdLine( wxCmdLineParser& parser ) override;
  45. virtual bool OnCmdLineParsed( wxCmdLineParser& parser ) override;
  46. private:
  47. wxString m_filename;
  48. };
  49. class PCB_TEST_FRAME : public wxFrame
  50. {
  51. public:
  52. PCB_TEST_FRAME(wxFrame *frame,
  53. const wxString& title,
  54. const wxPoint& pos = wxDefaultPosition,
  55. const wxSize& size = wxDefaultSize,
  56. long style = wxDEFAULT_FRAME_STYLE,
  57. PCB_DRAW_PANEL_GAL::GAL_TYPE aGalType = PCB_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
  58. virtual ~PCB_TEST_FRAME();
  59. void SetBoard( BOARD * b);
  60. BOARD* LoadAndDisplayBoard ( const std::string& filename );
  61. protected:
  62. virtual void OnExit(wxCommandEvent& event);
  63. virtual void OnMotion( wxMouseEvent& aEvent );
  64. virtual void OnMenuFileOpen( wxCommandEvent& WXUNUSED( event ) );
  65. void buildView();
  66. unique_ptr < PCB_DRAW_PANEL_GAL > m_galPanel;
  67. unique_ptr < BOARD > m_board;
  68. #ifdef USE_TOOL_MANAGER
  69. unique_ptr < TOOL_MANAGER > m_toolManager;
  70. unique_ptr < TOOL_DISPATCHER > m_toolDispatcher;
  71. unique_ptr < ACTIONS > m_pcbActions;
  72. #endif
  73. };
  74. wxFrame* CreateMainFrame( const std::string& aFileName );
  75. #endif