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.

128 lines
4.3 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2007 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2016 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 general.h
  26. */
  27. #ifndef _GENERAL_H_
  28. #define _GENERAL_H_
  29. #include <gal/color4d.h>
  30. #include <layers_id_colors_and_visibility.h>
  31. using KIGFX::COLOR4D;
  32. class CONNECTION_GRAPH;
  33. class TRANSFORM;
  34. class SCH_SHEET;
  35. class SCH_SHEET_PATH;
  36. #define EESCHEMA_VERSION 5
  37. #define SCHEMATIC_HEAD_STRING "Schematic File Version"
  38. #define DANGLING_SYMBOL_SIZE 12
  39. #define DEFAULT_REPEAT_OFFSET_X 0 ///< the default X value (overwritten by the eeschema config)
  40. #define DEFAULT_REPEAT_OFFSET_Y 100 ///< the default Y value (overwritten by the eeschema config)
  41. #define REPEAT_OFFSET_MAX 1000 ///< the max value of repeat offset value
  42. #define DEFAULT_REPEAT_LABEL_INC 1 ///< the default value (overwritten by the eeschema config)
  43. #define DEFAULT_REPEAT_OFFSET_PIN 100 ///< the default value (overwritten by the eeschema config)
  44. ///< when repeating a pin
  45. ///< The thickness to draw busses that do not have a specific width
  46. ///< (can be changed in preference menu)
  47. #define DEFAULTBUSTHICKNESS 12
  48. ///< The thickness to draw lines that thickness is set to 0 (default thickness)
  49. ///< (can be changed in preference menu)
  50. #define DEFAULTDRAWLINETHICKNESS 6
  51. ///< The default pin len value when creating pins(can be changed in preference menu)
  52. #define DEFAULTPINLENGTH 100
  53. ///< The default pin number size when creating pins(can be changed in preference menu)
  54. #define DEFAULTPINNUMSIZE 50
  55. ///< The default pin name size when creating pins(can be changed in preference menu)
  56. #define DEFAULTPINNAMESIZE 50
  57. ///< The default library pane width
  58. #define DEFAULTLIBWIDTH 250
  59. #define GR_DEFAULT_DRAWMODE GR_COPY
  60. /* Rotation, mirror of graphic items in components bodies are handled by a
  61. * transform matrix. The default matrix is useful to draw lib entries with
  62. * using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and
  63. * Y draw axis is to to bottom so we must have a default matrix that reverses
  64. * the Y coordinate and keeps the X coordiate
  65. */
  66. extern TRANSFORM DefaultTransform;
  67. /* First and main (root) screen */
  68. extern SCH_SHEET* g_RootSheet;
  69. /**
  70. * With the new connectivity algorithm, many more places than before want to
  71. * know what the current sheet is. This was moved here from SCH_EDIT_FRAME
  72. * but we could refactor things to get rid of this global.
  73. */
  74. extern SCH_SHEET_PATH* g_CurrentSheet; ///< which sheet we are presently working on.
  75. /**
  76. * This also wants to live in the eventual SCHEMATIC object
  77. */
  78. extern CONNECTION_GRAPH* g_ConnectionGraph;
  79. /**
  80. * Default line thickness used to draw/plot items having a
  81. * default thickness line value (i.e. = 0 ).
  82. */
  83. int GetDefaultLineThickness();
  84. void SetDefaultLineThickness( int aThickness );
  85. /**
  86. * Default size for text in general
  87. */
  88. int GetDefaultTextSize();
  89. void SetDefaultTextSize( int aSize );
  90. /**
  91. * Default line thickness used to draw/plot busses.
  92. */
  93. int GetDefaultBusThickness();
  94. void SetDefaultBusThickness( int aThickness );
  95. COLOR4D GetLayerColor( SCH_LAYER_ID aLayer );
  96. void SetLayerColor( COLOR4D aColor, SCH_LAYER_ID aLayer );
  97. // Color to draw selected items
  98. COLOR4D GetItemSelectedColor();
  99. // Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
  100. COLOR4D GetInvisibleItemColor();
  101. #endif // _GENERAL_H_