KiCad PCB EDA Suite
Loading...
Searching...
No Matches
macros.h File Reference

This file contains miscellaneous commonly used macros and functions. More...

#include <wx/string.h>

Go to the source code of this file.

Macros

#define KI_HAS_ATTRIBUTE(x)
 
#define KI_HAS_CPP_ATTRIBUTE(x)
 
#define KI_FALLTHROUGH   ( ( void ) 0 )
 The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from one to the next.
 
#define TO_STR2(x)
 Stringifies the given parameter by placing in quotes.
 
#define TO_STR(x)
 
#define UNIMPLEMENTED_FOR(type)
 

Detailed Description

This file contains miscellaneous commonly used macros and functions.

Definition in file macros.h.

Macro Definition Documentation

◆ KI_FALLTHROUGH

#define KI_FALLTHROUGH   ( ( void ) 0 )

The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from one to the next.

It must be followed by a ";".

Sample code: switch( a ) { case 1: // Some code KI_FALLTHROUGH;

case 2: // More code break; }

Definition at line 83 of file macros.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::addAttribute(), CADSTAR_PCB_ARCHIVE_LOADER::applyDimensionSettings(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PAD::CheckPad(), ComboBoxUnits(), EE_GRID_HELPER::computeAnchors(), PCB_GRID_HELPER::computeAnchors(), SCH_DIRECTIVE_LABEL::CreateGraphicShape(), GENCAD_EXPORTER::createPadsShapesSection(), COMMON_TOOLS::CursorControl(), DSN::SPECCTRA_DB::doKEEPOUT(), DSN::SPECCTRA_DB::doSHAPE(), EDA_UNIT_UTILS::UI::DoubleValueFromString(), DSN::SPECCTRA_DB::doWINDOW(), DSN::SPECCTRA_DB::doWIRE(), DRAWING_TOOL::DrawDimension(), PDF_PLOTTER::encodeStringForPlotter(), PSLIKE_PLOTTER::encodeStringForPlotter(), CONNECTION_GRAPH::ercCheckNoConnects(), GERBER_FILE_IMAGE::ExecuteRS274XCommand(), PADSTACK::FlipLayers(), GENDRILL_WRITER_BASE::genDrillMapFile(), PCB_SHAPE::GetConnectionPoints(), FOOTPRINT::GetCoverageArea(), CADSTAR_PCB_ARCHIVE_LOADER::getShapeFromVertex(), hash_fp_item(), GENERAL_COLLECTOR::Inspect(), PCB_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::KiwayMailIn(), KIwxExpandEnvVars(), CADSTAR_PCB_ARCHIVE_LOADER::loadBoardStackup(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), CADSTAR_SCH_ARCHIVE_LOADER::loadLibrarySymbolShapeVertices(), EDA_UNIT_UTILS::UI::MessageTextFromValue(), EDA_SHAPE::move(), PROJECT_TREE_PANE::onRight(), BITMAPCONV_INFO::outputDataHeader(), DIALOG_PUSH_PAD_PROPERTIES::PadPropertiesAccept(), CADSTAR_PCB_ARCHIVE_PARSER::CADSTAR_PAD_SHAPE::Parse(), CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::Parse(), GPCB_FPL_CACHE::parseParameters(), SCH_IO_KICAD_SEXPR_PARSER::ParseSchematic(), CADSTAR_ARCHIVE_PARSER::ParseTextFields(), PGPropertyFactory(), BRDITEMS_PLOTTER::PlotPad(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), AM_PARAM::ReadParamFromAmDef(), BVH_PBRT::recursiveBuild(), SCH_EDIT_TOOL::Rotate(), EDA_SHAPE::rotate(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), EDA_SHAPE::scale(), PCB_SELECTION_TOOL::Selectable(), SCH_LABEL_BASE::SetSpinStyle(), EDA_UNIT_UTILS::UI::StringFromValue(), STROKE_PARAMS::Stroke(), EDA_DRAW_PANEL_GAL::SwitchBackend(), and FOOTPRINT::ViewGetLayers().

◆ KI_HAS_ATTRIBUTE

#define KI_HAS_ATTRIBUTE ( x)
Value:
0

Definition at line 39 of file macros.h.

◆ KI_HAS_CPP_ATTRIBUTE

#define KI_HAS_CPP_ATTRIBUTE ( x)
Value:
0

Definition at line 46 of file macros.h.

◆ TO_STR

#define TO_STR ( x)
Value:
#define TO_STR2(x)
Stringifies the given parameter by placing in quotes.
Definition macros.h:93

Definition at line 94 of file macros.h.

Referenced by PATHS::CalculateUserSettingsPath().

◆ TO_STR2

#define TO_STR2 ( x)
Value:
#x

Stringifies the given parameter by placing in quotes.

Parameters
cstringSTRING (no spaces)
Returns
"STRING"

Definition at line 93 of file macros.h.

◆ UNIMPLEMENTED_FOR

#define UNIMPLEMENTED_FOR ( type)
Value:
wxFAIL_MSG( wxString::Format( wxT( "%s: unimplemented for %s" ), __FUNCTION__, type ) )

Definition at line 96 of file macros.h.

Referenced by SCH_SHAPE::AddPoint(), EDA_SHAPE::beginEdit(), EDA_SHAPE::calcEdit(), SCH_EDIT_TOOL::ChangeTextType(), CheckLibSymbolGraphics(), EDA_SHAPE::continueEdit(), GENCAD_EXPORTER::createPadsShapesSection(), BOARD_ADAPTER::createPadWithMargin(), SCH_IO_LTSPICE_PARSER::CreateSCH_LABEL(), KIGFX::SCH_PAINTER::draw(), EDIT_TOOL::Duplicate(), EDA_SHAPE::endEdit(), EDA_SHAPE::flip(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), CN_ITEM::GetAnchor(), EDA_SHAPE::getBoundingBox(), EDA_SHAPE::getCenter(), PCB_SHAPE::GetConnectionPoints(), PCB_SHAPE::GetCorners(), BOARD_ITEM::GetEffectiveHoleShape(), BOARD_ITEM::GetEffectiveShape(), SCH_SHAPE::GetItemDescription(), EDA_SHAPE::GetLength(), SCH_SHAPE::GetMenuImage(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetRectangleHeight(), EDA_SHAPE::GetRectangleWidth(), EDA_UNIT_UTILS::GetText(), KIGFX::SCH_PAINTER::getTextThickness(), hash_fp_item(), EDA_SHAPE::hitTest(), EDA_SHAPE::hitTest(), EDA_SHAPE::IsClockwiseArc(), EDA_SHAPE::IsClosed(), GRAPHICS_CLEANER::isNullShape(), EDA_SHAPE::makeEffectiveShapes(), SCH_POINT_EDITOR::makePointsAndBehavior(), EDIT_TOOL::Mirror(), EDA_SHAPE::move(), SCH_SHAPE::Plot(), BRDITEMS_PLOTTER::PlotFootprintGraphicItems(), BRDITEMS_PLOTTER::PlotPad(), BRDITEMS_PLOTTER::PlotShape(), primitiveNeedsUpdate(), BOARD_COMMIT::Push(), BOARD_COMMIT::Revert(), SCH_EDIT_TOOL::Rotate(), EDA_SHAPE::rotate(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), SCH_IO_KICAD_SEXPR::saveLine(), SCH_IO_KICAD_SEXPR::saveShape(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem(), EDA_SHAPE::scale(), EDA_SHAPE::SetCenter(), EDA_SHAPE::SetLength(), EDA_SHAPE::SetRectangle(), EDA_SHAPE::SetRectangleHeight(), EDA_SHAPE::SetRectangleWidth(), EDA_SHAPE::SetSegmentAngle(), shapeNeedsUpdate(), COMMIT::Stage(), STROKE_PARAMS::Stroke(), BOARD_ITEM::swapData(), SCH_ITEM::swapData(), TestBoardOutlinesGraphicItems(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow(), DIALOG_TRACK_VIA_PROPERTIES::TransferDataToWindow(), EDA_SHAPE::TransformShapeToPolygon(), EDA_SHAPE::UpdateHatching(), and DIALOG_SHAPE_PROPERTIES::Validate().