2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* @file general.h
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
#ifndef _GENERAL_H_
|
|
|
|
#define _GENERAL_H_
|
|
|
|
|
2013-09-25 19:09:57 +00:00
|
|
|
#include <colors.h> // for EDA_COLOR_T
|
2010-10-08 20:40:57 +00:00
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
class TRANSFORM;
|
2013-09-25 19:09:57 +00:00
|
|
|
class SCH_SHEET;
|
2010-11-10 15:30:12 +00:00
|
|
|
|
2008-02-12 22:34:40 +00:00
|
|
|
#define EESCHEMA_VERSION 2
|
2007-05-06 16:03:28 +00:00
|
|
|
#define SCHEMATIC_HEAD_STRING "Schematic File Version"
|
|
|
|
|
2013-04-06 05:01:48 +00:00
|
|
|
#define TXTMARGE 10 // Offset in mils for placement of labels and pin numbers
|
2013-09-25 19:09:57 +00:00
|
|
|
#define DANGLING_SYMBOL_SIZE 12
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-08-25 16:31:32 +00:00
|
|
|
///< The thickness to draw busses that do not have a specific width
|
|
|
|
//</ (can be changed in preference menu)
|
|
|
|
#define DEFAULTBUSTHICKNESS 12
|
|
|
|
|
|
|
|
///< The thickness to draw lines that thickness is set to 0 (default thickness)
|
|
|
|
///< (can be changed in preference menu)
|
|
|
|
#define DEFAULTDRAWLINETHICKNESS 6
|
|
|
|
|
|
|
|
///< The default pin len value when creating pins(can be changed in preference menu)
|
|
|
|
#define DEFAULTPINLENGTH 200
|
|
|
|
|
|
|
|
///< The default pin len value when creating pins(can be changed in preference menu)
|
|
|
|
#define DEFAULTPINNUMSIZE 50
|
|
|
|
|
|
|
|
///< The default pin len value when creating pins(can be changed in preference menu)
|
|
|
|
#define DEFAULTPINNAMESIZE 50
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#define GR_DEFAULT_DRAWMODE GR_COPY
|
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
// this enum is for color management
|
2014-09-26 10:35:11 +00:00
|
|
|
// Using here "LAYER" in name is due to historical reasons.
|
|
|
|
// Eeschema does not actually use layers. It just uses "LAYER_XX" as identifier
|
|
|
|
// mainly for item color
|
2012-09-28 17:47:41 +00:00
|
|
|
typedef enum {
|
2014-09-26 10:35:11 +00:00
|
|
|
LAYER_FIRST,
|
|
|
|
LAYER_WIRE = LAYER_FIRST,
|
2008-09-19 08:19:15 +00:00
|
|
|
LAYER_BUS,
|
|
|
|
LAYER_JUNCTION,
|
|
|
|
LAYER_LOCLABEL,
|
|
|
|
LAYER_GLOBLABEL,
|
|
|
|
LAYER_HIERLABEL,
|
|
|
|
LAYER_PINNUM,
|
|
|
|
LAYER_PINNAM,
|
|
|
|
LAYER_REFERENCEPART,
|
|
|
|
LAYER_VALUEPART,
|
|
|
|
LAYER_FIELDS,
|
|
|
|
LAYER_DEVICE,
|
|
|
|
LAYER_NOTES,
|
|
|
|
LAYER_NETNAM,
|
|
|
|
LAYER_PIN,
|
|
|
|
LAYER_SHEET,
|
|
|
|
LAYER_SHEETNAME,
|
|
|
|
LAYER_SHEETFILENAME,
|
|
|
|
LAYER_SHEETLABEL,
|
|
|
|
LAYER_NOCONNECT,
|
|
|
|
LAYER_ERC_WARN,
|
|
|
|
LAYER_ERC_ERR,
|
|
|
|
LAYER_DEVICE_BACKGROUND,
|
2010-12-02 21:41:56 +00:00
|
|
|
LAYER_GRID,
|
2014-09-26 10:35:11 +00:00
|
|
|
LAYER_BACKGROUND,
|
|
|
|
LAYERSCH_ID_COUNT
|
|
|
|
} LAYERSCH_ID;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2014-09-26 10:35:11 +00:00
|
|
|
inline LAYERSCH_ID operator++( LAYERSCH_ID& a )
|
2013-04-06 05:01:48 +00:00
|
|
|
{
|
2014-09-26 10:35:11 +00:00
|
|
|
a = LAYERSCH_ID( int( a ) + 1 );
|
2013-04-06 05:01:48 +00:00
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
/* Rotation, mirror of graphic items in components bodies are handled by a
|
2012-09-28 17:47:41 +00:00
|
|
|
* transform matrix. The default matrix is useful to draw lib entries with
|
|
|
|
* using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and
|
2010-11-10 15:30:12 +00:00
|
|
|
* Y draw axis is to to bottom so we must have a default matix that reverses
|
|
|
|
* the Y coordinate and keeps the X coordiate
|
|
|
|
*/
|
|
|
|
extern TRANSFORM DefaultTransform;
|
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
extern wxSize g_RepeatStep;
|
|
|
|
extern int g_RepeatDeltaLabel;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
/* First and main (root) screen */
|
2012-09-28 17:47:41 +00:00
|
|
|
extern SCH_SHEET* g_RootSheet;
|
2011-10-15 13:25:57 +00:00
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
/**
|
2012-09-28 17:47:41 +00:00
|
|
|
* Default line thickness used to draw/plot items having a
|
2012-04-05 18:27:56 +00:00
|
|
|
* default thickness line value (i.e. = 0 ).
|
|
|
|
*/
|
2012-09-28 17:47:41 +00:00
|
|
|
int GetDefaultLineThickness();
|
2014-05-12 16:57:46 +00:00
|
|
|
void SetDefaultLineThickness( int aThickness );
|
|
|
|
|
2014-05-16 13:57:53 +00:00
|
|
|
/**
|
|
|
|
* Default size for text in general
|
|
|
|
*/
|
|
|
|
int GetDefaultTextSize();
|
|
|
|
void SetDefaultTextSize( int aSize );
|
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
/**
|
|
|
|
* Default line thickness used to draw/plot busses.
|
|
|
|
*/
|
|
|
|
int GetDefaultBusThickness();
|
|
|
|
void SetDefaultBusThickness( int aThickness );
|
2009-06-02 07:26:49 +00:00
|
|
|
|
2014-09-26 10:35:11 +00:00
|
|
|
EDA_COLOR_T GetLayerColor( LAYERSCH_ID aLayer );
|
|
|
|
void SetLayerColor( EDA_COLOR_T aColor, LAYERSCH_ID aLayer );
|
2008-09-13 18:59:57 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
// Color to draw selected items
|
|
|
|
EDA_COLOR_T GetItemSelectedColor();
|
2010-12-31 19:47:39 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
|
|
|
|
EDA_COLOR_T GetInvisibleItemColor();
|
2010-12-31 19:47:39 +00:00
|
|
|
|
2012-09-28 17:47:41 +00:00
|
|
|
#endif // _GENERAL_H_
|