KiCad PCB EDA Suite
general.h File Reference

Go to the source code of this file.

Macros

#define EESCHEMA_VERSION   4
 
#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
 

Functions

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 (SCH_LAYER_ID aLayer)
 
void SetLayerColor (COLOR4D aColor, SCH_LAYER_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 49 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 50 of file general.h.

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

#define DEFAULT_REPEAT_OFFSET_X   0

the default X 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 DEFAULT_REPEAT_OFFSET_Y   100

the default Y value (overwritten by the eeschema config)

Definition at line 47 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 55 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 59 of file general.h.

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

#define DEFAULTPINLENGTH   100

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

Definition at line 62 of file general.h.

Referenced by LIB_EDIT_FRAME::LoadSettings().

#define DEFAULTPINNAMESIZE   50

Definition at line 68 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 65 of file general.h.

Referenced by LIB_EDIT_FRAME::LoadSettings().

#define EESCHEMA_VERSION   4

Definition at line 40 of file general.h.

Referenced by SCH_LEGACY_PLUGIN::Format().

#define GR_DEFAULT_DRAWMODE   GR_COPY
#define REPEAT_OFFSET_MAX   1000

the max value of repeat offset value

Definition at line 48 of file general.h.

Referenced by SCH_EDIT_FRAME::GetConfigurationSettings().

#define SCHEMATIC_HEAD_STRING   "Schematic File Version"

Definition at line 41 of file general.h.

Referenced by SCH_LEGACY_PLUGIN::Format().

Function Documentation

int GetDefaultBusThickness ( )

Default line thickness used to draw/plot busses.

Definition at line 60 of file eeschema_config.cpp.

References s_defaultBusThickness.

Referenced by SCH_LINE::GetDefaultWidth(), SCH_LINE::GetPenSize(), SCH_BUS_BUS_ENTRY::GetPenSize(), SCH_EDIT_FRAME::SaveSettings(), and PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow().

61 {
62  return s_defaultBusThickness;
63 }
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 97 of file eeschema_config.cpp.

References s_drawDefaultLineThickness.

Referenced by SCH_GLOBALLABEL::CreateGraphicShape(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), SCH_NO_CONNECT::Draw(), SCH_TEXT::Draw(), KIGFX::SCH_PAINTER::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_LINE::GetDefaultWidth(), SCH_JUNCTION::GetEffectiveSymbolSize(), SCH_NO_CONNECT::GetPenSize(), LIB_CIRCLE::GetPenSize(), LIB_RECTANGLE::GetPenSize(), LIB_POLYLINE::GetPenSize(), LIB_TEXT::GetPenSize(), LIB_BEZIER::GetPenSize(), LIB_ARC::GetPenSize(), SCH_LINE::GetPenSize(), SCH_SHEET_PIN::GetPenSize(), SCH_FIELD::GetPenSize(), LIB_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::GetSize(), SCH_NO_CONNECT::HitTest(), DIALOG_PLOT_SCHEMATIC::initDlg(), SCH_SCREEN::IsTerminalPoint(), SCH_SHEET::Plot(), DIALOG_PLOT_SCHEMATIC::plotOneSheetPS(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), LIB_PIN::PlotPinTexts(), SCH_EDIT_FRAME::PrintPage(), SCH_EDIT_FRAME::SaveSettings(), LIB_EDIT_FRAME::SVG_PlotComponent(), PANEL_LIBEDIT_SETTINGS::TransferDataToWindow(), and PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataToWindow().

98 {
100 }
static int s_drawDefaultLineThickness
int GetDefaultTextSize ( )

Default size for text in general.

Definition at line 78 of file eeschema_config.cpp.

References s_defaultTextSize.

Referenced by SCH_EDIT_FRAME::CreateNewText(), EVT_UPDATE_UI_RANGE(), SCH_EDIT_FRAME::GetLastSheetPinTextSize(), LIB_FIELD::Init(), SCH_SHEET::SCH_SHEET(), PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow(), and PANEL_EESCHEMA_SETTINGS::TransferDataToWindow().

79 {
80  return s_defaultTextSize;
81 }
static int s_defaultTextSize
Default size for text (not only labels)
COLOR4D GetInvisibleItemColor ( )

Definition at line 121 of file eeschema_config.cpp.

References DARKGRAY.

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

122 {
123  return COLOR4D( DARKGRAY );
124 }
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39
COLOR4D GetItemSelectedColor ( )
void SetDefaultBusThickness ( int  aThickness)

Definition at line 66 of file eeschema_config.cpp.

References s_defaultBusThickness.

Referenced by SCH_EDIT_FRAME::LoadSettings(), and PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow().

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

Definition at line 84 of file eeschema_config.cpp.

References s_defaultTextSize.

Referenced by PANEL_EESCHEMA_SETTINGS::TransferDataFromWindow(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

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

Definition at line 181 of file eeschema.cpp.

References KIGFX::COLOR4D::Darken(), DIM, LAYER_SCHEMATIC_BACKGROUND, and WHITE.

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

182 {
183  // Do not allow non-background layers to be completely white.
184  // This ensures the BW printing recognizes that the colors should be
185  // printed black.
186  if( aColor == COLOR4D::WHITE && aLayer != LAYER_SCHEMATIC_BACKGROUND )
187  aColor.Darken( 0.01 );
188 
189  unsigned layer = aLayer;
190  wxASSERT( layer < DIM( s_layerColor ) );
191  s_layerColor[layer] = aColor;
192 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
static COLOR4D s_layerColor[LAYER_ID_COUNT]
Definition: eeschema.cpp:172
COLOR4D & Darken(double aFactor)
Function Darken Makes the color darker by a given factor.
Definition: color4d.h:165
Definition: colors.h:49

Variable Documentation

SCH_SHEET* g_RootSheet

Definition at line 56 of file eeschema.cpp.

Referenced by NETLIST_EXPORTER_GENERIC::addComponentFields(), SCH_EDIT_FRAME::addCurrentItemToScreen(), SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::AppendSchematic(), SCH_EDIT_FRAME::backAnnotateFootprints(), SCH_SCREENS::BuildClientSheetPathList(), SCH_EDIT_FRAME::BuildNetListBase(), SCH_SHEET_LIST::BuildSheetList(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_SCREENS::ClearAnnotationOfNewSheetPaths(), SCH_FIND_COLLECTOR::Collect(), SCH_EDIT_FRAME::CreateArchiveLibraryCacheFile(), DIALOG_PLOT_SCHEMATIC::CreateDXFFile(), DIALOG_PLOT_SCHEMATIC::createHPGLFile(), SCH_EDIT_FRAME::CreateNetlist(), DIALOG_PLOT_SCHEMATIC::createPDFFile(), DIALOG_PLOT_SCHEMATIC::createPSFile(), SCH_EDIT_FRAME::CreateScreens(), DIALOG_PLOT_SCHEMATIC::createSVGFile(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_ERC::DisplayERC_MarkersList(), SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doUpdatePcb(), SCH_EDIT_FRAME::DuplicateItemsInList(), SCH_EDIT_FRAME::EditSheet(), NETLIST_EXPORTER::findAllUnitsOfComponent(), SCH_EDIT_FRAME::FindComponentAndItem(), NETLIST_DIALOG::GenNetlist(), SCH_PRINTOUT::GetPageInfo(), GetRescueLibraryFileName(), SCH_PRINTOUT::HasPage(), HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG(), SCH_EDIT_FRAME::importFile(), DIALOG_EDIT_COMPONENTS_LIBID::initDlg(), SCH_EDIT_FRAME::isAutoSaveRequired(), NETLIST_EXPORTER_GENERIC::makeComponents(), NETLIST_EXPORTER_GENERIC::makeDesignHeader(), mapExistingAnnotation(), SCH_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnEditItem(), SCH_EDIT_FRAME::OnFindDrcMarker(), SCH_EDIT_FRAME::OnFindReplace(), SCH_EDIT_FRAME::OnFindSchematicItem(), 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::OnUpdateHierarchySheet(), SCH_EDIT_FRAME::OnUpdateSave(), SCH_EDIT_FRAME::OpenProjectFiles(), 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::SaveProject(), SCH_EDIT_FRAME::SaveProjectSettings(), SCH_SCREENS::SCH_SCREENS(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), DIALOG_ERC::TestErc(), SCH_SHEET_PATH::TestForRecursion(), SCH_SHEET_LIST::TestForRecursion(), DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow(), DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow(), NETLIST_EXPORTER_PSPICE::UpdateDirectives(), SCH_EDIT_FRAME::updateFindReplaceView(), WriteDiagnosticERC(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), NETLIST_EXPORTER_CADSTAR::WriteNetlist(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().