KiCad PCB EDA Suite
general.h
Go to the documentation of this file.
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-2020 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 #ifndef _GENERAL_H_
26 #define _GENERAL_H_
27 
28 #include <gal/color4d.h>
30 #include <erc_settings.h>
31 
32 using KIGFX::COLOR4D;
33 
34 class CONNECTION_GRAPH;
35 class TRANSFORM;
36 class SCH_SHEET;
37 class SCH_SHEET_PATH;
38 class ERC_SETTINGS;
39 
40 #define EESCHEMA_VERSION 5
41 #define SCHEMATIC_HEAD_STRING "Schematic File Version"
42 
43 #define DANGLING_SYMBOL_SIZE 12
44 
45 
46 #define DEFAULT_REPEAT_OFFSET_X 0
47 #define DEFAULT_REPEAT_OFFSET_Y 100
48 #define DEFAULT_REPEAT_LABEL_INC 1
49 #define DEFAULT_REPEAT_OFFSET_PIN 100
50 #define TXT_MARGIN 4
52 
55 #define DEFAULTBUSTHICKNESS 12
56 
59 #define DEFAULTDRAWLINETHICKNESS 6
60 
62 #define DEFAULTPINLENGTH 100
63 
65 #define DEFAULTPINNUMSIZE 50
66 
68 #define DEFAULTPINNAMESIZE 50
69 
71 #define DEFAULTSELECTIONTHICKNESS 3
72 
73 /* Rotation, mirror of graphic items in components bodies are handled by a
74  * transform matrix. The default matrix is useful to draw lib entries with
75  * using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and
76  * Y draw axis is to to bottom so we must have a default matrix that reverses
77  * the Y coordinate and keeps the X coordiate
78  */
80 
81 /* First and main (root) screen */
82 extern SCH_SHEET* g_RootSheet;
83 
90 
95 
100 
101 int GetSeverity( int aErrorCode );
102 void SetSeverity( int aErrorCode, int aSeverity );
103 
109 void SetDefaultLineThickness( int aThickness );
110 
114 int GetDefaultTextSize();
115 void SetDefaultTextSize( int aSize );
116 
120 double GetTextOffsetRatio();
121 void SetTextOffsetRatio( double aOffsetRatio );
122 
127 void SetDefaultBusThickness( int aThickness );
128 
133 void SetDefaultWireThickness( int aThickness );
134 
138 bool GetSelectionTextAsBox();
139 void SetSelectionTextAsBox( bool aBool );
140 
145 void SetSelectionDrawChildItems( bool aBool );
146 
151 void SetSelectionFillShapes( bool aBool );
152 
157 void SetSelectionThickness( int aThickness );
158 
159 // Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
161 
162 // TODO(JE) Remove this once wxDC printing is gone
164 
165 #endif // _GENERAL_H_
void SetDefaultWireThickness(int aThickness)
double GetTextOffsetRatio()
Amount to offset text above/below wires & busses.
Calculates the connectivity of a schematic and generates netlists.
int GetDefaultTextSize()
Default size for text in general.
int GetSelectionThickness()
Selection highlight thickness.
void SetSeverity(int aErrorCode, int aSeverity)
void SetSelectionThickness(int aThickness)
bool GetSelectionTextAsBox()
Draw selected text items as box.
SCH_SHEET * g_RootSheet
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i....
bool GetSelectionFillShapes()
Draw selected shapes as filled or not.
CONNECTION_GRAPH * g_ConnectionGraph
This also wants to live in the eventual SCHEMATIC object.
ERC_SETTINGS * g_ErcSettings
This also wants to live in the eventual SCHEMATIC object.
for transforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
void SetDefaultBusThickness(int aThickness)
void SetSelectionFillShapes(bool aBool)
SCH_SHEET_PATH * g_CurrentSheet
With the new connectivity algorithm, many more places than before want to know what the current sheet...
void SetTextOffsetRatio(double aOffsetRatio)
TRANSFORM DefaultTransform
bool GetSelectionDrawChildItems()
Draw selected child items or not.
SCH_LAYER_ID
Eeschema drawing layers.
Container for ERC settings.
Definition: erc_settings.h:37
SCH_SHEET_PATH.
COLOR4D GetInvisibleItemColor()
COLOR4D GetLayerColor(SCH_LAYER_ID aLayer)
Helper for all the old plotting/printing code while it still exists.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:215
void SetSelectionDrawChildItems(bool aBool)
Board layer functions and definitions.
void SetDefaultTextSize(int aSize)
int GetDefaultWireThickness()
Default line thickness used to draw/plot wires.
void SetSelectionTextAsBox(bool aBool)
int GetDefaultBusThickness()
Default line thickness used to draw/plot busses.
void SetDefaultLineThickness(int aThickness)
int GetSeverity(int aErrorCode)
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:40