KiCad PCB EDA Suite
general.h File Reference
#include <gal/color4d.h>

Go to the source code of this file.

Macros

#define EESCHEMA_VERSION   2
 
#define SCHEMATIC_HEAD_STRING   "Schematic File Version"
 
#define DANGLING_SYMBOL_SIZE   12
 
#define DEFAULT_REPEAT_OFFSET_X   0
 the default X value (overwritten by the eeschema config) More...
 
#define DEFAULT_REPEAT_OFFSET_Y   100
 the default Y value (overwritten by the eeschema config) More...
 
#define REPEAT_OFFSET_MAX   1000
 the max value of repeat offset value More...
 
#define DEFAULT_REPEAT_LABEL_INC   1
 the default value (overwritten by the eeschema config) More...
 
#define DEFAULT_REPEAT_OFFSET_PIN   100
 the default value (overwritten by the eeschema config) More...
 
#define DEFAULTBUSTHICKNESS   12
 The thickness to draw lines that thickness is set to 0 (default thickness) (can be changed in preference menu) More...
 
#define DEFAULTDRAWLINETHICKNESS   6
 The default pin len value when creating pins(can be changed in preference menu) More...
 
#define DEFAULTPINLENGTH   100
 The default pin number size when creating pins(can be changed in preference menu) More...
 
#define DEFAULTPINNUMSIZE   50
 The default pin name size when creating pins(can be changed in preference menu) More...
 
#define DEFAULTPINNAMESIZE   50
 
#define GR_DEFAULT_DRAWMODE   GR_COPY
 

Enumerations

enum  LAYERSCH_ID {
  LAYER_FIRST, LAYER_WIRE = LAYER_FIRST, 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,
  LAYER_GRID, LAYER_BACKGROUND, LAYER_BRIGHTENED, LAYERSCH_ID_COUNT
}
 

Functions

LAYERSCH_ID operator++ (LAYERSCH_ID &a)
 
int GetDefaultLineThickness ()
 Default line thickness used to draw/plot items having a default thickness line value (i.e. More...
 
void SetDefaultLineThickness (int aThickness)
 
int GetDefaultTextSize ()
 Default size for text in general. More...
 
void SetDefaultTextSize (int aSize)
 
int GetDefaultBusThickness ()
 Default line thickness used to draw/plot busses. More...
 
void SetDefaultBusThickness (int aThickness)
 
COLOR4D GetLayerColor (LAYERSCH_ID aLayer)
 
void SetLayerColor (COLOR4D aColor, LAYERSCH_ID aLayer)
 
COLOR4D GetItemSelectedColor ()
 
COLOR4D GetInvisibleItemColor ()
 

Variables

TRANSFORM DefaultTransform
 
SCH_SHEETg_RootSheet
 

Macro Definition Documentation

#define DANGLING_SYMBOL_SIZE   12
#define DEFAULT_REPEAT_LABEL_INC   1

the default value (overwritten by the eeschema config)

Definition at line 48 of file general.h.

Referenced by SCH_EDIT_FRAME::GetConfigurationSettings(), LIB_EDIT_FRAME::LoadSettings(), and SCH_BASE_FRAME::SCH_BASE_FRAME().

#define DEFAULT_REPEAT_OFFSET_PIN   100

the default value (overwritten by the eeschema config)

when repeating a pin The thickness to draw busses that do not have a specific width (can be changed in preference menu)

Definition at line 49 of file general.h.

Referenced by LIB_EDIT_FRAME::LIB_EDIT_FRAME(), and LIB_EDIT_FRAME::LoadSettings().

#define DEFAULT_REPEAT_OFFSET_X   0

the default X value (overwritten by the eeschema config)

Definition at line 45 of file general.h.

Referenced by SCH_EDIT_FRAME::GetConfigurationSettings(), LIB_EDIT_FRAME::LoadSettings(), and SCH_BASE_FRAME::SCH_BASE_FRAME().

#define DEFAULT_REPEAT_OFFSET_Y   100

the default Y value (overwritten by the eeschema config)

Definition at line 46 of file general.h.

Referenced by SCH_EDIT_FRAME::GetConfigurationSettings(), LIB_EDIT_FRAME::LoadSettings(), and SCH_BASE_FRAME::SCH_BASE_FRAME().

#define DEFAULTBUSTHICKNESS   12

The thickness to draw lines that thickness is set to 0 (default thickness) (can be changed in preference menu)

Definition at line 54 of file general.h.

Referenced by SCH_EDIT_FRAME::LoadSettings().

#define DEFAULTDRAWLINETHICKNESS   6

The default pin len value when creating pins(can be changed in preference menu)

Definition at line 58 of file general.h.

Referenced by LIB_EDIT_FRAME::LoadSettings(), and SCH_EDIT_FRAME::LoadSettings().

#define DEFAULTPINLENGTH   100

The default pin number size when creating pins(can be changed in preference menu)

Definition at line 61 of file general.h.

Referenced by LIB_EDIT_FRAME::LoadSettings().

#define DEFAULTPINNAMESIZE   50

Definition at line 67 of file general.h.

Referenced by LIB_EDIT_FRAME::LoadSettings().

#define DEFAULTPINNUMSIZE   50

The default pin name size when creating pins(can be changed in preference menu)

Definition at line 64 of file general.h.

Referenced by LIB_EDIT_FRAME::LoadSettings().

#define EESCHEMA_VERSION   2
#define REPEAT_OFFSET_MAX   1000

the max value of repeat offset value

Definition at line 47 of file general.h.

Referenced by SCH_EDIT_FRAME::GetConfigurationSettings().

#define SCHEMATIC_HEAD_STRING   "Schematic File Version"

Enumeration Type Documentation

Enumerator
LAYER_FIRST 
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 
LAYER_GRID 
LAYER_BACKGROUND 
LAYER_BRIGHTENED 
LAYERSCH_ID_COUNT 

Definition at line 75 of file general.h.

75  {
78  LAYER_BUS,
91  LAYER_PIN,
100  LAYER_GRID,
104 } LAYERSCH_ID;
LAYERSCH_ID
Definition: general.h:75

Function Documentation

int GetDefaultBusThickness ( )

Default line thickness used to draw/plot busses.

Definition at line 62 of file eeschema_config.cpp.

References s_defaultBusThickness.

Referenced by SCH_LINE::GetPenSize(), SCH_BUS_BUS_ENTRY::GetPenSize(), SCH_EDIT_FRAME::OnPreferencesOptions(), and SCH_EDIT_FRAME::SaveSettings().

63 {
64  return s_defaultBusThickness;
65 }
static int s_defaultBusThickness
int GetDefaultLineThickness ( )

Default line thickness used to draw/plot items having a default thickness line value (i.e.

= 0 ).

Definition at line 99 of file eeschema_config.cpp.

References s_drawDefaultLineThickness.

Referenced by SCH_GLOBALLABEL::CreateGraphicShape(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), SCH_NO_CONNECT::Draw(), SCH_TEXT::Draw(), SCH_FIELD::Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), SCH_PRINTOUT::DrawPage(), LIB_PIN::DrawPinTexts(), SCH_FIELD::GetBoundingBox(), SCH_TEXT::GetBoundingBox(), SCH_LABEL::GetBoundingBox(), SCH_GLOBALLABEL::GetBoundingBox(), SCH_HIERLABEL::GetBoundingBox(), SCH_NO_CONNECT::GetPenSize(), LIB_CIRCLE::GetPenSize(), LIB_RECTANGLE::GetPenSize(), LIB_POLYLINE::GetPenSize(), SCH_LINE::GetPenSize(), LIB_TEXT::GetPenSize(), LIB_BEZIER::GetPenSize(), LIB_ARC::GetPenSize(), SCH_SHEET_PIN::GetPenSize(), LIB_FIELD::GetPenSize(), SCH_FIELD::GetPenSize(), SCH_BUS_WIRE_ENTRY::GetPenSize(), SCH_TEXT::GetPenSize(), LIB_PIN::GetPenSize(), SCH_SHEET::GetPenSize(), SCH_TEXT::GetSchematicTextOffset(), SCH_GLOBALLABEL::GetSchematicTextOffset(), SCH_HIERLABEL::GetSchematicTextOffset(), SCH_NO_CONNECT::HitTest(), DIALOG_PLOT_SCHEMATIC::initDlg(), SCH_SCREEN::IsTerminalPoint(), LIB_EDIT_FRAME::OnPreferencesOptions(), SCH_EDIT_FRAME::OnPreferencesOptions(), SCH_SHEET::Plot(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), LIB_PIN::PlotPinTexts(), SCH_EDIT_FRAME::PrintPage(), SCH_EDIT_FRAME::RedrawActiveWindow(), SCH_EDIT_FRAME::SaveSettings(), and LIB_EDIT_FRAME::SVG_PlotComponent().

100 {
102 }
static int s_drawDefaultLineThickness
COLOR4D GetInvisibleItemColor ( )

Definition at line 123 of file eeschema_config.cpp.

References DARKGRAY.

Referenced by LIB_FIELD::drawGraphic(), LIB_PIN::drawGraphic(), and LIB_PIN::DrawPinElectricalTypeName().

124 {
125  return COLOR4D( DARKGRAY );
126 }
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
COLOR4D GetItemSelectedColor ( )
LAYERSCH_ID operator++ ( LAYERSCH_ID a)
inline

Definition at line 106 of file general.h.

107 {
108  a = LAYERSCH_ID( int( a ) + 1 );
109  return a;
110 }
LAYERSCH_ID
Definition: general.h:75
void SetDefaultBusThickness ( int  aThickness)

Definition at line 68 of file eeschema_config.cpp.

References s_defaultBusThickness.

Referenced by SCH_EDIT_FRAME::LoadSettings(), and SCH_EDIT_FRAME::OnPreferencesOptions().

69 {
70  if( aThickness >= 1 )
71  s_defaultBusThickness = aThickness;
72  else
74 }
static int s_defaultBusThickness
void SetDefaultLineThickness ( int  aThickness)
void SetDefaultTextSize ( int  aSize)

Definition at line 86 of file eeschema_config.cpp.

References s_defaultTextSize.

Referenced by SCH_EDIT_FRAME::OnPreferencesOptions(), and DIALOG_LABEL_EDITOR::TextPropertiesAccept().

87 {
88  s_defaultTextSize = aTextSize;
89 }
static int s_defaultTextSize
Default size for text (not only labels)
void SetLayerColor ( COLOR4D  aColor,
LAYERSCH_ID  aLayer 
)

Definition at line 172 of file eeschema.cpp.

References DIM.

Referenced by SCH::IFACE::OnKifaceStart(), SCH_BASE_FRAME::SetDrawBgColor(), and WIDGET_EESCHEMA_COLOR_CONFIG::TransferDataFromControl().

173 {
174  wxASSERT( unsigned( aLayer ) < DIM( s_layerColor ) );
175  s_layerColor[aLayer] = aColor;
176 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
static COLOR4D s_layerColor[LAYERSCH_ID_COUNT]
Definition: eeschema.cpp:164

Variable Documentation

SCH_SHEET* g_RootSheet

Definition at line 54 of file eeschema.cpp.

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::backAnnotateFootprints(), SCH_EDIT_FRAME::BuildNetListBase(), SCH_SHEET_LIST::BuildSheetList(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_FIND_COLLECTOR::Collect(), SCH_EDIT_FRAME::CreateArchiveLibraryCacheFile(), DIALOG_PLOT_SCHEMATIC::CreateDXFFile(), DIALOG_PLOT_SCHEMATIC::createHPGLFile(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_PLOT_SCHEMATIC::createPSFile(), SCH_EDIT_FRAME::CreateScreens(), DIALOG_PLOT_SCHEMATIC::createSVGFile(), DIALOG_ERC::DisplayERC_MarkersList(), SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::EditSheet(), NETLIST_EXPORTER::findAllInstancesOfComponent(), SCH_EDIT_FRAME::FindComponentAndItem(), NETLIST_DIALOG::GenNetlist(), SCH_PRINTOUT::GetPageInfo(), SCH_PRINTOUT::HasPage(), HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG(), SCH_EDIT_FRAME::isAutoSaveRequired(), SCH_SHEET::Load(), NETLIST_EXPORTER_GENERIC::makeComponents(), NETLIST_EXPORTER_GENERIC::makeDesignHeader(), SCH_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnFindDrcMarker(), SCH_EDIT_FRAME::OnFindReplace(), SCH_EDIT_FRAME::OnFindSchematicItem(), SCH_EDIT_FRAME::OnLeftClick(), DIALOG_ERC::OnLeftClickMarkersList(), NETLIST_DIALOG::OnNetlistTypeSelection(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbModuleEditor(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), SCH_EDIT_FRAME::OnPrint(), SCH_PRINTOUT::OnPrintPage(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), SCH_EDIT_FRAME::OnSaveProject(), SCH_EDIT_FRAME::OnUpdateHierarchySheet(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OnUpdateSave(), SCH_EDIT_FRAME::OpenProjectFiles(), RESCUE_CACHE_CANDIDATE::OpenRescueLibrary(), SCH_EDIT_FRAME::PasteListOfItems(), SCH_EDIT_FRAME::prepareForNetlist(), SCH_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), NETLIST_DIALOG::RunSimulator(), SCH_EDIT_FRAME::SaveProjectSettings(), SCH_SCREENS::SCH_SCREENS(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), DIALOG_ERC::TestErc(), SCH_SHEET_PATH::TestForRecursion(), SCH_SHEET_LIST::TestForRecursion(), NETLIST_EXPORTER_PSPICE::UpdateDirectives(), SCH_EDIT_FRAME::updateFindReplaceView(), WriteDiagnosticERC(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), NETLIST_EXPORTER_CADSTAR::WriteNetlist(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().