diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index c670e25184..71e2ca6e37 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -252,11 +252,11 @@ set( EESCHEMA_SRCS tools/ee_point_editor.cpp tools/ee_selection.cpp tools/ee_selection_tool.cpp - tools/lib_control.cpp - tools/lib_drawing_tools.cpp - tools/lib_edit_tool.cpp - tools/lib_move_tool.cpp - tools/lib_pin_tool.cpp + tools/symbol_editor_control.cpp + tools/symbol_editor_drawing_tools.cpp + tools/symbol_editor_edit_tool.cpp + tools/symbol_editor_move_tool.cpp + tools/symbol_editor_pin_tool.cpp tools/reannotate.cpp tools/sch_drawing_tools.cpp tools/sch_edit_tool.cpp diff --git a/eeschema/dialogs/dialog_lib_edit_text.cpp b/eeschema/dialogs/dialog_lib_edit_text.cpp index 14e86afb10..7efc6e669d 100644 --- a/eeschema/dialogs/dialog_lib_edit_text.cpp +++ b/eeschema/dialogs/dialog_lib_edit_text.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT( SYMBOL_EDIT_FRAME* aParent, LIB_TEXT* aText ) : @@ -91,7 +91,7 @@ bool DIALOG_LIB_EDIT_TEXT::TransferDataToWindow() else { auto* cfg = Pgm().GetSettingsManager().GetAppSettings(); - LIB_DRAWING_TOOLS* tools = m_parent->GetToolManager()->GetTool(); + auto* tools = m_parent->GetToolManager()->GetTool(); m_textSize.SetValue( Mils2iu( cfg->m_Defaults.text_size ) ); @@ -147,7 +147,7 @@ bool DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow() } // Record settings used for next time: - LIB_DRAWING_TOOLS* tools = m_parent->GetToolManager()->GetTool(); + auto* tools = m_parent->GetToolManager()->GetTool(); tools->SetLastTextAngle( m_graphicText->GetTextAngle() ); tools->SetDrawSpecificConvert( !m_CommonConvert->GetValue() ); tools->SetDrawSpecificUnit( !m_CommonUnit->GetValue() ); diff --git a/eeschema/lib_view_frame.cpp b/eeschema/lib_view_frame.cpp index 7da4df72a2..48ad67b3a9 100644 --- a/eeschema/lib_view_frame.cpp +++ b/eeschema/lib_view_frame.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include @@ -234,7 +234,7 @@ void LIB_VIEW_FRAME::setupTools() m_toolManager->RegisterTool( new ZOOM_TOOL ); m_toolManager->RegisterTool( new EE_INSPECTION_TOOL ); // manage show datasheet m_toolManager->RegisterTool( new EE_SELECTION_TOOL ); // manage context menu - m_toolManager->RegisterTool( new LIB_CONTROL ); + m_toolManager->RegisterTool( new SYMBOL_EDITOR_CONTROL ); m_toolManager->InitTools(); diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 8f9c6c139b..dfd00caf71 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -57,11 +57,11 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -293,12 +293,12 @@ void SYMBOL_EDIT_FRAME::setupTools() m_toolManager->RegisterTool( new EE_SELECTION_TOOL ); m_toolManager->RegisterTool( new PICKER_TOOL ); m_toolManager->RegisterTool( new EE_INSPECTION_TOOL ); - m_toolManager->RegisterTool( new LIB_PIN_TOOL ); - m_toolManager->RegisterTool( new LIB_DRAWING_TOOLS ); + m_toolManager->RegisterTool( new SYMBOL_EDITOR_PIN_TOOL ); + m_toolManager->RegisterTool( new SYMBOL_EDITOR_DRAWING_TOOLS ); m_toolManager->RegisterTool( new EE_POINT_EDITOR ); - m_toolManager->RegisterTool( new LIB_MOVE_TOOL ); - m_toolManager->RegisterTool( new LIB_EDIT_TOOL ); - m_toolManager->RegisterTool( new LIB_CONTROL ); + m_toolManager->RegisterTool( new SYMBOL_EDITOR_MOVE_TOOL ); + m_toolManager->RegisterTool( new SYMBOL_EDITOR_EDIT_TOOL ); + m_toolManager->RegisterTool( new SYMBOL_EDITOR_CONTROL ); m_toolManager->InitTools(); // Run the selection tool, it is supposed to be always active diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 8d2b05d4f3..90f9a3a40a 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -994,7 +994,7 @@ void SYMBOL_EDIT_FRAME::LoadPart( const wxString& aAlias, const wxString& aLibra // Optimize default edit options for this symbol // Usually if units are locked, graphic items are specific to each unit // and if units are interchangeable, graphic items are common to units - LIB_DRAWING_TOOLS* tools = GetToolManager()->GetTool(); + SYMBOL_EDITOR_DRAWING_TOOLS* tools = GetToolManager()->GetTool(); tools->SetDrawSpecificUnit( part->UnitsLocked() ); LoadOneLibraryPartAux( part, aLibrary, aUnit, 0 ); diff --git a/eeschema/symbol_tree_synchronizing_adapter.cpp b/eeschema/symbol_tree_synchronizing_adapter.cpp index 931466163c..846a7ef093 100644 --- a/eeschema/symbol_tree_synchronizing_adapter.cpp +++ b/eeschema/symbol_tree_synchronizing_adapter.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include wxObjectDataPtr @@ -51,7 +51,7 @@ SYMBOL_TREE_SYNCHRONIZING_ADAPTER::SYMBOL_TREE_SYNCHRONIZING_ADAPTER( SYMBOL_EDI TOOL_INTERACTIVE* SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool() { - return m_frame->GetToolManager()->GetTool(); + return m_frame->GetToolManager()->GetTool(); } diff --git a/eeschema/toolbars_lib_view.cpp b/eeschema/toolbars_lib_view.cpp index a0b95d70d0..21e6ab17dc 100644 --- a/eeschema/toolbars_lib_view.cpp +++ b/eeschema/toolbars_lib_view.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include void LIB_VIEW_FRAME::ReCreateHToolbar() @@ -98,7 +98,7 @@ void LIB_VIEW_FRAME::ReCreateVToolbar() void LIB_VIEW_FRAME::ReCreateMenuBar() { - LIB_CONTROL* libControl = m_toolManager->GetTool(); + SYMBOL_EDITOR_CONTROL* libControl = m_toolManager->GetTool(); // wxWidgets handles the OSX Application menu behind the scenes, but that means // we always have to start from scratch with a new wxMenuBar. wxMenuBar* oldMenuBar = GetMenuBar(); diff --git a/eeschema/tools/ee_actions.cpp b/eeschema/tools/ee_actions.cpp index 39d548a57e..2d6642face 100644 --- a/eeschema/tools/ee_actions.cpp +++ b/eeschema/tools/ee_actions.cpp @@ -110,7 +110,7 @@ TOOL_ACTION EE_ACTIONS::clearSelection( "eeschema.InteractiveSelection.ClearSele AS_GLOBAL ); -// LIB_CONTROL +// SYMBOL_EDITOR_CONTROL // TOOL_ACTION EE_ACTIONS::newSymbol( "eeschema.SymbolLibraryControl.newSymbol", AS_GLOBAL, 0, "", @@ -196,7 +196,7 @@ TOOL_ACTION EE_ACTIONS::saveInSchematic( "eeschema.SymbolLibraryControl.saveInSc save_symbol_to_schematic_xpm ); -// LIB_DRAWING_TOOLS +// SYMBOL_EDITOR_DRAWING_TOOLS // TOOL_ACTION EE_ACTIONS::placeSymbolPin( "eeschema.SymbolDrawing.placeSymbolPin", AS_GLOBAL, @@ -239,7 +239,7 @@ TOOL_ACTION EE_ACTIONS::finishDrawing( "eeschema.SymbolDrawing.finishDrawing", _( "Finish Drawing" ), _( "Finish drawing shape" ), checked_ok_xpm, AF_NONE ); -// LIB_PIN_TOOL +// SYMBOL_EDITOR_PIN_TOOL // TOOL_ACTION EE_ACTIONS::pushPinLength( "eeschema.PinEditing.pushPinLength", AS_GLOBAL, 0, "", diff --git a/eeschema/tools/lib_control.cpp b/eeschema/tools/symbol_editor_control.cpp similarity index 78% rename from eeschema/tools/lib_control.cpp rename to eeschema/tools/symbol_editor_control.cpp index 6ccf772623..c3a00693cb 100644 --- a/eeschema/tools/lib_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,7 +35,7 @@ #include -bool LIB_CONTROL::Init() +bool SYMBOL_EDITOR_CONTROL::Init() { m_frame = getEditFrame(); m_selectionTool = m_toolMgr->GetTool(); @@ -104,7 +104,7 @@ bool LIB_CONTROL::Init() } -int LIB_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) { bool createNew = aEvent.IsAction( &ACTIONS::newLibrary ); @@ -115,7 +115,7 @@ int LIB_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::EditSymbol( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::EditSymbol( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -130,7 +130,7 @@ int LIB_CONTROL::EditSymbol( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::AddSymbol( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::AddSymbol( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -146,7 +146,7 @@ int LIB_CONTROL::AddSymbol( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::Save( const TOOL_EVENT& aEvt ) +int SYMBOL_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvt ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -164,7 +164,7 @@ int LIB_CONTROL::Save( const TOOL_EVENT& aEvt ) } -int LIB_CONTROL::Revert( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::Revert( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) static_cast( m_frame )->Revert(); @@ -173,7 +173,7 @@ int LIB_CONTROL::Revert( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::ExportSymbol( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::ExportSymbol( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) static_cast( m_frame )->ExportPart(); @@ -182,7 +182,7 @@ int LIB_CONTROL::ExportSymbol( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::CutCopyDelete( const TOOL_EVENT& aEvt ) +int SYMBOL_EDITOR_CONTROL::CutCopyDelete( const TOOL_EVENT& aEvt ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -199,7 +199,7 @@ int LIB_CONTROL::CutCopyDelete( const TOOL_EVENT& aEvt ) } -int LIB_CONTROL::DuplicateSymbol( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::DuplicateSymbol( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -211,7 +211,7 @@ int LIB_CONTROL::DuplicateSymbol( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent ) { int convert = aEvent.IsAction( &EE_ACTIONS::showDeMorganStandard ) ? LIB_ITEM::LIB_CONVERT::BASE : LIB_ITEM::LIB_CONVERT::DEMORGAN; @@ -237,7 +237,7 @@ int LIB_CONTROL::OnDeMorgan( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::PinLibrary( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::PinLibrary( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -255,7 +255,7 @@ int LIB_CONTROL::PinLibrary( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::UnpinLibrary( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::UnpinLibrary( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -273,7 +273,7 @@ int LIB_CONTROL::UnpinLibrary( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::ShowComponentTree( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::ShowComponentTree( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) ) { @@ -285,7 +285,7 @@ int LIB_CONTROL::ShowComponentTree( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::ShowElectricalTypes( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::ShowElectricalTypes( const TOOL_EVENT& aEvent ) { KIGFX::SCH_RENDER_SETTINGS* renderSettings = m_frame->GetRenderSettings(); renderSettings->m_ShowPinsElectricalType = !renderSettings->m_ShowPinsElectricalType; @@ -298,7 +298,7 @@ int LIB_CONTROL::ShowElectricalTypes( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::ToggleSyncedPinsMode( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode( const TOOL_EVENT& aEvent ) { if( !m_isSymbolEditor ) return 0; @@ -310,7 +310,7 @@ int LIB_CONTROL::ToggleSyncedPinsMode( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::ExportView( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::ExportView( const TOOL_EVENT& aEvent ) { if( !m_isSymbolEditor ) return 0; @@ -350,7 +350,7 @@ int LIB_CONTROL::ExportView( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::ExportSymbolAsSVG( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG( const TOOL_EVENT& aEvent ) { if( !m_isSymbolEditor ) return 0; @@ -395,7 +395,7 @@ int LIB_CONTROL::ExportSymbolAsSVG( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) { LIB_PART* part = nullptr; LIB_ID libId; @@ -462,7 +462,7 @@ int LIB_CONTROL::AddSymbolToSchematic( const TOOL_EVENT& aEvent ) } -int LIB_CONTROL::UpdateSymbolInSchematic( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_CONTROL::UpdateSymbolInSchematic( const TOOL_EVENT& aEvent ) { wxCHECK( m_isSymbolEditor, 0 ); @@ -494,38 +494,37 @@ int LIB_CONTROL::UpdateSymbolInSchematic( const TOOL_EVENT& aEvent ) } -void LIB_CONTROL::setTransitions() +void SYMBOL_EDITOR_CONTROL::setTransitions() { - Go( &LIB_CONTROL::AddLibrary, ACTIONS::newLibrary.MakeEvent() ); - Go( &LIB_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() ); - Go( &LIB_CONTROL::AddSymbol, EE_ACTIONS::newSymbol.MakeEvent() ); - Go( &LIB_CONTROL::AddSymbol, EE_ACTIONS::importSymbol.MakeEvent() ); - Go( &LIB_CONTROL::EditSymbol, EE_ACTIONS::editSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddLibrary, ACTIONS::newLibrary.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::newSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbol, EE_ACTIONS::importSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::EditSymbol, EE_ACTIONS::editSymbol.MakeEvent() ); - Go( &LIB_CONTROL::Save, ACTIONS::save.MakeEvent() ); - Go( &LIB_CONTROL::Save, ACTIONS::saveAs.MakeEvent() ); // for libraries - Go( &LIB_CONTROL::Save, ACTIONS::saveCopyAs.MakeEvent() ); // for symbols - Go( &LIB_CONTROL::Save, ACTIONS::saveAll.MakeEvent() ); - Go( &LIB_CONTROL::Revert, ACTIONS::revert.MakeEvent() ); - Go( &LIB_CONTROL::UpdateSymbolInSchematic, - EE_ACTIONS::saveInSchematic.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::saveAs.MakeEvent() ); // for libraries + Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::saveCopyAs.MakeEvent() ); // for symbols + Go( &SYMBOL_EDITOR_CONTROL::Save, ACTIONS::saveAll.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::Revert, ACTIONS::revert.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::UpdateSymbolInSchematic, EE_ACTIONS::saveInSchematic.MakeEvent() ); - Go( &LIB_CONTROL::DuplicateSymbol, EE_ACTIONS::duplicateSymbol.MakeEvent() ); - Go( &LIB_CONTROL::CutCopyDelete, EE_ACTIONS::deleteSymbol.MakeEvent() ); - Go( &LIB_CONTROL::CutCopyDelete, EE_ACTIONS::cutSymbol.MakeEvent() ); - Go( &LIB_CONTROL::CutCopyDelete, EE_ACTIONS::copySymbol.MakeEvent() ); - Go( &LIB_CONTROL::DuplicateSymbol, EE_ACTIONS::pasteSymbol.MakeEvent() ); - Go( &LIB_CONTROL::ExportSymbol, EE_ACTIONS::exportSymbol.MakeEvent() ); - Go( &LIB_CONTROL::ExportView, EE_ACTIONS::exportSymbolView.MakeEvent() ); - Go( &LIB_CONTROL::ExportSymbolAsSVG, EE_ACTIONS::exportSymbolAsSVG.MakeEvent() ); - Go( &LIB_CONTROL::AddSymbolToSchematic, EE_ACTIONS::addSymbolToSchematic.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, EE_ACTIONS::duplicateSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::deleteSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::cutSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::CutCopyDelete, EE_ACTIONS::copySymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::DuplicateSymbol, EE_ACTIONS::pasteSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ExportSymbol, EE_ACTIONS::exportSymbol.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ExportView, EE_ACTIONS::exportSymbolView.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ExportSymbolAsSVG, EE_ACTIONS::exportSymbolAsSVG.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic, EE_ACTIONS::addSymbolToSchematic.MakeEvent() ); - Go( &LIB_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() ); - Go( &LIB_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganStandard.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::OnDeMorgan, EE_ACTIONS::showDeMorganAlternate.MakeEvent() ); - Go( &LIB_CONTROL::ShowElectricalTypes, EE_ACTIONS::showElectricalTypes.MakeEvent() ); - Go( &LIB_CONTROL::PinLibrary, ACTIONS::pinLibrary.MakeEvent() ); - Go( &LIB_CONTROL::UnpinLibrary, ACTIONS::unpinLibrary.MakeEvent() ); - Go( &LIB_CONTROL::ShowComponentTree, EE_ACTIONS::showComponentTree.MakeEvent() ); - Go( &LIB_CONTROL::ToggleSyncedPinsMode, EE_ACTIONS::toggleSyncedPinsMode.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ShowElectricalTypes, EE_ACTIONS::showElectricalTypes.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::PinLibrary, ACTIONS::pinLibrary.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::UnpinLibrary, ACTIONS::unpinLibrary.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ShowComponentTree, EE_ACTIONS::showComponentTree.MakeEvent() ); + Go( &SYMBOL_EDITOR_CONTROL::ToggleSyncedPinsMode, EE_ACTIONS::toggleSyncedPinsMode.MakeEvent() ); } diff --git a/eeschema/tools/lib_control.h b/eeschema/tools/symbol_editor_control.h similarity index 90% rename from eeschema/tools/lib_control.h rename to eeschema/tools/symbol_editor_control.h index 7118236934..2926aeb5f3 100644 --- a/eeschema/tools/lib_control.h +++ b/eeschema/tools/symbol_editor_control.h @@ -23,8 +23,8 @@ */ -#ifndef LIB_CONTROL_H -#define LIB_CONTROL_H +#ifndef SYMBOL_EDITOR_CONTROL_H +#define SYMBOL_EDITOR_CONTROL_H #include #include @@ -34,14 +34,14 @@ class SYMBOL_EDIT_FRAME; /** * Handle actions for the various symbol editor and viewers. */ -class LIB_CONTROL : public wxEvtHandler, public EE_TOOL_BASE +class SYMBOL_EDITOR_CONTROL : public wxEvtHandler, public EE_TOOL_BASE { public: - LIB_CONTROL() : + SYMBOL_EDITOR_CONTROL() : EE_TOOL_BASE( "eeschema.SymbolLibraryControl" ) { } - virtual ~LIB_CONTROL() { } + virtual ~SYMBOL_EDITOR_CONTROL() { } /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -75,4 +75,4 @@ private: }; -#endif // LIB_EDITOR_CONTROL_H +#endif // SYMBOL_EDITOR_CONTROL_H diff --git a/eeschema/tools/lib_drawing_tools.cpp b/eeschema/tools/symbol_editor_drawing_tools.cpp similarity index 89% rename from eeschema/tools/lib_drawing_tools.cpp rename to eeschema/tools/symbol_editor_drawing_tools.cpp index 4db742ee08..e18c144c42 100644 --- a/eeschema/tools/lib_drawing_tools.cpp +++ b/eeschema/tools/symbol_editor_drawing_tools.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -46,7 +46,7 @@ static void* g_lastPinWeakPtr; -LIB_DRAWING_TOOLS::LIB_DRAWING_TOOLS() : +SYMBOL_EDITOR_DRAWING_TOOLS::SYMBOL_EDITOR_DRAWING_TOOLS() : EE_TOOL_BASE( "eeschema.SymbolDrawing" ), m_lastTextAngle( 0.0 ), m_lastFillStyle( FILL_TYPE::NO_FILL ), @@ -56,7 +56,7 @@ LIB_DRAWING_TOOLS::LIB_DRAWING_TOOLS() : } -bool LIB_DRAWING_TOOLS::Init() +bool SYMBOL_EDITOR_DRAWING_TOOLS::Init() { EE_TOOL_BASE::Init(); @@ -73,14 +73,14 @@ bool LIB_DRAWING_TOOLS::Init() } -int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) { - KICAD_T type = aEvent.Parameter(); - auto* settings = Pgm().GetSettingsManager().GetAppSettings(); - LIB_PIN_TOOL* pinTool = type == LIB_PIN_T ? m_toolMgr->GetTool() : nullptr; - VECTOR2I cursorPos; - EDA_ITEM* item = nullptr; - bool isText = aEvent.IsAction( &EE_ACTIONS::placeSymbolText ); + KICAD_T type = aEvent.Parameter(); + auto* settings = Pgm().GetSettingsManager().GetAppSettings(); + auto* pinTool = type == LIB_PIN_T ? m_toolMgr->GetTool() : nullptr; + VECTOR2I cursorPos; + EDA_ITEM* item = nullptr; + bool isText = aEvent.IsAction( &EE_ACTIONS::placeSymbolText ); m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); getViewControls()->ShowCursor( true ); @@ -263,7 +263,7 @@ int LIB_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent ) } -int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) { SYMBOL_EDITOR_SETTINGS* settings = Pgm().GetSettingsManager().GetAppSettings(); KICAD_T type = aEvent.Parameter(); @@ -424,7 +424,7 @@ int LIB_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } -int LIB_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent ) { getViewControls()->ShowCursor( true ); @@ -491,9 +491,9 @@ int LIB_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent ) } -int LIB_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent ) { - LIB_PIN_TOOL* pinTool = m_toolMgr->GetTool(); + SYMBOL_EDITOR_PIN_TOOL* pinTool = m_toolMgr->GetTool(); LIB_PART* part = m_frame->GetCurPart(); LIB_PIN* sourcePin = nullptr; @@ -522,14 +522,14 @@ int LIB_DRAWING_TOOLS::RepeatDrawItem( const TOOL_EVENT& aEvent ) } -void LIB_DRAWING_TOOLS::setTransitions() +void SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions() { - Go( &LIB_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSymbolPin.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSymbolText.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolRectangle.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolCircle.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolArc.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolLines.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::PlaceAnchor, EE_ACTIONS::placeSymbolAnchor.MakeEvent() ); - Go( &LIB_DRAWING_TOOLS::RepeatDrawItem, EE_ACTIONS::repeatDrawItem.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSymbolPin.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace, EE_ACTIONS::placeSymbolText.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolRectangle.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolCircle.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolArc.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape, EE_ACTIONS::drawSymbolLines.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor, EE_ACTIONS::placeSymbolAnchor.MakeEvent() ); + Go( &SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem, EE_ACTIONS::repeatDrawItem.MakeEvent() ); } diff --git a/eeschema/tools/lib_drawing_tools.h b/eeschema/tools/symbol_editor_drawing_tools.h similarity index 86% rename from eeschema/tools/lib_drawing_tools.h rename to eeschema/tools/symbol_editor_drawing_tools.h index ef94a729ae..e786360dc4 100644 --- a/eeschema/tools/lib_drawing_tools.h +++ b/eeschema/tools/symbol_editor_drawing_tools.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef LIB_DRAWING_TOOLS_H -#define LIB_DRAWING_TOOLS_H +#ifndef SYMBOL_EDITOR_DRAWING_TOOLS_H +#define SYMBOL_EDITOR_DRAWING_TOOLS_H #include @@ -32,16 +32,16 @@ class SYMBOL_EDIT_FRAME; /** - * LIB_DRAWING_TOOLS + * SYMBOL_EDITOR_DRAWING_TOOLS * * Tool responsible for drawing/placing items (body outlines, pins, etc.) */ -class LIB_DRAWING_TOOLS : public EE_TOOL_BASE +class SYMBOL_EDITOR_DRAWING_TOOLS : public EE_TOOL_BASE { public: - LIB_DRAWING_TOOLS(); - ~LIB_DRAWING_TOOLS() override { } + SYMBOL_EDITOR_DRAWING_TOOLS(); + ~SYMBOL_EDITOR_DRAWING_TOOLS() override { } /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -62,9 +62,6 @@ public: bool GetDrawSpecificUnit() const { return m_drawSpecificUnit; } private: - int doTwoClickPlace( KICAD_T aType, bool aImmediateMode ); - - ///> Sets up handlers for various events. void setTransitions() override; private: @@ -74,4 +71,4 @@ private: bool m_drawSpecificUnit; }; -#endif /* LIB_DRAWING_TOOLS_H */ +#endif /* SYMBOL_EDITOR_DRAWING_TOOLS_H */ diff --git a/eeschema/tools/lib_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp similarity index 87% rename from eeschema/tools/lib_edit_tool.cpp rename to eeschema/tools/symbol_editor_edit_tool.cpp index 2542a399fb..40a95c27bb 100644 --- a/eeschema/tools/lib_edit_tool.cpp +++ b/eeschema/tools/symbol_editor_edit_tool.cpp @@ -25,13 +25,12 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include #include #include #include @@ -40,23 +39,23 @@ #include #include #include -#include "lib_edit_tool.h" +#include "symbol_editor_edit_tool.h" #include // for KiROUND -LIB_EDIT_TOOL::LIB_EDIT_TOOL() : +SYMBOL_EDITOR_EDIT_TOOL::SYMBOL_EDITOR_EDIT_TOOL() : EE_TOOL_BASE( "eeschema.SymbolEditTool" ), m_pickerItem( nullptr ) { } -bool LIB_EDIT_TOOL::Init() +bool SYMBOL_EDITOR_EDIT_TOOL::Init() { EE_TOOL_BASE::Init(); - LIB_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool(); - LIB_MOVE_TOOL* moveTool = m_toolMgr->GetTool(); + SYMBOL_EDITOR_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool(); + SYMBOL_EDITOR_MOVE_TOOL* moveTool = m_toolMgr->GetTool(); wxASSERT_MSG( drawingTools, "eeschema.SymbolDrawing tool is not available" ); @@ -127,7 +126,7 @@ bool LIB_EDIT_TOOL::Init() } -int LIB_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) { EE_SELECTION& selection = m_selectionTool->RequestSelection(); @@ -171,7 +170,7 @@ int LIB_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) { EE_SELECTION& selection = m_selectionTool->RequestSelection(); @@ -234,7 +233,7 @@ static KICAD_T nonFields[] = }; -int LIB_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent ) { LIB_PART* part = m_frame->GetCurPart(); auto items = m_selectionTool->RequestSelection( nonFields ).GetItems(); @@ -298,7 +297,7 @@ int LIB_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent ) #define HITTEST_THRESHOLD_PIXELS 5 -int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) { std::string tool = aEvent.GetCommandStr().get(); PICKER_TOOL* picker = m_toolMgr->GetTool(); @@ -376,7 +375,7 @@ int LIB_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { EE_SELECTION& selection = m_selectionTool->RequestSelection(); @@ -397,7 +396,7 @@ int LIB_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { case LIB_PIN_T: { - LIB_PIN_TOOL* pinTool = m_toolMgr->GetTool(); + SYMBOL_EDITOR_PIN_TOOL* pinTool = m_toolMgr->GetTool(); if( pinTool ) pinTool->EditPinProperties( (LIB_PIN*) item ); @@ -431,7 +430,7 @@ int LIB_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) } -void LIB_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem ) +void SYMBOL_EDITOR_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem ) { if( aItem == NULL ) return; @@ -460,7 +459,7 @@ void LIB_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem ) m_frame->GetCanvas()->Refresh(); m_frame->OnModify( ); - LIB_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool(); + SYMBOL_EDITOR_DRAWING_TOOLS* drawingTools = m_toolMgr->GetTool(); drawingTools->SetDrawSpecificConvert( !dialog.GetApplyToAllConversions() ); drawingTools->SetDrawSpecificUnit( !dialog.GetApplyToAllUnits() ); @@ -470,7 +469,7 @@ void LIB_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem ) } -void LIB_EDIT_TOOL::editTextProperties( LIB_ITEM* aItem ) +void SYMBOL_EDITOR_EDIT_TOOL::editTextProperties( LIB_ITEM* aItem ) { if ( ( aItem == NULL ) || ( aItem->Type() != LIB_TEXT_T ) ) return; @@ -486,7 +485,7 @@ void LIB_EDIT_TOOL::editTextProperties( LIB_ITEM* aItem ) } -void LIB_EDIT_TOOL::editFieldProperties( LIB_FIELD* aField ) +void SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties( LIB_FIELD* aField ) { if( aField == NULL ) return; @@ -535,7 +534,7 @@ void LIB_EDIT_TOOL::editFieldProperties( LIB_FIELD* aField ) } -void LIB_EDIT_TOOL::editSymbolProperties() +void SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties() { LIB_PART* part = m_frame->GetCurPart(); bool partLocked = part->UnitsLocked(); @@ -559,7 +558,7 @@ void LIB_EDIT_TOOL::editSymbolProperties() // to the best value if( partLocked != part->UnitsLocked() ) { - LIB_DRAWING_TOOLS* tools = m_toolMgr->GetTool(); + SYMBOL_EDITOR_DRAWING_TOOLS* tools = m_toolMgr->GetTool(); // Enable synchronized pin edit mode for symbols with interchangeable units m_frame->m_SyncPinEdit = !part->UnitsLocked(); @@ -572,7 +571,7 @@ void LIB_EDIT_TOOL::editSymbolProperties() } -int LIB_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent ) { LIB_PART* part = m_frame->GetCurPart(); @@ -595,7 +594,7 @@ int LIB_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent ) { m_frame->GetSymbolFromUndoList(); @@ -606,7 +605,7 @@ int LIB_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent ) { m_frame->GetSymbolFromRedoList(); @@ -617,7 +616,7 @@ int LIB_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Cut( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Cut( const TOOL_EVENT& aEvent ) { int retVal = Copy( aEvent ); @@ -628,7 +627,7 @@ int LIB_EDIT_TOOL::Cut( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent ) { LIB_PART* part = m_frame->GetCurPart(); EE_SELECTION& selection = m_selectionTool->RequestSelection( nonFields ); @@ -664,7 +663,7 @@ int LIB_EDIT_TOOL::Copy( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) { LIB_PART* part = m_frame->GetCurPart(); @@ -729,7 +728,7 @@ int LIB_EDIT_TOOL::Paste( const TOOL_EVENT& aEvent ) } -int LIB_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) { LIB_PART* part = m_frame->GetCurPart(); EE_SELECTION& selection = m_selectionTool->RequestSelection( nonFields ); @@ -770,23 +769,23 @@ int LIB_EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) } -void LIB_EDIT_TOOL::setTransitions() +void SYMBOL_EDITOR_EDIT_TOOL::setTransitions() { - Go( &LIB_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Cut, ACTIONS::cut.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Copy, ACTIONS::copy.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Duplicate, ACTIONS::duplicate.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Undo, ACTIONS::undo.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Redo, ACTIONS::redo.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Cut, ACTIONS::cut.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Copy, ACTIONS::copy.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Paste, ACTIONS::paste.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Duplicate, ACTIONS::duplicate.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCW.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() ); - Go( &LIB_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() ); - Go( &LIB_EDIT_TOOL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCW.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Rotate, EE_ACTIONS::rotateCCW.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorX.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Mirror, EE_ACTIONS::mirrorY.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::DoDelete, ACTIONS::doDelete.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() ); - Go( &LIB_EDIT_TOOL::Properties, EE_ACTIONS::symbolProperties.MakeEvent() ); - Go( &LIB_EDIT_TOOL::PinTable, EE_ACTIONS::pinTable.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Properties, EE_ACTIONS::properties.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::Properties, EE_ACTIONS::symbolProperties.MakeEvent() ); + Go( &SYMBOL_EDITOR_EDIT_TOOL::PinTable, EE_ACTIONS::pinTable.MakeEvent() ); } diff --git a/eeschema/tools/lib_edit_tool.h b/eeschema/tools/symbol_editor_edit_tool.h similarity index 89% rename from eeschema/tools/lib_edit_tool.h rename to eeschema/tools/symbol_editor_edit_tool.h index ea3b626cab..d0de298b5f 100644 --- a/eeschema/tools/lib_edit_tool.h +++ b/eeschema/tools/symbol_editor_edit_tool.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef KICAD_LIB_EDIT_TOOL_H -#define KICAD_LIB_EDIT_TOOL_H +#ifndef SYMBOL_EDITOR_EDIT_TOOL_H +#define SYMBOL_EDITOR_EDIT_TOOL_H #include @@ -31,11 +31,11 @@ class SYMBOL_EDIT_FRAME; -class LIB_EDIT_TOOL : public EE_TOOL_BASE +class SYMBOL_EDITOR_EDIT_TOOL : public EE_TOOL_BASE { public: - LIB_EDIT_TOOL(); - ~LIB_EDIT_TOOL() override { } + SYMBOL_EDITOR_EDIT_TOOL(); + ~SYMBOL_EDITOR_EDIT_TOOL() override { } /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -77,4 +77,4 @@ private: EDA_ITEM* m_pickerItem; }; -#endif //KICAD_LIB_EDIT_TOOL_H +#endif // SYMBOL_EDITOR_EDIT_TOOL_H diff --git a/eeschema/tools/lib_move_tool.cpp b/eeschema/tools/symbol_editor_move_tool.cpp similarity index 93% rename from eeschema/tools/lib_move_tool.cpp rename to eeschema/tools/symbol_editor_move_tool.cpp index ab482c18e7..68b05cabec 100644 --- a/eeschema/tools/lib_move_tool.cpp +++ b/eeschema/tools/symbol_editor_move_tool.cpp @@ -27,11 +27,11 @@ #include #include #include -#include "lib_move_tool.h" -#include "lib_pin_tool.h" +#include "symbol_editor_move_tool.h" +#include "symbol_editor_pin_tool.h" -LIB_MOVE_TOOL::LIB_MOVE_TOOL() : +SYMBOL_EDITOR_MOVE_TOOL::SYMBOL_EDITOR_MOVE_TOOL() : EE_TOOL_BASE( "eeschema.SymbolMoveTool" ), m_moveInProgress( false ), m_moveOffset( 0, 0 ) @@ -39,7 +39,7 @@ LIB_MOVE_TOOL::LIB_MOVE_TOOL() : } -bool LIB_MOVE_TOOL::Init() +bool SYMBOL_EDITOR_MOVE_TOOL::Init() { EE_TOOL_BASE::Init(); @@ -54,7 +54,7 @@ bool LIB_MOVE_TOOL::Init() } -void LIB_MOVE_TOOL::Reset( RESET_REASON aReason ) +void SYMBOL_EDITOR_MOVE_TOOL::Reset( RESET_REASON aReason ) { EE_TOOL_BASE::Reset( aReason ); @@ -66,7 +66,7 @@ void LIB_MOVE_TOOL::Reset( RESET_REASON aReason ) } -int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) { KIGFX::VIEW_CONTROLS* controls = getViewControls(); @@ -258,7 +258,7 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) { if( selection.GetSize() == 1 && selection.Front()->Type() == LIB_PIN_T ) { - LIB_PIN_TOOL* pinTool = m_toolMgr->GetTool(); + SYMBOL_EDITOR_PIN_TOOL* pinTool = m_toolMgr->GetTool(); if( !pinTool->PlacePin( (LIB_PIN*) selection.Front() ) ) restore_state = true; @@ -308,15 +308,15 @@ int LIB_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) } -void LIB_MOVE_TOOL::moveItem( EDA_ITEM* aItem, VECTOR2I aDelta ) +void SYMBOL_EDITOR_MOVE_TOOL::moveItem( EDA_ITEM* aItem, VECTOR2I aDelta ) { static_cast( aItem )->Offset( mapCoords( aDelta ) ); aItem->SetFlags( IS_MOVED ); } -void LIB_MOVE_TOOL::setTransitions() +void SYMBOL_EDITOR_MOVE_TOOL::setTransitions() { - Go( &LIB_MOVE_TOOL::Main, EE_ACTIONS::move.MakeEvent() ); - Go( &LIB_MOVE_TOOL::Main, EE_ACTIONS::symbolMoveActivate.MakeEvent() ); + Go( &SYMBOL_EDITOR_MOVE_TOOL::Main, EE_ACTIONS::move.MakeEvent() ); + Go( &SYMBOL_EDITOR_MOVE_TOOL::Main, EE_ACTIONS::symbolMoveActivate.MakeEvent() ); } diff --git a/eeschema/tools/lib_move_tool.h b/eeschema/tools/symbol_editor_move_tool.h similarity index 83% rename from eeschema/tools/lib_move_tool.h rename to eeschema/tools/symbol_editor_move_tool.h index a645c6c91a..e55fa22380 100644 --- a/eeschema/tools/lib_move_tool.h +++ b/eeschema/tools/symbol_editor_move_tool.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef KICAD_LIB_MOVE_TOOL_H -#define KICAD_LIB_MOVE_TOOL_H +#ifndef SYMBOL_EDITOR_MOVE_TOOL_H +#define SYMBOL_EDITOR_MOVE_TOOL_H #include #include @@ -32,11 +32,11 @@ class SYMBOL_EDIT_FRAME; class EE_SELECTION_TOOL; -class LIB_MOVE_TOOL : public EE_TOOL_BASE +class SYMBOL_EDITOR_MOVE_TOOL : public EE_TOOL_BASE { public: - LIB_MOVE_TOOL(); - ~LIB_MOVE_TOOL() override { } + SYMBOL_EDITOR_MOVE_TOOL(); + ~SYMBOL_EDITOR_MOVE_TOOL() override { } /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -59,15 +59,15 @@ private: private: ///> Flag determining if anything is being dragged right now - bool m_moveInProgress; + bool m_moveInProgress; ///> Used for chaining commands - VECTOR2I m_moveOffset; + VECTOR2I m_moveOffset; ///> Last cursor position (needed for getModificationPoint() to avoid changes ///> of edit reference point). - VECTOR2I m_cursor; - VECTOR2I m_anchorPos; + VECTOR2I m_cursor; + VECTOR2I m_anchorPos; }; -#endif //KICAD_LIB_MOVE_TOOL_H +#endif // SYMBOL_EDITOR_MOVE_TOOL_H diff --git a/eeschema/tools/lib_pin_tool.cpp b/eeschema/tools/symbol_editor_pin_tool.cpp similarity index 93% rename from eeschema/tools/lib_pin_tool.cpp rename to eeschema/tools/symbol_editor_pin_tool.cpp index 71465baf0a..706692812a 100644 --- a/eeschema/tools/lib_pin_tool.cpp +++ b/eeschema/tools/symbol_editor_pin_tool.cpp @@ -31,7 +31,7 @@ #include #include #include -#include "lib_pin_tool.h" +#include "symbol_editor_pin_tool.h" static ELECTRICAL_PINTYPE g_LastPinType = ELECTRICAL_PINTYPE::PT_INPUT; @@ -83,13 +83,13 @@ static int GetLastPinNumSize() extern bool IncrementLabelMember( wxString& name, int aIncrement ); -LIB_PIN_TOOL::LIB_PIN_TOOL() : +SYMBOL_EDITOR_PIN_TOOL::SYMBOL_EDITOR_PIN_TOOL() : EE_TOOL_BASE( "eeschema.PinEditing" ) { } -bool LIB_PIN_TOOL::Init() +bool SYMBOL_EDITOR_PIN_TOOL::Init() { EE_TOOL_BASE::Init(); @@ -106,7 +106,7 @@ bool LIB_PIN_TOOL::Init() } -bool LIB_PIN_TOOL::EditPinProperties( LIB_PIN* aPin ) +bool SYMBOL_EDITOR_PIN_TOOL::EditPinProperties( LIB_PIN* aPin ) { DIALOG_PIN_PROPERTIES dlg( m_frame, aPin ); @@ -188,7 +188,7 @@ bool LIB_PIN_TOOL::EditPinProperties( LIB_PIN* aPin ) } -bool LIB_PIN_TOOL::PlacePin( LIB_PIN* aPin ) +bool SYMBOL_EDITOR_PIN_TOOL::PlacePin( LIB_PIN* aPin ) { LIB_PART* part = m_frame->GetCurPart(); bool ask_for_pin = true; // Test for another pin in same position in other units @@ -261,7 +261,7 @@ bool LIB_PIN_TOOL::PlacePin( LIB_PIN* aPin ) /* * Create a new pin. */ -LIB_PIN* LIB_PIN_TOOL::CreatePin( const VECTOR2I& aPosition, LIB_PART* aPart ) +LIB_PIN* SYMBOL_EDITOR_PIN_TOOL::CreatePin( const VECTOR2I& aPosition, LIB_PART* aPart ) { aPart->ClearTempFlags(); @@ -294,7 +294,7 @@ LIB_PIN* LIB_PIN_TOOL::CreatePin( const VECTOR2I& aPosition, LIB_PART* aPart ) } -void LIB_PIN_TOOL::CreateImagePins( LIB_PIN* aPin ) +void SYMBOL_EDITOR_PIN_TOOL::CreateImagePins( LIB_PIN* aPin ) { int ii; LIB_PIN* newPin; @@ -333,7 +333,7 @@ void LIB_PIN_TOOL::CreateImagePins( LIB_PIN* aPin ) } -int LIB_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent ) +int SYMBOL_EDITOR_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent ) { LIB_PART* part = m_frame->GetCurPart(); EE_SELECTION& selection = m_selectionTool->GetSelection(); @@ -372,7 +372,7 @@ int LIB_PIN_TOOL::PushPinProperties( const TOOL_EVENT& aEvent ) // Create a new pin based on the previous pin with an incremented pin number. -LIB_PIN* LIB_PIN_TOOL::RepeatPin( const LIB_PIN* aSourcePin ) +LIB_PIN* SYMBOL_EDITOR_PIN_TOOL::RepeatPin( const LIB_PIN* aSourcePin ) { LIB_PIN* pin = (LIB_PIN*) aSourcePin->Clone(); wxPoint step; @@ -410,10 +410,10 @@ LIB_PIN* LIB_PIN_TOOL::RepeatPin( const LIB_PIN* aSourcePin ) } -void LIB_PIN_TOOL::setTransitions() +void SYMBOL_EDITOR_PIN_TOOL::setTransitions() { - Go( &LIB_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinLength.MakeEvent() ); - Go( &LIB_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNameSize.MakeEvent() ); - Go( &LIB_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNumSize.MakeEvent() ); + Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinLength.MakeEvent() ); + Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNameSize.MakeEvent() ); + Go( &SYMBOL_EDITOR_PIN_TOOL::PushPinProperties, EE_ACTIONS::pushPinNumSize.MakeEvent() ); } diff --git a/eeschema/tools/lib_pin_tool.h b/eeschema/tools/symbol_editor_pin_tool.h similarity index 87% rename from eeschema/tools/lib_pin_tool.h rename to eeschema/tools/symbol_editor_pin_tool.h index 0a94c3a226..453f7c0f0d 100644 --- a/eeschema/tools/lib_pin_tool.h +++ b/eeschema/tools/symbol_editor_pin_tool.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef KICAD_LIB_PIN_TOOL_H -#define KICAD_LIB_PIN_TOOL_H +#ifndef SYMBOL_EDITOR_PIN_TOOL_H +#define SYMBOL_EDITOR_PIN_TOOL_H #include #include @@ -32,11 +32,11 @@ class SYMBOL_EDIT_FRAME; -class LIB_PIN_TOOL : public EE_TOOL_BASE +class SYMBOL_EDITOR_PIN_TOOL : public EE_TOOL_BASE { public: - LIB_PIN_TOOL(); - ~LIB_PIN_TOOL() override { } + SYMBOL_EDITOR_PIN_TOOL(); + ~SYMBOL_EDITOR_PIN_TOOL() override { } /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -55,4 +55,4 @@ private: void setTransitions() override; }; -#endif //KICAD_LIB_PIN_TOOL_H +#endif // SYMBOL_EDITOR_PIN_TOOL_H