Loading common/tool/action_manager.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -60,8 +60,6 @@ void ACTION_MANAGER::RegisterAction( TOOL_ACTION* aAction ) m_actionHotKeys[aAction->m_currentHotKey] = aAction; } aAction->setActionMgr( this ); } Loading @@ -71,7 +69,6 @@ void ACTION_MANAGER::UnregisterAction( TOOL_ACTION* aAction ) m_actionIdIndex.erase( aAction->m_id ); // Indicate that the ACTION_MANAGER no longer care about the object aAction->setActionMgr( NULL ); aAction->setId( -1 ); if( aAction->HasHotKey() ) Loading include/tool/tool_action.h +4 −13 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ #include <cassert> #include <tool/tool_base.h> #include <tool/action_manager.h> #include <tool/tool_manager.h> /** * Class TOOL_ACTION Loading @@ -50,14 +50,14 @@ public: const std::string& aMenuDesc = std::string( "" ) ) : m_name( aName ), m_scope( aScope ), m_defaultHotKey( aDefaultHotKey ), m_currentHotKey( aDefaultHotKey ), m_menuItem( aMenuItem ), m_menuDescription( aMenuDesc ), m_id( -1 ), m_actionMgr( NULL ) m_menuDescription( aMenuDesc ), m_id( -1 ) { TOOL_MANAGER::Instance().RegisterAction( this ); } ~TOOL_ACTION() { if( m_actionMgr ) m_actionMgr->UnregisterAction( this ); TOOL_MANAGER::Instance().UnregisterAction( this ); } bool operator==( const TOOL_ACTION& aRhs ) const Loading Loading @@ -180,12 +180,6 @@ private: m_id = aId; } /// Assigns ACTION_MANAGER object that handles the TOOL_ACTION. void setActionMgr( ACTION_MANAGER* aManager ) { m_actionMgr = aManager; } /// Name of the action (convention is: app.[tool.]action.name) std::string m_name; Loading @@ -210,9 +204,6 @@ private: /// Unique ID for fast matching. Assigned by ACTION_MANAGER. int m_id; /// Action manager that handles this TOOL_ACTION. ACTION_MANAGER* m_actionMgr; /// Origin of the action // const TOOL_BASE* m_origin; Loading include/tool/tool_manager.h +9 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,13 @@ class wxWindow; class TOOL_MANAGER { public: TOOL_MANAGER(); static TOOL_MANAGER& Instance() { static TOOL_MANAGER manager; return manager; } ~TOOL_MANAGER(); /** Loading Loading @@ -211,6 +217,8 @@ public: } private: TOOL_MANAGER(); struct TOOL_STATE; typedef std::pair<TOOL_EVENT_LIST, TOOL_STATE_FUNC> TRANSITION; Loading include/wxBasePcbFrame.h +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ protected: /// main window. wxAuiToolBar* m_auxiliaryToolBar; TOOL_MANAGER* m_toolManager; TOOL_MANAGER& m_toolManager; TOOL_DISPATCHER* m_toolDispatcher; void updateGridSelectBox(); Loading pcbnew/basepcbframe.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -131,10 +131,10 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* aParent, ID_DRAWFRAME_TYPE aFrameType, const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize, long aStyle, const wxString & aFrameName) : EDA_DRAW_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ) EDA_DRAW_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ), m_toolManager( TOOL_MANAGER::Instance() ) { m_Pcb = NULL; m_toolManager = NULL; m_toolDispatcher = NULL; m_DisplayPadFill = true; // How to draw pads Loading Loading
common/tool/action_manager.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -60,8 +60,6 @@ void ACTION_MANAGER::RegisterAction( TOOL_ACTION* aAction ) m_actionHotKeys[aAction->m_currentHotKey] = aAction; } aAction->setActionMgr( this ); } Loading @@ -71,7 +69,6 @@ void ACTION_MANAGER::UnregisterAction( TOOL_ACTION* aAction ) m_actionIdIndex.erase( aAction->m_id ); // Indicate that the ACTION_MANAGER no longer care about the object aAction->setActionMgr( NULL ); aAction->setId( -1 ); if( aAction->HasHotKey() ) Loading
include/tool/tool_action.h +4 −13 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ #include <cassert> #include <tool/tool_base.h> #include <tool/action_manager.h> #include <tool/tool_manager.h> /** * Class TOOL_ACTION Loading @@ -50,14 +50,14 @@ public: const std::string& aMenuDesc = std::string( "" ) ) : m_name( aName ), m_scope( aScope ), m_defaultHotKey( aDefaultHotKey ), m_currentHotKey( aDefaultHotKey ), m_menuItem( aMenuItem ), m_menuDescription( aMenuDesc ), m_id( -1 ), m_actionMgr( NULL ) m_menuDescription( aMenuDesc ), m_id( -1 ) { TOOL_MANAGER::Instance().RegisterAction( this ); } ~TOOL_ACTION() { if( m_actionMgr ) m_actionMgr->UnregisterAction( this ); TOOL_MANAGER::Instance().UnregisterAction( this ); } bool operator==( const TOOL_ACTION& aRhs ) const Loading Loading @@ -180,12 +180,6 @@ private: m_id = aId; } /// Assigns ACTION_MANAGER object that handles the TOOL_ACTION. void setActionMgr( ACTION_MANAGER* aManager ) { m_actionMgr = aManager; } /// Name of the action (convention is: app.[tool.]action.name) std::string m_name; Loading @@ -210,9 +204,6 @@ private: /// Unique ID for fast matching. Assigned by ACTION_MANAGER. int m_id; /// Action manager that handles this TOOL_ACTION. ACTION_MANAGER* m_actionMgr; /// Origin of the action // const TOOL_BASE* m_origin; Loading
include/tool/tool_manager.h +9 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,13 @@ class wxWindow; class TOOL_MANAGER { public: TOOL_MANAGER(); static TOOL_MANAGER& Instance() { static TOOL_MANAGER manager; return manager; } ~TOOL_MANAGER(); /** Loading Loading @@ -211,6 +217,8 @@ public: } private: TOOL_MANAGER(); struct TOOL_STATE; typedef std::pair<TOOL_EVENT_LIST, TOOL_STATE_FUNC> TRANSITION; Loading
include/wxBasePcbFrame.h +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ protected: /// main window. wxAuiToolBar* m_auxiliaryToolBar; TOOL_MANAGER* m_toolManager; TOOL_MANAGER& m_toolManager; TOOL_DISPATCHER* m_toolDispatcher; void updateGridSelectBox(); Loading
pcbnew/basepcbframe.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -131,10 +131,10 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( wxWindow* aParent, ID_DRAWFRAME_TYPE aFrameType, const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize, long aStyle, const wxString & aFrameName) : EDA_DRAW_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ) EDA_DRAW_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ), m_toolManager( TOOL_MANAGER::Instance() ) { m_Pcb = NULL; m_toolManager = NULL; m_toolDispatcher = NULL; m_DisplayPadFill = true; // How to draw pads Loading