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.

81 lines
2.3 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2017 Jon Evans <jon@craftyjon.com>
  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. #ifndef GERBVIEW_CONTROL_H
  21. #define GERBVIEW_CONTROL_H
  22. #include <tool/tool_interactive.h>
  23. class EDA_DRAW_PANEL_GAL;
  24. class GERBVIEW_FRAME;
  25. /**
  26. * Handle actions that are shared between different frames in Pcbnew.
  27. */
  28. class GERBVIEW_CONTROL : public TOOL_INTERACTIVE
  29. {
  30. public:
  31. GERBVIEW_CONTROL();
  32. ~GERBVIEW_CONTROL() override { }
  33. /// @copydoc TOOL_INTERACTIVE::Reset()
  34. void Reset( RESET_REASON aReason ) override;
  35. // Display modes
  36. int DisplayControl( const TOOL_EVENT& aEvent );
  37. // Layer control
  38. int LayerNext( const TOOL_EVENT& aEvent );
  39. int LayerPrev( const TOOL_EVENT& aEvent );
  40. int ClearLayer( const TOOL_EVENT& aEvent );
  41. int ClearAllLayers( const TOOL_EVENT& aEvent );
  42. int ReloadAllLayers( const TOOL_EVENT& aEvent );
  43. // Files
  44. int OpenGerber( const TOOL_EVENT& aEvent );
  45. int OpenDrillFile( const TOOL_EVENT& aEvent );
  46. int OpenJobFile( const TOOL_EVENT& aEvent );
  47. int OpenZipFile( const TOOL_EVENT& aEvent );
  48. int ToggleLayerManager( const TOOL_EVENT& aEvent );
  49. // Highlight control
  50. int HighlightControl( const TOOL_EVENT& aEvent );
  51. // Miscellaneous
  52. int ExportToPcbnew( const TOOL_EVENT& aEvent );
  53. int UpdateMessagePanel( const TOOL_EVENT& aEvent );
  54. int Print( const TOOL_EVENT& aEvent );
  55. ///< Set up handlers for various events.
  56. void setTransitions() override;
  57. protected:
  58. EDA_DRAW_PANEL_GAL* canvas()
  59. {
  60. return m_frame->GetCanvas();
  61. }
  62. private:
  63. GERBVIEW_FRAME* m_frame;
  64. };
  65. #endif