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 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 
29 #ifndef _GENERAL_H_
30 #define _GENERAL_H_
31 
32 #include <gal/color4d.h>
33 
34 using KIGFX::COLOR4D;
35 
36 class TRANSFORM;
37 class SCH_SHEET;
38 
39 #define EESCHEMA_VERSION 2
40 #define SCHEMATIC_HEAD_STRING "Schematic File Version"
41 
42 #define DANGLING_SYMBOL_SIZE 12
43 
44 
45 #define DEFAULT_REPEAT_OFFSET_X 0
46 #define DEFAULT_REPEAT_OFFSET_Y 100
47 #define REPEAT_OFFSET_MAX 1000
48 #define DEFAULT_REPEAT_LABEL_INC 1
49 #define DEFAULT_REPEAT_OFFSET_PIN 100
50 
52 #define DEFAULTBUSTHICKNESS 12
55 
58 #define DEFAULTDRAWLINETHICKNESS 6
59 
61 #define DEFAULTPINLENGTH 100
62 
64 #define DEFAULTPINNUMSIZE 50
65 
67 #define DEFAULTPINNAMESIZE 50
68 
69 #define GR_DEFAULT_DRAWMODE GR_COPY
70 
71 // this enum is for color management
72 // Using here "LAYER" in name is due to historical reasons.
73 // Eeschema does not actually use layers. It just uses "LAYER_XX" as identifier
74 // mainly for item color
75 typedef enum {
104 } LAYERSCH_ID;
105 
107 {
108  a = LAYERSCH_ID( int( a ) + 1 );
109  return a;
110 }
111 
112 
113 /* Rotation, mirror of graphic items in components bodies are handled by a
114  * transform matrix. The default matrix is useful to draw lib entries with
115  * using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and
116  * Y draw axis is to to bottom so we must have a default matrix that reverses
117  * the Y coordinate and keeps the X coordiate
118  */
120 
121 /* First and main (root) screen */
122 extern SCH_SHEET* g_RootSheet;
123 
129 void SetDefaultLineThickness( int aThickness );
130 
134 int GetDefaultTextSize();
135 void SetDefaultTextSize( int aSize );
136 
141 void SetDefaultBusThickness( int aThickness );
142 
144 void SetLayerColor( COLOR4D aColor, LAYERSCH_ID aLayer );
145 
146 // Color to draw selected items
148 
149 // Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
151 
152 #endif // _GENERAL_H_
int GetDefaultTextSize()
Default size for text in general.
COLOR4D GetItemSelectedColor()
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:54
int GetDefaultLineThickness()
Default line thickness used to draw/plot items having a default thickness line value (i...
LAYERSCH_ID
Definition: general.h:75
LAYERSCH_ID operator++(LAYERSCH_ID &a)
Definition: general.h:106
Class for tranforming drawing coordinates for a wxDC device context.
Definition: transform.h:45
void SetDefaultBusThickness(int aThickness)
TRANSFORM DefaultTransform
Definition: eeschema.cpp:57
COLOR4D GetInvisibleItemColor()
Class SCH_SHEET is the sheet symbol placed in a schematic, and is the entry point for a sub schematic...
Definition: sch_sheet.h:216
void SetDefaultTextSize(int aSize)
int GetDefaultBusThickness()
Default line thickness used to draw/plot busses.
void SetLayerColor(COLOR4D aColor, LAYERSCH_ID aLayer)
Definition: eeschema.cpp:172
COLOR4D GetLayerColor(LAYERSCH_ID aLayer)
Definition: eeschema.cpp:166
void SetDefaultLineThickness(int aThickness)
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39