From ba6ae4fa9b98d7025817658a0b409c7e17fcde20 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 25 Nov 2021 12:22:40 +0000 Subject: [PATCH] Kicad has many plugins. This one is for the pcb. --- common/CMakeLists.txt | 2 +- kicad/kicad_manager_frame.cpp | 2 +- .../dialogs/panel_pcbnew_color_settings.cpp | 4 +- pcbnew/files.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 2 +- pcbnew/footprint_libraries_utils.cpp | 10 +- pcbnew/io_mgr.cpp | 4 +- pcbnew/kicad_clipboard.cpp | 8 +- pcbnew/kicad_clipboard.h | 8 +- pcbnew/plugins/geda/gpcb_plugin.cpp | 2 +- pcbnew/plugins/kicad/pcb_parser.cpp | 2 +- .../{kicad_plugin.cpp => pcb_plugin.cpp} | 120 +++++++++--------- .../kicad/{kicad_plugin.h => pcb_plugin.h} | 14 +- pcbnew/python/swig/pcbnew.i | 4 +- pcbnew/router/router_tool.cpp | 4 +- pcbnew/tools/pcb_selection.cpp | 2 +- qa/libeval_compiler/libeval_compiler_test.cpp | 2 +- .../tools/pcb_parser/pcb_parser_tool.cpp | 2 +- qa/pcbnew_utils/board_file_utils.cpp | 4 +- .../include/pcbnew_utils/board_file_utils.h | 4 +- qa/pns/pns_log.cpp | 2 +- qa/pns/pns_log.h | 2 +- qa/pns/pns_log_viewer.cpp | 2 +- qa/qa_utils/pcb_test_frame.cpp | 2 +- 24 files changed, 105 insertions(+), 105 deletions(-) rename pcbnew/plugins/kicad/{kicad_plugin.cpp => pcb_plugin.cpp} (95%) rename pcbnew/plugins/kicad/{kicad_plugin.h => pcb_plugin.h} (98%) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 966a0d8e97..ace6b4a9a7 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -548,7 +548,7 @@ set( PCB_COMMON_SRCS ${CMAKE_SOURCE_DIR}/pcbnew/io_mgr.cpp ${CMAKE_SOURCE_DIR}/pcbnew/kicad_clipboard.cpp ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/kicad_netlist_reader.cpp - ${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/kicad_plugin.cpp + ${CMAKE_SOURCE_DIR}/pcbnew/plugins/kicad/pcb_plugin.cpp ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/legacy_netlist_reader.cpp ${CMAKE_SOURCE_DIR}/pcbnew/plugins/legacy/legacy_plugin.cpp ${CMAKE_SOURCE_DIR}/pcbnew/netlist_reader/netlist_reader.cpp diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 01ab78590b..1f4fa58237 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -56,7 +56,7 @@ #include -#include <../pcbnew/plugins/kicad/kicad_plugin.h> // for SEXPR_BOARD_FILE_VERSION def +#include <../pcbnew/plugins/kicad/pcb_plugin.h> // for SEXPR_BOARD_FILE_VERSION def #ifdef __WXMAC__ diff --git a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp index 0638ef4997..cc7c060b99 100644 --- a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp +++ b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include @@ -499,7 +499,7 @@ void PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems() m_page->SetWidthMils( 6000 ); STRING_LINE_READER reader( g_previewBoard, "preview" ); - PCB_IO pi; + PCB_PLUGIN pi; try { diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index c0cbc9f5ac..2caa772f39 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include #include #include "footprint_info_impl.h" diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 3571c1720e..232c5e8516 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index aa23b8171a..576c3e26f5 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -186,9 +186,9 @@ static FOOTPRINT* parse_footprint_with_plugin( const wxFileName& aFileName, */ static FOOTPRINT* parse_footprint_kicad( const wxFileName& aFileName ) { - wxString fcontents; - PCB_IO pcb_io; - wxFFile f( aFileName.GetFullPath() ); + wxString fcontents; + PCB_PLUGIN pcb_io; + wxFFile f( aFileName.GetFullPath() ); if( !f.IsOpened() ) return nullptr; @@ -347,7 +347,7 @@ void FOOTPRINT_EDIT_FRAME::ExportFootprint( FOOTPRINT* aFootprint ) // Export as *.kicad_pcb format, using a strategy which is specifically chosen // as an example on how it could also be used to send it to the system clipboard. - PCB_IO pcb_io( CTL_FOR_LIBRARY ); + PCB_PLUGIN pcb_io(CTL_FOR_LIBRARY ); /* This footprint should *already* be "normalized" in a way such that orientation is zero, etc., since it came from the Footprint Editor. diff --git a/pcbnew/io_mgr.cpp b/pcbnew/io_mgr.cpp index c8c5fc7504..c9783ef871 100644 --- a/pcbnew/io_mgr.cpp +++ b/pcbnew/io_mgr.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -191,7 +191,7 @@ void IO_MGR::Save( PCB_FILE_T aFileType, const wxString& aFileName, BOARD* aBoar static IO_MGR::REGISTER_PLUGIN registerEaglePlugin( IO_MGR::EAGLE, wxT("Eagle"), []() -> PLUGIN* { return new EAGLE_PLUGIN; } ); static IO_MGR::REGISTER_PLUGIN registerKicadPlugin( IO_MGR::KICAD_SEXP, - wxT("KiCad"), []() -> PLUGIN* { return new PCB_IO; } ); + wxT("KiCad"), []() -> PLUGIN* { return new PCB_PLUGIN; } ); static IO_MGR::REGISTER_PLUGIN registerPcadPlugin( IO_MGR::PCAD, wxT("P-Cad"), []() -> PLUGIN* { return new PCAD_PLUGIN; } ); static IO_MGR::REGISTER_PLUGIN registerFabmasterPlugin( IO_MGR::FABMASTER, wxT( "Fabmaster" ), diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index 097dfb7679..6e98b69a1b 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -38,12 +38,12 @@ #include #include -#include +#include #include CLIPBOARD_IO::CLIPBOARD_IO(): - PCB_IO( CTL_FOR_CLIPBOARD ), - m_formatter() + PCB_PLUGIN(CTL_FOR_CLIPBOARD ), + m_formatter() { m_out = &m_formatter; } @@ -323,7 +323,7 @@ BOARD_ITEM* CLIPBOARD_IO::Parse() try { - item = PCB_IO::Parse( result ); + item = PCB_PLUGIN::Parse( result ); } catch (...) { diff --git a/pcbnew/kicad_clipboard.h b/pcbnew/kicad_clipboard.h index 6857c9e4cc..aa07e14077 100644 --- a/pcbnew/kicad_clipboard.h +++ b/pcbnew/kicad_clipboard.h @@ -30,7 +30,7 @@ #ifndef KICAD_CLIPBOARD_H #define KICAD_CLIPBOARD_H -#include +#include #include #include #include @@ -38,21 +38,21 @@ #include -class CLIPBOARD_IO : public PCB_IO +class CLIPBOARD_IO : public PCB_PLUGIN { public: CLIPBOARD_IO(); ~CLIPBOARD_IO(); /* - * Saves the entire board to the clipboard formatted using the PCB_IO formatting + * Saves the entire board to the clipboard formatted using the PCB_PLUGIN formatting */ void Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties = nullptr ) override; /* * Write all the settings of the BOARD* set by setBoard() and then adds all the - * BOARD_ITEMs found in selection formatted by PCB_IO to clipboard as sexpr text + * BOARD_ITEMs found in selection formatted by PCB_PLUGIN to clipboard as sexpr text */ void SaveSelection( const PCB_SELECTION& selected, bool isFootprintEditor ); diff --git a/pcbnew/plugins/geda/gpcb_plugin.cpp b/pcbnew/plugins/geda/gpcb_plugin.cpp index f898dfda90..7daf4e1bc5 100644 --- a/pcbnew/plugins/geda/gpcb_plugin.cpp +++ b/pcbnew/plugins/geda/gpcb_plugin.cpp @@ -102,7 +102,7 @@ static inline long parseInt( const wxString& aValue, double aScalar ) * * The new footprint library design is a file path of individual footprint files * that contain a single footprint per file. This class is a helper only for the - * footprint portion of the PLUGIN API, and only for the #PCB_IO plugin. It is + * footprint portion of the PLUGIN API, and only for the #PCB_PLUGIN plugin. It is * private to this implementation file so it is not placed into a header. */ class GPCB_FPL_CACHE_ITEM diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 7cb8ab7bc5..38e86bb3ed 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp similarity index 95% rename from pcbnew/plugins/kicad/kicad_plugin.cpp rename to pcbnew/plugins/kicad/pcb_plugin.cpp index 6c6c76f2bc..34d7fc4cc7 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,7 +63,7 @@ using namespace PCB_KEYS_T; * * The new footprint library design is a file path of individual footprint files that contain * a single footprint per file. This class is a helper only for the footprint portion of the - * PLUGIN API, and only for the #PCB_IO plugin. It is private to this implementation file so + * PLUGIN API, and only for the #PCB_PLUGIN plugin. It is private to this implementation file so * it is not placed into a header. */ class FP_CACHE_ITEM @@ -90,7 +90,7 @@ typedef boost::ptr_map< wxString, FP_CACHE_ITEM > FOOTPRINT_MAP; class FP_CACHE { - PCB_IO* m_owner; // Plugin object that owns the cache. + PCB_PLUGIN* m_owner; // Plugin object that owns the cache. wxFileName m_lib_path; // The path of the library. wxString m_lib_raw_path; // For quick comparisons. FOOTPRINT_MAP m_footprints; // Map of footprint filename to FOOTPRINT*. @@ -101,7 +101,7 @@ class FP_CACHE // files. public: - FP_CACHE( PCB_IO* aOwner, const wxString& aLibraryPath ); + FP_CACHE( PCB_PLUGIN* aOwner, const wxString& aLibraryPath ); wxString GetPath() const { return m_lib_raw_path; } @@ -153,7 +153,7 @@ public: }; -FP_CACHE::FP_CACHE( PCB_IO* aOwner, const wxString& aLibraryPath ) +FP_CACHE::FP_CACHE( PCB_PLUGIN* aOwner, const wxString& aLibraryPath ) { m_owner = aOwner; m_lib_raw_path = aLibraryPath; @@ -335,7 +335,7 @@ long long FP_CACHE::GetTimestamp( const wxString& aLibPath ) } -void PCB_IO::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) +void PCB_PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties ) { LOCALE_IO toggle; // toggles on, then off, the C locale. @@ -375,7 +375,7 @@ void PCB_IO::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* a } -BOARD_ITEM* PCB_IO::Parse( const wxString& aClipboardSourceInput ) +BOARD_ITEM* PCB_PLUGIN::Parse( const wxString& aClipboardSourceInput ) { std::string input = TO_UTF8( aClipboardSourceInput ); @@ -397,7 +397,7 @@ BOARD_ITEM* PCB_IO::Parse( const wxString& aClipboardSourceInput ) } -void PCB_IO::Format( const BOARD_ITEM* aItem, int aNestLevel ) const +void PCB_PLUGIN::Format( const BOARD_ITEM* aItem, int aNestLevel ) const { LOCALE_IO toggle; // public API function, perform anything convenient for caller @@ -463,7 +463,7 @@ void PCB_IO::Format( const BOARD_ITEM* aItem, int aNestLevel ) const } -void PCB_IO::formatLayer( const BOARD_ITEM* aItem ) const +void PCB_PLUGIN::formatLayer( const BOARD_ITEM* aItem ) const { PCB_LAYER_ID layer = aItem->GetLayer(); @@ -471,7 +471,7 @@ void PCB_IO::formatLayer( const BOARD_ITEM* aItem ) const } -void PCB_IO::formatSetup( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::formatSetup( const BOARD* aBoard, int aNestLevel ) const { // Setup m_out->Print( aNestLevel, "(setup\n" ); @@ -523,7 +523,7 @@ void PCB_IO::formatSetup( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::formatGeneral( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::formatGeneral( const BOARD* aBoard, int aNestLevel ) const { const BOARD_DESIGN_SETTINGS& dsnSettings = aBoard->GetDesignSettings(); @@ -539,7 +539,7 @@ void PCB_IO::formatGeneral( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const { m_out->Print( aNestLevel, "(layers\n" ); @@ -609,7 +609,7 @@ void PCB_IO::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::formatNetInformation( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::formatNetInformation( const BOARD* aBoard, int aNestLevel ) const { for( NETINFO_ITEM* net : *m_mapping ) { @@ -625,7 +625,7 @@ void PCB_IO::formatNetInformation( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::formatProperties( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::formatProperties( const BOARD* aBoard, int aNestLevel ) const { for( const std::pair& prop : aBoard->GetProperties() ) { @@ -639,7 +639,7 @@ void PCB_IO::formatProperties( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::formatHeader( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::formatHeader( const BOARD* aBoard, int aNestLevel ) const { formatGeneral( aBoard, aNestLevel ); @@ -657,7 +657,7 @@ void PCB_IO::formatHeader( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::format( const BOARD* aBoard, int aNestLevel ) const +void PCB_PLUGIN::format( const BOARD* aBoard, int aNestLevel ) const { std::set sorted_footprints( aBoard->Footprints().begin(), aBoard->Footprints().end() ); @@ -704,7 +704,7 @@ void PCB_IO::format( const BOARD* aBoard, int aNestLevel ) const } -void PCB_IO::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) const +void PCB_PLUGIN::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) const { const PCB_DIM_ALIGNED* aligned = dynamic_cast( aDimension ); const PCB_DIM_ORTHOGONAL* ortho = dynamic_cast( aDimension ); @@ -803,7 +803,7 @@ void PCB_IO::format( const PCB_DIMENSION_BASE* aDimension, int aNestLevel ) cons } -void PCB_IO::format( const PCB_SHAPE* aShape, int aNestLevel ) const +void PCB_PLUGIN::format( const PCB_SHAPE* aShape, int aNestLevel ) const { std::string locked = aShape->IsLocked() ? " locked" : ""; @@ -937,7 +937,7 @@ void PCB_IO::format( const PCB_SHAPE* aShape, int aNestLevel ) const } -void PCB_IO::format( const FP_SHAPE* aFPShape, int aNestLevel ) const +void PCB_PLUGIN::format( const FP_SHAPE* aFPShape, int aNestLevel ) const { std::string locked = aFPShape->IsLocked() ? " locked" : ""; @@ -1045,7 +1045,7 @@ void PCB_IO::format( const FP_SHAPE* aFPShape, int aNestLevel ) const break; default: - wxFAIL_MSG( "PCB_IO::format not implemented for " + aFPShape->SHAPE_T_asString() ); + wxFAIL_MSG( "PCB_PLUGIN::format not implemented for " + aFPShape->SHAPE_T_asString() ); return; }; @@ -1070,7 +1070,7 @@ void PCB_IO::format( const FP_SHAPE* aFPShape, int aNestLevel ) const } -void PCB_IO::format( const PCB_TARGET* aTarget, int aNestLevel ) const +void PCB_PLUGIN::format( const PCB_TARGET* aTarget, int aNestLevel ) const { m_out->Print( aNestLevel, "(target %s (at %s) (size %s)", ( aTarget->GetShape() ) ? "x" : "plus", @@ -1088,7 +1088,7 @@ void PCB_IO::format( const PCB_TARGET* aTarget, int aNestLevel ) const } -void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const +void PCB_PLUGIN::format( const FOOTPRINT* aFootprint, int aNestLevel ) const { if( !( m_ctl & CTL_OMIT_INITIAL_COMMENTS ) ) { @@ -1288,7 +1288,7 @@ void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const } -void PCB_IO::formatLayers( LSET aLayerMask, int aNestLevel ) const +void PCB_PLUGIN::formatLayers( LSET aLayerMask, int aNestLevel ) const { std::string output; @@ -1374,7 +1374,7 @@ void PCB_IO::formatLayers( LSET aLayerMask, int aNestLevel ) const } -void PCB_IO::format( const PAD* aPad, int aNestLevel ) const +void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const { const char* shape; @@ -1741,7 +1741,7 @@ void PCB_IO::format( const PAD* aPad, int aNestLevel ) const } -void PCB_IO::format( const PCB_TEXT* aText, int aNestLevel ) const +void PCB_PLUGIN::format( const PCB_TEXT* aText, int aNestLevel ) const { m_out->Print( aNestLevel, "(gr_text %s (at %s", m_out->Quotew( aText->GetText() ).c_str(), @@ -1765,7 +1765,7 @@ void PCB_IO::format( const PCB_TEXT* aText, int aNestLevel ) const } -void PCB_IO::format( const PCB_GROUP* aGroup, int aNestLevel ) const +void PCB_PLUGIN::format( const PCB_GROUP* aGroup, int aNestLevel ) const { // Don't write empty groups if( aGroup->GetItems().empty() ) @@ -1793,7 +1793,7 @@ void PCB_IO::format( const PCB_GROUP* aGroup, int aNestLevel ) const } -void PCB_IO::format( const FP_TEXT* aText, int aNestLevel ) const +void PCB_PLUGIN::format( const FP_TEXT* aText, int aNestLevel ) const { std::string type; @@ -1858,7 +1858,7 @@ void PCB_IO::format( const FP_TEXT* aText, int aNestLevel ) const } -void PCB_IO::format( const PCB_TRACK* aTrack, int aNestLevel ) const +void PCB_PLUGIN::format( const PCB_TRACK* aTrack, int aNestLevel ) const { if( aTrack->Type() == PCB_VIA_T ) { @@ -1958,7 +1958,7 @@ void PCB_IO::format( const PCB_TRACK* aTrack, int aNestLevel ) const } -void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const +void PCB_PLUGIN::format( const ZONE* aZone, int aNestLevel ) const { std::string locked = aZone->IsLocked() ? " locked" : ""; @@ -2267,7 +2267,7 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const } -PCB_IO::PCB_IO( int aControlFlags ) : +PCB_PLUGIN::PCB_PLUGIN( int aControlFlags ) : m_cache( nullptr ), m_ctl( aControlFlags ), m_parser( new PCB_PARSER() ), @@ -2278,7 +2278,7 @@ PCB_IO::PCB_IO( int aControlFlags ) : } -PCB_IO::~PCB_IO() +PCB_PLUGIN::~PCB_PLUGIN() { delete m_cache; delete m_parser; @@ -2286,8 +2286,8 @@ PCB_IO::~PCB_IO() } -BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties, - PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter ) +BOARD* PCB_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties, + PROJECT* aProject, PROGRESS_REPORTER* aProgressReporter ) { FILE_LINE_READER reader( aFileName ); @@ -2316,8 +2316,8 @@ BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPER } -BOARD* PCB_IO::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPERTIES* aProperties, - PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount) +BOARD* PCB_PLUGIN::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPERTIES* aProperties, + PROGRESS_REPORTER* aProgressReporter, unsigned aLineCount) { init( aProperties ); @@ -2355,7 +2355,7 @@ BOARD* PCB_IO::DoLoad( LINE_READER& aReader, BOARD* aAppendToMe, const PROPERTIE } -void PCB_IO::init( const PROPERTIES* aProperties ) +void PCB_PLUGIN::init( const PROPERTIES* aProperties ) { m_board = nullptr; m_reader = nullptr; @@ -2363,7 +2363,7 @@ void PCB_IO::init( const PROPERTIES* aProperties ) } -void PCB_IO::validateCache( const wxString& aLibraryPath, bool checkModified ) +void PCB_PLUGIN::validateCache( const wxString& aLibraryPath, bool checkModified ) { if( !m_cache || !m_cache->IsPath( aLibraryPath ) || ( checkModified && m_cache->IsModified() ) ) { @@ -2375,8 +2375,8 @@ void PCB_IO::validateCache( const wxString& aLibraryPath, bool checkModified ) } -void PCB_IO::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath, - bool aBestEfforts, const PROPERTIES* aProperties ) +void PCB_PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibPath, + bool aBestEfforts, const PROPERTIES* aProperties ) { LOCALE_IO toggle; // toggles on, then off, the C locale. wxDir dir( aLibPath ); @@ -2404,10 +2404,10 @@ void PCB_IO::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& } -const FOOTPRINT* PCB_IO::getFootprint( const wxString& aLibraryPath, - const wxString& aFootprintName, - const PROPERTIES* aProperties, - bool checkModified ) +const FOOTPRINT* PCB_PLUGIN::getFootprint( const wxString& aLibraryPath, + const wxString& aFootprintName, + const PROPERTIES* aProperties, + bool checkModified ) { LOCALE_IO toggle; // toggles on, then off, the C locale. @@ -2432,16 +2432,16 @@ const FOOTPRINT* PCB_IO::getFootprint( const wxString& aLibraryPath, } -const FOOTPRINT* PCB_IO::GetEnumeratedFootprint( const wxString& aLibraryPath, - const wxString& aFootprintName, - const PROPERTIES* aProperties ) +const FOOTPRINT* PCB_PLUGIN::GetEnumeratedFootprint( const wxString& aLibraryPath, + const wxString& aFootprintName, + const PROPERTIES* aProperties ) { return getFootprint( aLibraryPath, aFootprintName, aProperties, false ); } -bool PCB_IO::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, - const PROPERTIES* aProperties ) +bool PCB_PLUGIN::FootprintExists( const wxString& aLibraryPath, const wxString& aFootprintName, + const PROPERTIES* aProperties ) { // Note: checking the cache sounds like a good idea, but won't catch files which differ // only in case. @@ -2456,10 +2456,10 @@ bool PCB_IO::FootprintExists( const wxString& aLibraryPath, const wxString& aFoo } -FOOTPRINT* PCB_IO::FootprintLoad( const wxString& aLibraryPath, - const wxString& aFootprintName, - bool aKeepUUID, - const PROPERTIES* aProperties ) +FOOTPRINT* PCB_PLUGIN::FootprintLoad( const wxString& aLibraryPath, + const wxString& aFootprintName, + bool aKeepUUID, + const PROPERTIES* aProperties ) { const FOOTPRINT* footprint = getFootprint( aLibraryPath, aFootprintName, aProperties, true ); @@ -2480,8 +2480,8 @@ FOOTPRINT* PCB_IO::FootprintLoad( const wxString& aLibraryPath, } -void PCB_IO::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, - const PROPERTIES* aProperties ) +void PCB_PLUGIN::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFootprint, + const PROPERTIES* aProperties ) { LOCALE_IO toggle; // toggles on, then off, the C locale. @@ -2574,8 +2574,8 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const FOOTPRINT* aFoot } -void PCB_IO::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, - const PROPERTIES* aProperties ) +void PCB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, + const PROPERTIES* aProperties ) { LOCALE_IO toggle; // toggles on, then off, the C locale. @@ -2594,13 +2594,13 @@ void PCB_IO::FootprintDelete( const wxString& aLibraryPath, const wxString& aFoo -long long PCB_IO::GetLibraryTimestamp( const wxString& aLibraryPath ) const +long long PCB_PLUGIN::GetLibraryTimestamp( const wxString& aLibraryPath ) const { return FP_CACHE::GetTimestamp( aLibraryPath ); } -void PCB_IO::FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* aProperties ) +void PCB_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* aProperties ) { if( wxDir::Exists( aLibraryPath ) ) { @@ -2618,7 +2618,7 @@ void PCB_IO::FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* } -bool PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* aProperties ) +bool PCB_PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* aProperties ) { wxFileName fn; fn.SetPath( aLibraryPath ); @@ -2695,7 +2695,7 @@ bool PCB_IO::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* } -bool PCB_IO::IsFootprintLibWritable( const wxString& aLibraryPath ) +bool PCB_PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath ) { LOCALE_IO toggle; diff --git a/pcbnew/plugins/kicad/kicad_plugin.h b/pcbnew/plugins/kicad/pcb_plugin.h similarity index 98% rename from pcbnew/plugins/kicad/kicad_plugin.h rename to pcbnew/plugins/kicad/pcb_plugin.h index 6c01ae04b3..2dd5bcd416 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.h +++ b/pcbnew/plugins/kicad/pcb_plugin.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef KICAD_PLUGIN_H_ -#define KICAD_PLUGIN_H_ +#ifndef PCB_PLUGIN_H +#define PCB_PLUGIN_H #include #include @@ -128,7 +128,7 @@ class PCB_TEXT; #define CTL_FOR_LIBRARY \ ( CTL_OMIT_PAD_NETS | CTL_OMIT_TSTAMPS | CTL_OMIT_PATH | CTL_OMIT_AT | CTL_OMIT_LIBNAME ) -/// The zero arg constructor when PCB_IO is used for PLUGIN::Load() and PLUGIN::Save()ing +/// The zero arg constructor when PCB_PLUGIN is used for PLUGIN::Load() and PLUGIN::Save()ing /// a BOARD file underneath IO_MGR. #define CTL_FOR_BOARD (CTL_OMIT_INITIAL_COMMENTS|CTL_OMIT_FOOTPRINT_VERSION) @@ -138,7 +138,7 @@ class PCB_TEXT; * * @note This class is not thread safe, but it is re-entrant multiple times in sequence. */ -class PCB_IO : public PLUGIN +class PCB_PLUGIN : public PLUGIN { public: const wxString PluginName() const override @@ -195,9 +195,9 @@ public: bool IsFootprintLibWritable( const wxString& aLibraryPath ) override; - PCB_IO( int aControlFlags = CTL_FOR_BOARD ); + PCB_PLUGIN( int aControlFlags = CTL_FOR_BOARD ); - virtual ~PCB_IO(); + virtual ~PCB_PLUGIN(); /** * Output \a aItem to \a aFormatter in s-expression format. @@ -298,4 +298,4 @@ protected: ///< are stored with consecutive integers as net codes }; -#endif // KICAD_PLUGIN_H_ +#endif // PCB_PLUGIN_H diff --git a/pcbnew/python/swig/pcbnew.i b/pcbnew/python/swig/pcbnew.i index 75049cba58..0be856d90e 100644 --- a/pcbnew/python/swig/pcbnew.i +++ b/pcbnew/python/swig/pcbnew.i @@ -106,9 +106,9 @@ HANDLE_EXCEPTIONS(PLUGIN::FootprintEnumerate) HANDLE_EXCEPTIONS(PLUGIN::FootprintLoad) HANDLE_EXCEPTIONS(PLUGIN::FootprintSave) HANDLE_EXCEPTIONS(PLUGIN::FootprintDelete) -%include +%include %{ -#include +#include %} diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 23a0264526..c82276c114 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -58,7 +58,7 @@ using namespace std::placeholders; #include "pns_kicad_iface.h" -#include +#include using namespace KIGFX; @@ -548,7 +548,7 @@ void ROUTER_TOOL::saveRouterDebugLog() // Export as *.kicad_pcb format, using a strategy which is specifically chosen // as an example on how it could also be used to send it to the system clipboard. - PCB_IO pcb_io; + PCB_PLUGIN pcb_io; pcb_io.Save( fname_dump.GetFullPath(), m_iface->GetBoard(), nullptr ); } diff --git a/pcbnew/tools/pcb_selection.cpp b/pcbnew/tools/pcb_selection.cpp index b2b50faa69..4c5a06ccd6 100644 --- a/pcbnew/tools/pcb_selection.cpp +++ b/pcbnew/tools/pcb_selection.cpp @@ -44,7 +44,7 @@ using namespace std::placeholders; #include "pcb_selection_tool.h" #include "pcb_actions.h" -#include "plugins/kicad/kicad_plugin.h" +#include "plugins/kicad/pcb_plugin.h" diff --git a/qa/libeval_compiler/libeval_compiler_test.cpp b/qa/libeval_compiler/libeval_compiler_test.cpp index 1a8602da42..6eadce5a69 100644 --- a/qa/libeval_compiler/libeval_compiler_test.cpp +++ b/qa/libeval_compiler/libeval_compiler_test.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include diff --git a/qa/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp b/qa/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp index fa3069d121..5227f3b5c9 100644 --- a/qa/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp +++ b/qa/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/qa/pcbnew_utils/board_file_utils.cpp b/qa/pcbnew_utils/board_file_utils.cpp index 16b9d46278..c34d233b3a 100644 --- a/qa/pcbnew_utils/board_file_utils.cpp +++ b/qa/pcbnew_utils/board_file_utils.cpp @@ -24,7 +24,7 @@ #include // For PCB parsing -#include +#include #include #include @@ -64,7 +64,7 @@ std::string GetPcbnewTestDataDir() void DumpBoardToFile( BOARD& board, const std::string& aFilename ) { - PCB_IO io; + PCB_PLUGIN io; io.Save( aFilename, &board ); } diff --git a/qa/pcbnew_utils/include/pcbnew_utils/board_file_utils.h b/qa/pcbnew_utils/include/pcbnew_utils/board_file_utils.h index 623ee3e736..c6658b2566 100644 --- a/qa/pcbnew_utils/include/pcbnew_utils/board_file_utils.h +++ b/qa/pcbnew_utils/include/pcbnew_utils/board_file_utils.h @@ -47,9 +47,9 @@ std::string GetPcbnewTestDataDir(); * Utility function to simply write a Board out to a file. * * Helps debug tests and utility programs by making it easy to quickly - * write to disk without directly using the PCB_IO API. + * write to disk without directly using the PCB_PLUGIN API. * - * Note: The aBoard param is non-const because PCB_IO::Save demands it + * Note: The aBoard param is non-const because PCB_PLUGIN::Save demands it * and I am not confident a const_cast will be a true assurance. * * @param aBoard the board to write out diff --git a/qa/pns/pns_log.cpp b/qa/pns/pns_log.cpp index 8e560de6f9..3fc0452a30 100644 --- a/qa/pns/pns_log.cpp +++ b/qa/pns/pns_log.cpp @@ -88,7 +88,7 @@ bool PNS_LOG_FILE::Load( const std::string& logName, const std::string boardName try { - PCB_IO io; + PCB_PLUGIN io; m_board.reset( io.Load( boardName.c_str(), nullptr, nullptr ) ); std::shared_ptr drcEngine( new DRC_ENGINE ); diff --git a/qa/pns/pns_log.h b/qa/pns/pns_log.h index 51194ae5b3..14e9653b75 100644 --- a/qa/pns/pns_log.h +++ b/qa/pns/pns_log.h @@ -52,7 +52,7 @@ #include -#include +#include #include #include diff --git a/qa/pns/pns_log_viewer.cpp b/qa/pns/pns_log_viewer.cpp index 4225374a8a..98b44fae13 100644 --- a/qa/pns/pns_log_viewer.cpp +++ b/qa/pns/pns_log_viewer.cpp @@ -432,7 +432,7 @@ void PNS_LOG_VIEWER_FRAME::drawLoggedItems( int iter ) static BOARD* loadBoard( const std::string& filename ) { - PLUGIN::RELEASER pi( new PCB_IO ); + PLUGIN::RELEASER pi( new PCB_PLUGIN ); BOARD* brd = nullptr; try diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp index 97a497802e..65df19c10b 100644 --- a/qa/qa_utils/pcb_test_frame.cpp +++ b/qa/qa_utils/pcb_test_frame.cpp @@ -91,7 +91,7 @@ void PCB_TEST_FRAME_BASE::SetBoard( std::shared_ptr b ) BOARD* PCB_TEST_FRAME_BASE::LoadAndDisplayBoard( const std::string& filename ) { - PLUGIN::RELEASER pi( new PCB_IO ); + PLUGIN::RELEASER pi( new PCB_PLUGIN ); BOARD* brd = nullptr; try