general.h 2.26 KB
Newer Older
1 2 3
/**
 * @file general.h
 */
plyatov's avatar
plyatov committed
4

5 6 7
#ifndef _GENERAL_H_
#define _GENERAL_H_

8
#include <colors.h>     // for EDA_COLOR_T
9

10
class TRANSFORM;
11
class SCH_SHEET;
12

lifekidyeaa's avatar
lifekidyeaa committed
13
#define EESCHEMA_VERSION 2
plyatov's avatar
plyatov committed
14 15
#define SCHEMATIC_HEAD_STRING "Schematic File Version"

16 17
#define TXTMARGE 10             // Offset in mils for placement of labels and pin numbers
#define DEFAULT_TEXT_SIZE   50  // Default size for field texts
18
#define DANGLING_SYMBOL_SIZE 12
plyatov's avatar
plyatov committed
19 20 21

#define GR_DEFAULT_DRAWMODE GR_COPY

22 23
// this enum is for color management
typedef enum {
charras's avatar
charras committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
    LAYER_WIRE,
    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,
47
    LAYER_GRID,
48
    NB_SCH_LAYERS
charras's avatar
charras committed
49
} LayerNumber;
plyatov's avatar
plyatov committed
50

51 52 53 54 55 56
inline LayerNumber operator++( LayerNumber& a )
{
    a = LayerNumber( int( a ) + 1 );
    return a;
}

57

58
/* Rotation, mirror of graphic items in components bodies are handled by a
59 60
 * 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
61 62 63 64 65
 * 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;

66 67
extern wxSize   g_RepeatStep;
extern int      g_RepeatDeltaLabel;
plyatov's avatar
plyatov committed
68

69
/* First and main (root) screen */
70
extern SCH_SHEET*   g_RootSheet;
71

72
/**
73
 * Default line thickness used to draw/plot items having a
74 75
 * default thickness line value (i.e. = 0 ).
 */
76 77
int GetDefaultLineThickness();
void SetDefaultLineThickness( int aThickness);
78

79 80 81 82 83
/**
 * Default line thickness used to draw/plot busses.
 */
int GetDefaultBusThickness();
void SetDefaultBusThickness( int aThickness );
84

85
EDA_COLOR_T GetLayerColor( LayerNumber aLayer );
charras's avatar
charras committed
86

87 88
// Color to draw selected items
EDA_COLOR_T GetItemSelectedColor();
89

90 91
// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
EDA_COLOR_T GetInvisibleItemColor();
92

93
void        SetLayerColor( EDA_COLOR_T aColor, int aLayer );
94

95
#endif    // _GENERAL_H_