diff --git a/common/dialogs/dialog_import_choose_project.cpp b/common/dialogs/dialog_import_choose_project.cpp index 55d6034fb3..5b4b436b06 100644 --- a/common/dialogs/dialog_import_choose_project.cpp +++ b/common/dialogs/dialog_import_choose_project.cpp @@ -23,8 +23,8 @@ #include -DIALOG_IMPORT_CHOOSE_PROJECT::DIALOG_IMPORT_CHOOSE_PROJECT( - wxWindow* aParent, const std::vector& aProjectDesc ) : +DIALOG_IMPORT_CHOOSE_PROJECT::DIALOG_IMPORT_CHOOSE_PROJECT( wxWindow* aParent, + const std::vector& aProjectDesc ) : DIALOG_IMPORT_CHOOSE_PROJECT_BASE( aParent ) { m_project_desc = aProjectDesc; @@ -49,8 +49,7 @@ DIALOG_IMPORT_CHOOSE_PROJECT::DIALOG_IMPORT_CHOOSE_PROJECT( { m_listCtrl->InsertItem( row, convertName( desc.ComboName, desc.ComboId ) ); m_listCtrl->SetItem( row, pcbNameColId, convertName( desc.PCBName, desc.PCBId ) ); - m_listCtrl->SetItem( row, schNameColId, - convertName( desc.SchematicName, desc.SchematicId ) ); + m_listCtrl->SetItem( row, schNameColId, convertName( desc.SchematicName, desc.SchematicId ) ); ++row; } @@ -81,7 +80,7 @@ void DIALOG_IMPORT_CHOOSE_PROJECT::onClose( wxCloseEvent& event ) } -std::vector DIALOG_IMPORT_CHOOSE_PROJECT::GetProjectSelections() +std::vector DIALOG_IMPORT_CHOOSE_PROJECT::GetProjects() { std::vector result; @@ -100,13 +99,14 @@ std::vector DIALOG_IMPORT_CHOOSE_PROJECT::GetProjectSelecti } -std::vector DIALOG_IMPORT_CHOOSE_PROJECT::GetSelectionsModal( - wxWindow* aParent, const std::vector& aProjectDesc ) +std::vector +DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( wxWindow* aParent, + const std::vector& aProjectDesc ) { DIALOG_IMPORT_CHOOSE_PROJECT dlg( aParent, aProjectDesc ); if( dlg.ShowModal() != wxID_OK ) return {}; - return dlg.GetProjectSelections(); + return dlg.GetProjects(); } diff --git a/common/dialogs/dialog_import_choose_project.h b/common/dialogs/dialog_import_choose_project.h index 54d29030ec..0f9e1acf71 100644 --- a/common/dialogs/dialog_import_choose_project.h +++ b/common/dialogs/dialog_import_choose_project.h @@ -38,13 +38,13 @@ public: * @param aProjectDesc are project descriptors. */ static std::vector - GetSelectionsModal( wxWindow* aParent, const std::vector& aProjectDesc ); + RunModal( wxWindow* aParent, const std::vector& aProjectDesc ); void onItemActivated( wxListEvent& event ) override; void onClose( wxCloseEvent& event ) override; - std::vector GetProjectSelections(); + std::vector GetProjects(); private: std::vector m_project_desc; diff --git a/common/io/common/plugin_common_choose_project.h b/common/io/common/plugin_common_choose_project.h index 0cd0c30a80..e98e7d805b 100644 --- a/common/io/common/plugin_common_choose_project.h +++ b/common/io/common/plugin_common_choose_project.h @@ -60,7 +60,7 @@ public: * The function is marked as virtual, so the plugins can implement extra * logic (e.g., enable warnings or checks) */ - virtual void RegisterChooseProjectCallback( CHOOSE_PROJECT_HANDLER aChooseProjectHandler ) + virtual void RegisterCallback( CHOOSE_PROJECT_HANDLER aChooseProjectHandler ) { m_choose_project_handler = aChooseProjectHandler; } diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index e928dec109..84506b1d4a 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -1390,14 +1390,10 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType, DIALOG_HTML_REPORTER errorReporter( this ); WX_PROGRESS_REPORTER progressReporter( this, _( "Importing Schematic" ), 1 ); - PROJECT_CHOOSER_PLUGIN* projectChooserPlugin = - dynamic_cast( pi.get() ); - - if( projectChooserPlugin ) + if( PROJECT_CHOOSER_PLUGIN* c_pi = dynamic_cast( pi.get() ) ) { - projectChooserPlugin->RegisterChooseProjectCallback( - std::bind( DIALOG_IMPORT_CHOOSE_PROJECT::GetSelectionsModal, this, - std::placeholders::_1 ) ); + c_pi->RegisterCallback( std::bind( DIALOG_IMPORT_CHOOSE_PROJECT::RunModal, + this, std::placeholders::_1 ) ); } if( eeconfig()->m_System.show_import_issues ) diff --git a/kicad/import_proj.cpp b/kicad/import_proj.cpp index df279fe47e..35487a7b49 100644 --- a/kicad/import_proj.cpp +++ b/kicad/import_proj.cpp @@ -184,9 +184,7 @@ void IMPORT_PROJ_HELPER::EasyEDAProProjectHandler() EASYEDAPRO::ProjectToSelectorDialog( project, false, false ); if( toImport.size() > 1 ) - { - toImport = DIALOG_IMPORT_CHOOSE_PROJECT::GetSelectionsModal( m_frame, toImport ); - } + toImport = DIALOG_IMPORT_CHOOSE_PROJECT::RunModal( m_frame, toImport ); if( toImport.size() == 1 ) { diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index ba081a9902..d1db8c32e0 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -107,7 +107,7 @@ set( PCBNEW_DIALOGS dialogs/dialog_import_settings.cpp dialogs/dialog_import_settings_base.cpp dialogs/dialog_imported_layers_base.cpp - dialogs/dialog_imported_layers.cpp + dialogs/dialog_map_layers.cpp dialogs/dialog_rule_area_properties.cpp dialogs/dialog_rule_area_properties_base.cpp dialogs/dialog_layer_selection_base.cpp diff --git a/pcbnew/dialogs/dialog_imported_layers.cpp b/pcbnew/dialogs/dialog_map_layers.cpp similarity index 86% rename from pcbnew/dialogs/dialog_imported_layers.cpp rename to pcbnew/dialogs/dialog_map_layers.cpp index 8146f25b61..8811a7b41d 100644 --- a/pcbnew/dialogs/dialog_imported_layers.cpp +++ b/pcbnew/dialogs/dialog_map_layers.cpp @@ -20,18 +20,18 @@ #include -#include +#include #include -wxString DIALOG_IMPORTED_LAYERS::WrapRequired( const wxString& aLayerName ) +wxString DIALOG_MAP_LAYERS::WrapRequired( const wxString& aLayerName ) { return aLayerName + wxT( " *" ); } -wxString DIALOG_IMPORTED_LAYERS::UnwrapRequired( const wxString& aLayerName ) +wxString DIALOG_MAP_LAYERS::UnwrapRequired( const wxString& aLayerName ) { if( !aLayerName.EndsWith( wxT( " *" ) ) ) return aLayerName; @@ -40,8 +40,7 @@ wxString DIALOG_IMPORTED_LAYERS::UnwrapRequired( const wxString& aLayerName ) } -const INPUT_LAYER_DESC* DIALOG_IMPORTED_LAYERS::GetLayerDescription( - const wxString& aLayerName ) const +const INPUT_LAYER_DESC* DIALOG_MAP_LAYERS::GetLayerDescription( const wxString& aLayerName ) const { wxString layerName = UnwrapRequired( aLayerName ); @@ -55,7 +54,7 @@ const INPUT_LAYER_DESC* DIALOG_IMPORTED_LAYERS::GetLayerDescription( } -PCB_LAYER_ID DIALOG_IMPORTED_LAYERS::GetSelectedLayerID() +PCB_LAYER_ID DIALOG_MAP_LAYERS::GetSelectedLayerID() { // First check if there is a KiCad element selected wxString selectedKiCadLayerName; @@ -86,10 +85,11 @@ PCB_LAYER_ID DIALOG_IMPORTED_LAYERS::GetSelectedLayerID() } -PCB_LAYER_ID DIALOG_IMPORTED_LAYERS::GetAutoMatchLayerID( const wxString& aInputLayerName ) +PCB_LAYER_ID DIALOG_MAP_LAYERS::GetAutoMatchLayerID( const wxString& aInputLayerName ) { wxString pureInputLayerName = UnwrapRequired( aInputLayerName ); - for( INPUT_LAYER_DESC inputLayerDesc : m_input_layers ) + + for( const INPUT_LAYER_DESC& inputLayerDesc : m_input_layers ) { if( inputLayerDesc.Name == pureInputLayerName && inputLayerDesc.AutoMapLayer != PCB_LAYER_ID::UNSELECTED_LAYER ) @@ -102,7 +102,7 @@ PCB_LAYER_ID DIALOG_IMPORTED_LAYERS::GetAutoMatchLayerID( const wxString& aInput } -void DIALOG_IMPORTED_LAYERS::AddMappings() +void DIALOG_MAP_LAYERS::AddMappings() { PCB_LAYER_ID selectedKiCadLayerID = GetSelectedLayerID(); @@ -148,7 +148,7 @@ void DIALOG_IMPORTED_LAYERS::AddMappings() } -void DIALOG_IMPORTED_LAYERS::RemoveMappings( int aStatus ) +void DIALOG_MAP_LAYERS::RemoveMappings( int aStatus ) { wxArrayInt rowsToDelete; int itemIndex = -1; @@ -173,17 +173,14 @@ void DIALOG_IMPORTED_LAYERS::RemoveMappings( int aStatus ) } -void DIALOG_IMPORTED_LAYERS::DeleteListItems( const wxArrayInt& aRowsToDelete, - wxListCtrl* aListCtrl ) +void DIALOG_MAP_LAYERS::DeleteListItems( const wxArrayInt& aRowsToDelete, wxListCtrl* aListCtrl ) { - for( long n = ( aRowsToDelete.GetCount() - 1 ); 0 <= n; n-- ) - { + for( long n = (long) aRowsToDelete.GetCount() - 1; 0 <= n; n-- ) aListCtrl->DeleteItem( aRowsToDelete[n] ); - } } -void DIALOG_IMPORTED_LAYERS::OnAutoMatchLayersClicked( wxCommandEvent& event ) +void DIALOG_MAP_LAYERS::OnAutoMatchLayersClicked( wxCommandEvent& event ) { // Iterate through each selected layer in the unmatched layers list int itemIndex = -1; @@ -225,14 +222,14 @@ void DIALOG_IMPORTED_LAYERS::OnAutoMatchLayersClicked( wxCommandEvent& event ) } -DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS( wxWindow* aParent, - const std::vector& aLayerDesc ) : +DIALOG_MAP_LAYERS::DIALOG_MAP_LAYERS( wxWindow* aParent, + const std::vector& aLayerDesc ) : DIALOG_IMPORTED_LAYERS_BASE( aParent ) { LSET kiCadLayers; // Read in the input layers - for( INPUT_LAYER_DESC inLayer : aLayerDesc ) + for( const INPUT_LAYER_DESC& inLayer : aLayerDesc ) { m_input_layers.push_back( inLayer ); wxString layerName = inLayer.Required ? WrapRequired( inLayer.Name ) : inLayer.Name; @@ -269,7 +266,7 @@ DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS( wxWindow* aParent, // Load the input layer list to unmatched layers int row = 0; - for( wxString importedLayerName : m_unmatched_layer_names ) + for( const wxString& importedLayerName : m_unmatched_layer_names ) { wxListItem item; item.SetId( row ); @@ -306,7 +303,7 @@ DIALOG_IMPORTED_LAYERS::DIALOG_IMPORTED_LAYERS( wxWindow* aParent, } -std::vector DIALOG_IMPORTED_LAYERS::GetUnmappedRequiredLayers() const +std::vector DIALOG_MAP_LAYERS::GetUnmappedRequiredLayers() const { std::vector unmappedLayers; @@ -324,11 +321,10 @@ std::vector DIALOG_IMPORTED_LAYERS::GetUnmappedRequiredLayers() const std::map - DIALOG_IMPORTED_LAYERS::GetMapModal( wxWindow* aParent, - const std::vector& aLayerDesc ) +DIALOG_MAP_LAYERS::RunModal( wxWindow* aParent, const std::vector& aLayerDesc ) { - DIALOG_IMPORTED_LAYERS dlg( aParent, aLayerDesc ); - bool dataOk = false; + DIALOG_MAP_LAYERS dlg( aParent, aLayerDesc ); + bool dataOk = false; while( !dataOk ) { diff --git a/pcbnew/dialogs/dialog_imported_layers.h b/pcbnew/dialogs/dialog_map_layers.h similarity index 89% rename from pcbnew/dialogs/dialog_imported_layers.h rename to pcbnew/dialogs/dialog_map_layers.h index 98779214c7..a79e385ae8 100644 --- a/pcbnew/dialogs/dialog_imported_layers.h +++ b/pcbnew/dialogs/dialog_map_layers.h @@ -25,10 +25,10 @@ #include -class DIALOG_IMPORTED_LAYERS : public DIALOG_IMPORTED_LAYERS_BASE +class DIALOG_MAP_LAYERS : public DIALOG_IMPORTED_LAYERS_BASE { public: - DIALOG_IMPORTED_LAYERS( wxWindow* aParent, const std::vector& aLayerDesc ); + DIALOG_MAP_LAYERS( wxWindow* aParent, const std::vector& aLayerDesc ); /** * Return a list of layers names that are required, but they are not mapped. @@ -43,8 +43,8 @@ public: * @param aLayerDesc * @return Mapped layers */ - static std::map GetMapModal( wxWindow* aParent, - const std::vector& aLayerDesc ); + static std::map RunModal( wxWindow* aParent, + const std::vector& aLayerDesc ); private: //Helper functions diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index c377dadb02..ddd7970afc 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -63,7 +63,7 @@ #include #include #include -#include +#include #include #include #include "footprint_info_impl.h" @@ -525,10 +525,9 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in if( !lock->Valid() && lock->IsLockedByMe() ) { - // If we cannot acquire the lock but we appear to be the one who - // locked it, check to see if there is another KiCad instance running. - // If there is not, then we can override the lock. This could happen if - // KiCad crashed or was interrupted + // If we cannot acquire the lock but we appear to be the one who locked it, check to + // see if there is another KiCad instance running. If not, then we can override the + // lock. This could happen if KiCad crashed or was interrupted. if( !Pgm().SingleInstance()->IsAnotherRunning() ) lock->OverrideLock(); @@ -536,8 +535,10 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in if( !lock->Valid() ) { - msg.Printf( _( "PCB '%s' is already open by '%s' at '%s'." ), wx_filename.GetFullName(), - lock->GetUsername(), lock->GetHostname() ); + msg.Printf( _( "PCB '%s' is already open by '%s' at '%s'." ), + wx_filename.GetFullName(), + lock->GetUsername(), + lock->GetHostname() ); if( !AskOverrideLock( this, msg ) ) return false; @@ -562,7 +563,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in bool is_new = !wxFileName::IsFileReadable( fullFileName ); - // If its a non-existent schematic and caller thinks it exists + // If its a non-existent PCB and caller thinks it exists if( is_new && !( aCtl & KICTL_CREATE ) ) { // notify user that fullFileName does not exist, ask if user wants to create it. @@ -609,9 +610,9 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in mgr->LoadProject( pro.GetFullPath() ); // Do not allow saving a project if one doesn't exist. This normally happens if we are - // standalone and opening a board that has been moved from its project folder. - // For converted projects, we don't want to set the read-only flag because we want a project - // to be saved for the new file in case things like netclasses got migrated. + // opening a board that has been moved from its project folder. + // For converted projects, we don't want to set the read-only flag because we want a + // project to be saved for the new file in case things like netclasses got migrated. Prj().SetReadOnly( !pro.Exists() && !converted ); } @@ -632,21 +633,17 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in BOARD* loadedBoard = nullptr; // it will be set to non-NULL if loaded OK IO_RELEASER pi( PCB_IO_MGR::PluginFind( pluginType ) ); - LAYER_REMAPPABLE_PLUGIN* layerRemappableIO = dynamic_cast( pi.get() ); - - if( layerRemappableIO ) + if( LAYER_MAPPABLE_PLUGIN* mappable_pi = dynamic_cast( pi.get() ) ) { - layerRemappableIO->RegisterLayerMappingCallback( - std::bind( DIALOG_IMPORTED_LAYERS::GetMapModal, this, std::placeholders::_1 ) ); + mappable_pi->RegisterCallback( std::bind( DIALOG_MAP_LAYERS::RunModal, + this, std::placeholders::_1 ) ); } - PROJECT_CHOOSER_PLUGIN* projectChooserIO = dynamic_cast( pi.get() ); - - if( projectChooserIO ) + if( PROJECT_CHOOSER_PLUGIN* chooser_pi = dynamic_cast( pi.get() ) ) { - projectChooserIO->RegisterChooseProjectCallback( - std::bind( DIALOG_IMPORT_CHOOSE_PROJECT::GetSelectionsModal, this, - std::placeholders::_1 ) ); + chooser_pi->RegisterCallback( std::bind( DIALOG_IMPORT_CHOOSE_PROJECT::RunModal, + this, + std::placeholders::_1 ) ); } if( ( aCtl & KICTL_REVERT ) ) diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp index 56f2b3afab..5be1bb7b6a 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.cpp @@ -41,9 +41,10 @@ #include #include -PCB_IO_ALTIUM_CIRCUIT_MAKER::PCB_IO_ALTIUM_CIRCUIT_MAKER() : PCB_IO( wxS( "Altium Circuit Maker" ) ) +PCB_IO_ALTIUM_CIRCUIT_MAKER::PCB_IO_ALTIUM_CIRCUIT_MAKER() : + PCB_IO( wxS( "Altium Circuit Maker" ) ) { - RegisterLayerMappingCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); + RegisterCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); } diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.h b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.h index e5cff082e6..8009297e60 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.h +++ b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_maker.h @@ -30,7 +30,7 @@ #include #include -class PCB_IO_ALTIUM_CIRCUIT_MAKER : public PCB_IO, public LAYER_REMAPPABLE_PLUGIN +class PCB_IO_ALTIUM_CIRCUIT_MAKER : public PCB_IO, public LAYER_MAPPABLE_PLUGIN { public: const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp index 61c5cd3b2b..45f2855480 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.cpp @@ -42,9 +42,10 @@ #include #include -PCB_IO_ALTIUM_CIRCUIT_STUDIO::PCB_IO_ALTIUM_CIRCUIT_STUDIO() : PCB_IO( wxS( "Altium Circuit Studio" ) ) +PCB_IO_ALTIUM_CIRCUIT_STUDIO::PCB_IO_ALTIUM_CIRCUIT_STUDIO() : + PCB_IO( wxS( "Altium Circuit Studio" ) ) { - RegisterLayerMappingCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); + RegisterCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); } diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.h b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.h index e3798e1007..483e4978a6 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.h +++ b/pcbnew/pcb_io/altium/pcb_io_altium_circuit_studio.h @@ -29,7 +29,7 @@ #include #include -class PCB_IO_ALTIUM_CIRCUIT_STUDIO : public PCB_IO, public LAYER_REMAPPABLE_PLUGIN +class PCB_IO_ALTIUM_CIRCUIT_STUDIO : public PCB_IO, public LAYER_MAPPABLE_PLUGIN { public: const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp b/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp index 5838c67568..f387c24942 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_altium_designer.cpp @@ -41,11 +41,12 @@ #include #include -PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER() : PCB_IO( wxS( "Altium Designer" ) ) +PCB_IO_ALTIUM_DESIGNER::PCB_IO_ALTIUM_DESIGNER() : + PCB_IO( wxS( "Altium Designer" ) ) { m_reporter = &WXLOG_REPORTER::GetInstance(); - RegisterLayerMappingCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); + RegisterCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); } diff --git a/pcbnew/pcb_io/altium/pcb_io_altium_designer.h b/pcbnew/pcb_io/altium/pcb_io_altium_designer.h index 2091adab7d..e9f6a049bc 100644 --- a/pcbnew/pcb_io/altium/pcb_io_altium_designer.h +++ b/pcbnew/pcb_io/altium/pcb_io_altium_designer.h @@ -34,7 +34,7 @@ class ALTIUM_COMPOUND_FILE; -class PCB_IO_ALTIUM_DESIGNER : public PCB_IO, public LAYER_REMAPPABLE_PLUGIN +class PCB_IO_ALTIUM_DESIGNER : public PCB_IO, public LAYER_MAPPABLE_PLUGIN { public: // ------------------------------------------------------- diff --git a/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp b/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp index cbeb88e50a..129521ed95 100644 --- a/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp +++ b/pcbnew/pcb_io/altium/pcb_io_solidworks.cpp @@ -32,10 +32,11 @@ #include #include -PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS() : PCB_IO( wxS( "Solidworks PCB" ) ) +PCB_IO_SOLIDWORKS::PCB_IO_SOLIDWORKS() : + PCB_IO( wxS( "Solidworks PCB" ) ) { m_reporter = &WXLOG_REPORTER::GetInstance(); - RegisterLayerMappingCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); + RegisterCallback( PCB_IO_ALTIUM_DESIGNER::DefaultLayerMappingCallback ); } diff --git a/pcbnew/pcb_io/altium/pcb_io_solidworks.h b/pcbnew/pcb_io/altium/pcb_io_solidworks.h index 5dd890ffe5..7575d9456d 100644 --- a/pcbnew/pcb_io/altium/pcb_io_solidworks.h +++ b/pcbnew/pcb_io/altium/pcb_io_solidworks.h @@ -24,7 +24,7 @@ #include #include -class PCB_IO_SOLIDWORKS : public PCB_IO, public LAYER_REMAPPABLE_PLUGIN +class PCB_IO_SOLIDWORKS : public PCB_IO, public LAYER_MAPPABLE_PLUGIN { public: const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override diff --git a/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp b/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp index 1857f2ca8b..4f7df47ae0 100644 --- a/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp +++ b/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.cpp @@ -49,10 +49,9 @@ std::map PCB_IO_CADSTAR_ARCHIVE::DefaultLayerMappingCall } -void PCB_IO_CADSTAR_ARCHIVE::RegisterLayerMappingCallback( - LAYER_MAPPING_HANDLER aLayerMappingHandler ) +void PCB_IO_CADSTAR_ARCHIVE::RegisterCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) { - LAYER_REMAPPABLE_PLUGIN::RegisterLayerMappingCallback( aLayerMappingHandler ); + LAYER_MAPPABLE_PLUGIN::RegisterCallback( aLayerMappingHandler ); m_show_layer_mapping_warnings = false; // only show warnings with default callback } @@ -60,8 +59,7 @@ void PCB_IO_CADSTAR_ARCHIVE::RegisterLayerMappingCallback( PCB_IO_CADSTAR_ARCHIVE::PCB_IO_CADSTAR_ARCHIVE() : PCB_IO( wxS( "CADSTAR PCB Archive" ) ) { m_show_layer_mapping_warnings = true; - LAYER_REMAPPABLE_PLUGIN::RegisterLayerMappingCallback( - PCB_IO_CADSTAR_ARCHIVE::DefaultLayerMappingCallback ); + LAYER_MAPPABLE_PLUGIN::RegisterCallback( PCB_IO_CADSTAR_ARCHIVE::DefaultLayerMappingCallback ); } diff --git a/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.h b/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.h index 31f4f9f94d..fff8e1d436 100644 --- a/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.h +++ b/pcbnew/pcb_io/cadstar/pcb_io_cadstar_archive.h @@ -29,7 +29,7 @@ #include -class PCB_IO_CADSTAR_ARCHIVE : public PCB_IO, public LAYER_REMAPPABLE_PLUGIN +class PCB_IO_CADSTAR_ARCHIVE : public PCB_IO, public LAYER_MAPPABLE_PLUGIN { public: const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override @@ -62,7 +62,7 @@ public: * * @param aLayerMappingHandler */ - void RegisterLayerMappingCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) override; + void RegisterCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) override; void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath, bool aBestEfforts, const STRING_UTF8_MAP* aProperties = nullptr ) override; diff --git a/pcbnew/pcb_io/common/plugin_common_layer_mapping.h b/pcbnew/pcb_io/common/plugin_common_layer_mapping.h index 007fae7f3a..fd123a81df 100644 --- a/pcbnew/pcb_io/common/plugin_common_layer_mapping.h +++ b/pcbnew/pcb_io/common/plugin_common_layer_mapping.h @@ -58,7 +58,7 @@ using LAYER_MAPPING_HANDLER = std::function( co /** * @brief Plugin class for import plugins that support remappable layers */ -class LAYER_REMAPPABLE_PLUGIN +class LAYER_MAPPABLE_PLUGIN { public: /** @@ -70,12 +70,12 @@ public: * * @param aLayerMappingHandler */ - virtual void RegisterLayerMappingCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) + virtual void RegisterCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) { m_layer_mapping_handler = aLayerMappingHandler; } - virtual ~LAYER_REMAPPABLE_PLUGIN() = default; + virtual ~LAYER_MAPPABLE_PLUGIN() = default; protected: LAYER_MAPPING_HANDLER m_layer_mapping_handler; ///< Callback to get layer mapping }; diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp index ded24c82e7..4e6b8de55c 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.cpp @@ -222,7 +222,8 @@ void ERULES::parse( wxXmlNode* aRules, std::function aCheckpoint ) } -PCB_IO_EAGLE::PCB_IO_EAGLE() : PCB_IO( wxS( "Eagle" ) ), +PCB_IO_EAGLE::PCB_IO_EAGLE() : + PCB_IO( wxS( "Eagle" ) ), m_rules( new ERULES() ), m_xpath( new XPATH() ), m_progressReporter( nullptr ), @@ -235,8 +236,7 @@ PCB_IO_EAGLE::PCB_IO_EAGLE() : PCB_IO( wxS( "Eagle" ) ), init( nullptr ); clear_cu_map(); - RegisterLayerMappingCallback( std::bind( &PCB_IO_EAGLE::DefaultLayerMappingCallback, - this, _1 ) ); + RegisterCallback( std::bind( &PCB_IO_EAGLE::DefaultLayerMappingCallback, this, _1 ) ); } diff --git a/pcbnew/pcb_io/eagle/pcb_io_eagle.h b/pcbnew/pcb_io/eagle/pcb_io_eagle.h index 6837265230..e97a9d45d4 100644 --- a/pcbnew/pcb_io/eagle/pcb_io_eagle.h +++ b/pcbnew/pcb_io/eagle/pcb_io_eagle.h @@ -128,7 +128,7 @@ struct ERULES * Works with Eagle 6.x XML board files and footprints to implement the Pcbnew #PLUGIN API * or a portion of it. */ -class PCB_IO_EAGLE : public PCB_IO, public LAYER_REMAPPABLE_PLUGIN +class PCB_IO_EAGLE : public PCB_IO, public LAYER_MAPPABLE_PLUGIN { public: const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override