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.

105 lines
3.3 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2009-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
  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. * @file class_pcb_screen.h
  26. */
  27. #ifndef CLASS_PCB_SCREEN_H_
  28. #define CLASS_PCB_SCREEN_H_
  29. #include <class_base_screen.h>
  30. #include <class_board_item.h>
  31. class UNDO_REDO_CONTAINER;
  32. /* Handle info to display a board */
  33. class PCB_SCREEN : public BASE_SCREEN
  34. {
  35. public:
  36. LAYER_ID m_Active_Layer;
  37. LAYER_ID m_Route_Layer_TOP;
  38. LAYER_ID m_Route_Layer_BOTTOM;
  39. public:
  40. /**
  41. * Constructor
  42. * @param aPageSizeIU is the size of the initial paper page in internal units.
  43. */
  44. PCB_SCREEN( const wxSize& aPageSizeIU );
  45. ~PCB_SCREEN();
  46. PCB_SCREEN* Next() const { return static_cast<PCB_SCREEN*>( Pnext ); }
  47. void SetNextZoom();
  48. void SetPreviousZoom();
  49. void SetLastZoom();
  50. virtual int MilsToIuScalar();
  51. /**
  52. * Function GetCurItem
  53. * returns the currently selected BOARD_ITEM, overriding
  54. * BASE_SCREEN::GetCurItem().
  55. * @return BOARD_ITEM* - the one selected, or NULL.
  56. */
  57. BOARD_ITEM* GetCurItem() const
  58. {
  59. return (BOARD_ITEM*) BASE_SCREEN::GetCurItem();
  60. }
  61. /**
  62. * Function SetCurItem
  63. * sets the currently selected object, m_CurrentItem.
  64. * @param aItem Any object derived from BOARD_ITEM
  65. */
  66. void SetCurItem( BOARD_ITEM* aItem ) { BASE_SCREEN::SetCurItem( (EDA_ITEM*)aItem ); }
  67. /* full undo redo management : */
  68. // use BASE_SCREEN::ClearUndoRedoList()
  69. // use BASE_SCREEN::PushCommandToUndoList( PICKED_ITEMS_LIST* aItem )
  70. // use BASE_SCREEN::PushCommandToRedoList( PICKED_ITEMS_LIST* aItem )
  71. /**
  72. * Function ClearUndoORRedoList
  73. * free the undo or redo list from List element
  74. * Wrappers are deleted.
  75. * datas pointed by wrappers are deleted if not in use in schematic
  76. * i.e. when they are copy of a schematic item or they are no more in use
  77. * (DELETED)
  78. * @param aList = the UNDO_REDO_CONTAINER to clear
  79. * @param aItemCount = the count of items to remove. < 0 for all items
  80. * items are removed from the beginning of the list.
  81. * So this function can be called to remove old commands
  82. */
  83. void ClearUndoORRedoList( UNDO_REDO_CONTAINER& aList, int aItemCount = -1 );
  84. };
  85. #endif // CLASS_PCB_SCREEN_H_