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
 The default library pane width. More...
 
#define DEFAULTLIBWIDTH   250
 
#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

◆ DANGLING_SYMBOL_SIZE

#define DANGLING_SYMBOL_SIZE   12

Definition at line 43 of file general.h.

◆ DEFAULT_REPEAT_LABEL_INC

#define DEFAULT_REPEAT_LABEL_INC   1

the default value (overwritten by the eeschema config)

Definition at line 49 of file general.h.

◆ DEFAULT_REPEAT_OFFSET_PIN

#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.

◆ DEFAULT_REPEAT_OFFSET_X

#define DEFAULT_REPEAT_OFFSET_X   0

the default X value (overwritten by the eeschema config)

Definition at line 46 of file general.h.

◆ DEFAULT_REPEAT_OFFSET_Y

#define DEFAULT_REPEAT_OFFSET_Y   100

the default Y value (overwritten by the eeschema config)

Definition at line 47 of file general.h.

◆ DEFAULTBUSTHICKNESS

#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.

◆ DEFAULTDRAWLINETHICKNESS

#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.

◆ DEFAULTLIBWIDTH

#define DEFAULTLIBWIDTH   250

Definition at line 71 of file general.h.

◆ DEFAULTPINLENGTH

#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.

◆ DEFAULTPINNAMESIZE

#define DEFAULTPINNAMESIZE   50

The default library pane width.

Definition at line 68 of file general.h.

◆ DEFAULTPINNUMSIZE

#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.

◆ EESCHEMA_VERSION

#define EESCHEMA_VERSION   4

Definition at line 40 of file general.h.

◆ GR_DEFAULT_DRAWMODE

#define GR_DEFAULT_DRAWMODE   GR_COPY

Definition at line 73 of file general.h.

◆ REPEAT_OFFSET_MAX

#define REPEAT_OFFSET_MAX   1000

the max value of repeat offset value

Definition at line 48 of file general.h.

◆ SCHEMATIC_HEAD_STRING

#define SCHEMATIC_HEAD_STRING   "Schematic File Version"

Definition at line 41 of file general.h.

Function Documentation

◆ GetDefaultBusThickness()

int GetDefaultBusThickness ( )

Default line thickness used to draw/plot busses.

Definition at line 61 of file eeschema_config.cpp.

62 {
63  return s_defaultBusThickness;
64 }
static int s_defaultBusThickness

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().

◆ GetDefaultLineThickness()

int GetDefaultLineThickness ( )

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

= 0 ).

Definition at line 98 of file eeschema_config.cpp.

99 {
101 }
static int s_drawDefaultLineThickness

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_ARC::GetPenSize(), LIB_BEZIER::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().

◆ GetDefaultTextSize()

int GetDefaultTextSize ( )

Default size for text in general.

Definition at line 79 of file eeschema_config.cpp.

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

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().

◆ GetInvisibleItemColor()

COLOR4D GetInvisibleItemColor ( )

Definition at line 122 of file eeschema_config.cpp.

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

References DARKGRAY.

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

◆ GetItemSelectedColor()

COLOR4D GetItemSelectedColor ( )

◆ GetLayerColor()

◆ SetDefaultBusThickness()

void SetDefaultBusThickness ( int  aThickness)

Definition at line 67 of file eeschema_config.cpp.

68 {
69  if( aThickness >= 1 )
70  s_defaultBusThickness = aThickness;
71  else
73 }
static int s_defaultBusThickness

References s_defaultBusThickness.

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

◆ SetDefaultLineThickness()

void SetDefaultLineThickness ( int  aThickness)

◆ SetDefaultTextSize()

void SetDefaultTextSize ( int  aSize)

Definition at line 85 of file eeschema_config.cpp.

86 {
87  s_defaultTextSize = aTextSize;
88 }
static int s_defaultTextSize
Default size for text (not only labels)

References s_defaultTextSize.

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

◆ SetLayerColor()

void SetLayerColor ( COLOR4D  aColor,
SCH_LAYER_ID  aLayer 
)

Definition at line 181 of file eeschema.cpp.

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 < arrayDim( s_layerColor ) );
191  s_layerColor[layer] = aColor;
192 }
static COLOR4D s_layerColor[LAYER_ID_COUNT]
Definition: eeschema.cpp:172
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Definition: macros.h:99
COLOR4D & Darken(double aFactor)
Function Darken Makes the color darker by a given factor.
Definition: color4d.h:187
Definition: colors.h:49

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

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

Variable Documentation

◆ DefaultTransform

◆ g_RootSheet

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(), 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().