![]() |
KiCad PCB EDA Suite
|
Master controller class: More...
#include <tool_manager.h>
Classes | |
struct | TOOL_STATE |
Struct describing the current execution state of a TOOL. More... | |
Public Types | |
typedef std::map< TOOL_BASE *, TOOL_STATE * > | TOOL_STATE_MAP |
typedef std::map< std::string, TOOL_STATE * > | NAME_STATE_MAP |
typedef std::map< TOOL_ID, TOOL_STATE * > | ID_STATE_MAP |
typedef std::list< TOOL_ID > | ID_LIST |
typedef std::vector< TOOL_BASE * > | TOOL_VEC |
Public Member Functions | |
TOOL_MANAGER () | |
~TOOL_MANAGER () | |
void | RegisterTool (TOOL_BASE *aTool) |
Add a tool to the manager set and sets it up. More... | |
bool | InvokeTool (TOOL_ID aToolId) |
Call a tool by sending a tool activation event to tool of given ID. More... | |
bool | InvokeTool (const std::string &aToolName) |
Call a tool by sending a tool activation event to tool of given name. More... | |
void | ShutdownAllTools () |
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with a null event. More... | |
void | ShutdownTool (TOOL_BASE *aTool) |
Shutdown the specified tool by waking it up with a null event to terminate the processing loop. More... | |
void | ShutdownTool (TOOL_ID aToolId) |
Shutdown the specified tool by waking it up with a null event to terminate the processing loop. More... | |
void | ShutdownTool (const std::string &aToolName) |
Shutdown the specified tool by waking it up with a null event to terminate the processing loop. More... | |
template<typename T > | |
bool | RunAction (const std::string &aActionName, bool aNow=false, T aParam=NULL) |
Run the specified action. More... | |
bool | RunAction (const std::string &aActionName, bool aNow, void *aParam) |
bool | RunAction (const std::string &aActionName, bool aNow=false) |
template<typename T > | |
bool | RunAction (const TOOL_ACTION &aAction, bool aNow=false, T aParam=NULL) |
Run the specified action. More... | |
bool | RunAction (const TOOL_ACTION &aAction, bool aNow, void *aParam) |
bool | RunAction (const TOOL_ACTION &aAction, bool aNow=false) |
const std::map< std::string, TOOL_ACTION * > & | GetActions () |
void | CancelTool () |
Send a cancel event to the tool currently at the top of the tool stack. More... | |
void | PrimeTool (const VECTOR2D &aPosition) |
"Prime" a tool by sending a cursor left-click event with the mouse position set to the passed in position. More... | |
int | GetHotKey (const TOOL_ACTION &aAction) |
ACTION_MANAGER * | GetActionManager () |
TOOL_BASE * | FindTool (int aId) const |
Search for a tool with given ID. More... | |
TOOL_BASE * | FindTool (const std::string &aName) const |
Search for a tool with given name. More... | |
template<typename T > | |
T * | GetTool () |
void | DeactivateTool () |
Deactivate the currently active tool. More... | |
bool | IsToolActive (TOOL_ID aId) const |
Return true if a tool with given id is active (executing) More... | |
void | ResetTools (TOOL_BASE::RESET_REASON aReason) |
Reset all tools (i.e. More... | |
void | InitTools () |
Initializes all registered tools. More... | |
bool | ProcessEvent (const TOOL_EVENT &aEvent) |
Propagate an event to tools that requested events of matching type(s). More... | |
void | PostEvent (const TOOL_EVENT &aEvent) |
Put an event to the event queue to be processed at the end of event processing cycle. More... | |
void | SetEnvironment (EDA_ITEM *aModel, KIGFX::VIEW *aView, KIGFX::VIEW_CONTROLS *aViewControls, APP_SETTINGS_BASE *aSettings, TOOLS_HOLDER *aFrame) |
Set the work environment (model, view, view controls and the parent window). More... | |
KIGFX::VIEW * | GetView () const |
KIGFX::VIEW_CONTROLS * | GetViewControls () const |
VECTOR2D | GetMousePosition () |
VECTOR2D | GetCursorPosition () |
EDA_ITEM * | GetModel () const |
APP_SETTINGS_BASE * | GetSettings () const |
TOOLS_HOLDER * | GetToolHolder () const |
int | GetCurrentToolId () const |
Return id of the tool that is on the top of the active tools stack (was invoked the most recently). More... | |
TOOL_BASE * | GetCurrentTool () const |
Return the tool that is on the top of the active tools stack (was invoked the most recently). More... | |
TOOL_STATE * | GetCurrentToolState () const |
Return the #TOOL_STATE object representing the state of the active tool. More... | |
int | GetPriority (int aToolId) const |
Return priority of a given tool. More... | |
void | ScheduleNextState (TOOL_BASE *aTool, TOOL_STATE_FUNC &aHandler, const TOOL_EVENT_LIST &aConditions) |
Define a state transition. More... | |
void | ClearTransitions (TOOL_BASE *aTool) |
Clear the state transition map for a tool. More... | |
void | RunMainStack (TOOL_BASE *aTool, std::function< void()> aFunc) |
void | UpdateUI (const TOOL_EVENT &aEvent) |
Update the status bar and synchronizes toolbars. More... | |
TOOL_EVENT * | ScheduleWait (TOOL_BASE *aTool, const TOOL_EVENT_LIST &aConditions) |
Pause execution of a given tool until one or more events matching aConditions arrives. More... | |
void | ScheduleContextMenu (TOOL_BASE *aTool, ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger) |
Set behavior of the tool's context popup menu. More... | |
bool | SaveClipboard (const std::string &aTextUTF8) |
Store information to the system clipboard. More... | |
std::string | GetClipboardUTF8 () const |
Return the information currently stored in the system clipboard. More... | |
const KIGFX::VC_SETTINGS & | GetCurrentToolVC () const |
Return the view controls settings for the current tool or the general settings if there is no active tool. More... | |
bool | IsContextMenuActive () |
True while processing a context menu. More... | |
void | VetoContextMenuMouseWarp () |
Disable mouse warping after the current context menu is closed. More... | |
void | DispatchContextMenu (const TOOL_EVENT &aEvent) |
Handle context menu related events. More... | |
bool | DispatchHotKey (const TOOL_EVENT &aEvent) |
Handle specific events, that are intended for TOOL_MANAGER rather than tools. More... | |
VECTOR2D | GetMenuCursorPos () |
Static Public Member Functions | |
static TOOL_ID | MakeToolId (const std::string &aToolName) |
Generates a unique ID from for a tool with given name. More... | |
Private Types | |
typedef std::pair< TOOL_EVENT_LIST, TOOL_STATE_FUNC > | TRANSITION |
Private Member Functions | |
bool | dispatchInternal (const TOOL_EVENT &aEvent) |
Passe an event at first to the active tools, then to all others. More... | |
bool | dispatchActivation (const TOOL_EVENT &aEvent) |
Check if it is a valid activation event and invokes a proper tool. More... | |
bool | invokeTool (TOOL_BASE *aTool) |
Invoke a tool by sending a proper event (in contrary to runTool, which makes the tool run for real). More... | |
bool | runTool (TOOL_BASE *aTool) |
Make a tool active, so it can receive events and react to them. More... | |
ID_LIST::iterator | finishTool (TOOL_STATE *aState) |
Deactivate a tool and does the necessary clean up. More... | |
bool | isRegistered (TOOL_BASE *aTool) const |
Return information about a tool registration status. More... | |
bool | isActive (TOOL_BASE *aTool) |
Return information about a tool activation status. More... | |
void | saveViewControls (TOOL_STATE *aState) |
Save the #VIEW_CONTROLS settings to the tool state object. More... | |
void | applyViewControls (TOOL_STATE *aState) |
Apply #VIEW_CONTROLS settings stored in a #TOOL_STATE object. More... | |
bool | processEvent (const TOOL_EVENT &aEvent) |
Main function for event processing. More... | |
void | setActiveState (TOOL_STATE *aState) |
Save the previous active state and sets a new one. More... | |
Private Attributes | |
TOOL_VEC | m_toolOrder |
Index of registered tools current states, associated by tools' objects. More... | |
TOOL_STATE_MAP | m_toolState |
Index of the registered tools current states, associated by tools' names. More... | |
NAME_STATE_MAP | m_toolNameIndex |
Index of the registered tools current states, associated by tools' ID numbers. More... | |
ID_STATE_MAP | m_toolIdIndex |
Index of the registered tools to easily lookup by their type. More... | |
std::map< const char *, TOOL_BASE * > | m_toolTypes |
Stack of the active tools. More... | |
ID_LIST | m_activeTools |
Instance of ACTION_MANAGER that handles TOOL_ACTIONs. More... | |
ACTION_MANAGER * | m_actionMgr |
Original cursor position, if overridden by the context menu handler. More... | |
std::map< TOOL_ID, OPT< VECTOR2D > > | m_cursorSettings |
EDA_ITEM * | m_model |
KIGFX::VIEW * | m_view |
KIGFX::VIEW_CONTROLS * | m_viewControls |
TOOLS_HOLDER * | m_frame |
APP_SETTINGS_BASE * | m_settings |
Queue that stores events to be processed at the end of the event processing cycle. More... | |
std::list< TOOL_EVENT > | m_eventQueue |
Right click context menu position. More... | |
VECTOR2D | m_menuCursor |
bool | m_warpMouseAfterContextMenu |
Flag indicating whether a context menu is currently displayed. More... | |
bool | m_menuActive |
Tool currently displaying a popup menu. It is negative when there is no menu displayed. More... | |
TOOL_ID | m_menuOwner |
Pointer to the state object corresponding to the currently executed tool. More... | |
TOOL_STATE * | m_activeState |
Master controller class:
Definition at line 52 of file tool_manager.h.
typedef std::list<TOOL_ID> TOOL_MANAGER::ID_LIST |
Definition at line 66 of file tool_manager.h.
typedef std::map<TOOL_ID, TOOL_STATE*> TOOL_MANAGER::ID_STATE_MAP |
Definition at line 65 of file tool_manager.h.
typedef std::map<std::string, TOOL_STATE*> TOOL_MANAGER::NAME_STATE_MAP |
Definition at line 64 of file tool_manager.h.
typedef std::map<TOOL_BASE*, TOOL_STATE*> TOOL_MANAGER::TOOL_STATE_MAP |
Definition at line 63 of file tool_manager.h.
typedef std::vector<TOOL_BASE*> TOOL_MANAGER::TOOL_VEC |
Definition at line 67 of file tool_manager.h.
|
private |
Definition at line 452 of file tool_manager.h.
TOOL_MANAGER::TOOL_MANAGER | ( | ) |
Definition at line 200 of file tool_manager.cpp.
References m_actionMgr.
TOOL_MANAGER::~TOOL_MANAGER | ( | ) |
Definition at line 215 of file tool_manager.cpp.
References m_actionMgr, and m_toolState.
|
private |
Apply #VIEW_CONTROLS settings stored in a #TOOL_STATE object.
Definition at line 1093 of file tool_manager.cpp.
References KIGFX::VIEW_CONTROLS::ApplySettings(), m_viewControls, and TOOL_MANAGER::TOOL_STATE::vcSettings.
Referenced by setActiveState().
void TOOL_MANAGER::CancelTool | ( | ) |
Send a cancel event to the tool currently at the top of the tool stack.
Definition at line 342 of file tool_manager.cpp.
References processEvent(), TA_CANCEL_TOOL, and TC_COMMAND.
Referenced by ACTION_TOOLBAR::onToolEvent().
void TOOL_MANAGER::ClearTransitions | ( | TOOL_BASE * | aTool | ) |
Clear the state transition map for a tool.
aTool | is the tool that should have the transition map cleared. |
Definition at line 611 of file tool_manager.cpp.
References m_toolState.
Referenced by TOOL_INTERACTIVE::resetTransitions().
void TOOL_MANAGER::DeactivateTool | ( | ) |
Deactivate the currently active tool.
Definition at line 529 of file tool_manager.cpp.
References processEvent(), TA_CANCEL_TOOL, and TC_COMMAND.
Referenced by GERBVIEW_FRAME::doCloseWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), ResetTools(), and FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME().
|
private |
Check if it is a valid activation event and invokes a proper tool.
aEvent | is an event to be tested. |
Definition at line 788 of file tool_manager.cpp.
References TOOL_EVENT::Format(), TOOL_EVENT::GetCommandStr(), TOOL_EVENT::IsActivate(), kicadTraceToolStack, m_toolNameIndex, and runTool().
Referenced by processEvent().
void TOOL_MANAGER::DispatchContextMenu | ( | const TOOL_EVENT & | aEvent | ) |
Handle context menu related events.
Definition at line 813 of file tool_manager.cpp.
References BUT_RIGHT, ACTION_MENU::Clone(), CMENU_BUTTON, CMENU_NOW, CMENU_OFF, TOOL_MANAGER::TOOL_STATE::cofunc, TOOL_MANAGER::TOOL_STATE::contextMenu, TOOL_MANAGER::TOOL_STATE::contextMenuTrigger, dispatchInternal(), KIGFX::VIEW_CONTROLS::ForceCursorPosition(), KIGFX::VIEW_CONTROLS::GetCursorPosition(), TOOL_EVENT::IsClick(), m_activeTools, m_cursorSettings, KIGFX::VC_SETTINGS::m_forceCursorPosition, KIGFX::VC_SETTINGS::m_forcedPosition, m_frame, m_menuActive, m_menuCursor, m_menuOwner, m_toolIdIndex, m_viewControls, m_warpMouseAfterContextMenu, NULLOPT, TOOL_MANAGER::TOOL_STATE::pendingWait, TOOL_EVENT::SetHasPosition(), TOOL_EVENT::SetParameter(), TA_ANY, TA_CHOICE_MENU_CHOICE, TA_CHOICE_MENU_CLOSED, TC_ANY, TC_COMMAND, TOOL_MANAGER::TOOL_STATE::vcSettings, and TOOL_MANAGER::TOOL_STATE::waitEvents.
Referenced by LIB_TREE::onContextMenu(), and processEvent().
bool TOOL_MANAGER::DispatchHotKey | ( | const TOOL_EVENT & | aEvent | ) |
Handle specific events, that are intended for TOOL_MANAGER rather than tools.
aEvent | is the event to be processed. |
Definition at line 779 of file tool_manager.cpp.
References TOOL_EVENT::Action(), TOOL_EVENT::KeyCode(), m_actionMgr, TOOL_EVENT::Modifier(), ACTION_MANAGER::RunHotKey(), and TA_KEY_PRESSED.
Referenced by processEvent().
|
private |
Passe an event at first to the active tools, then to all others.
Definition at line 647 of file tool_manager.cpp.
References COROUTINE< ReturnType, ArgType >::Call(), TOOL_EVENT::Category(), TOOL_EVENT_LIST::clear(), TOOL_MANAGER::TOOL_STATE::cofunc, finishTool(), TOOL_EVENT::FirstResponder(), TOOL_EVENT::Format(), TOOL_BASE::GetName(), TOOL_MANAGER::TOOL_STATE::idle, TOOL_EVENT::IsChoiceMenu(), kicadTraceToolStack, m_activeTools, m_menuOwner, m_toolIdIndex, m_toolState, TOOL_EVENT_LIST::Matches(), TOOL_EVENT::PassEvent(), TOOL_MANAGER::TOOL_STATE::pendingWait, TOOL_MANAGER::TOOL_STATE::Push(), COROUTINE< ReturnType, ArgType >::Resume(), COROUTINE< ReturnType, ArgType >::Running(), setActiveState(), TC_MESSAGE, TOOL_MANAGER::TOOL_STATE::theTool, TOOL_MANAGER::TOOL_STATE::transitions, TOOL_MANAGER::TOOL_STATE::vcSettings, TOOL_MANAGER::TOOL_STATE::waitEvents, and TOOL_MANAGER::TOOL_STATE::wakeupEvent.
Referenced by DispatchContextMenu(), and processEvent().
TOOL_BASE * TOOL_MANAGER::FindTool | ( | int | aId | ) | const |
Search for a tool with given ID.
aId | is the ID number of the requested tool. |
Definition at line 507 of file tool_manager.cpp.
References m_toolIdIndex, and NULL.
Referenced by GetCurrentTool(), InvokeTool(), ACTION_MANAGER::RunHotKey(), and ShutdownTool().
TOOL_BASE * TOOL_MANAGER::FindTool | ( | const std::string & | aName | ) | const |
Search for a tool with given name.
aName | is the name of the requested tool. |
Definition at line 518 of file tool_manager.cpp.
References m_toolNameIndex, and NULL.
|
private |
Deactivate a tool and does the necessary clean up.
aState | is the state variable of the tool to be stopped. |
Definition at line 909 of file tool_manager.cpp.
References TOOL_BASE::GetId(), TOOL_BASE::GetType(), TOOL_MANAGER::TOOL_STATE::idle, INTERACTIVE, m_activeState, m_activeTools, TOOL_MANAGER::TOOL_STATE::Pop(), setActiveState(), and TOOL_MANAGER::TOOL_STATE::theTool.
Referenced by dispatchInternal(), and ShutdownTool().
|
inline |
Definition at line 197 of file tool_manager.h.
References m_actionMgr.
Referenced by TOOLS_HOLDER::CommonSettingsChanged(), ACTION_TOOLBAR::doSelectAction(), TOOLS_HOLDER::PopTool(), TOOLS_HOLDER::PushTool(), PL_EDITOR_FRAME::setupUIConditions(), CVPCB_MAINFRAME::setupUIConditions(), FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), SYMBOL_VIEWER_FRAME::setupUIConditions(), KICAD_MANAGER_FRAME::setupUIConditions(), EDA_3D_VIEWER::setupUIConditions(), SCH_EDIT_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), and GERBVIEW_FRAME::setupUIConditions().
const std::map< std::string, TOOL_ACTION * > & TOOL_MANAGER::GetActions | ( | ) |
Definition at line 364 of file tool_manager.cpp.
References ACTION_MANAGER::GetActions(), and m_actionMgr.
std::string TOOL_MANAGER::GetClipboardUTF8 | ( | ) | const |
Return the information currently stored in the system clipboard.
If data stored in the clipboard is in non-text format, empty string is returned.
Definition at line 988 of file tool_manager.cpp.
Referenced by PL_EDIT_TOOL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), and SCH_EDITOR_CONTROL::Paste().
|
inline |
Return the tool that is on the top of the active tools stack (was invoked the most recently).
Definition at line 319 of file tool_manager.h.
References FindTool(), and GetCurrentToolId().
Referenced by PCB_GRID_HELPER::queryVisible().
|
inline |
Return id of the tool that is on the top of the active tools stack (was invoked the most recently).
Definition at line 308 of file tool_manager.h.
References m_activeTools.
Referenced by GetCurrentTool(), and GetCurrentToolState().
|
inline |
Return the #TOOL_STATE object representing the state of the active tool.
If there are no tools active, it returns nullptr.
Definition at line 328 of file tool_manager.h.
References GetCurrentToolId(), and m_toolIdIndex.
Referenced by GetCurrentToolVC(), invokeTool(), and ProcessEvent().
const KIGFX::VC_SETTINGS & TOOL_MANAGER::GetCurrentToolVC | ( | ) | const |
Return the view controls settings for the current tool or the general settings if there is no active tool.
Definition at line 1014 of file tool_manager.cpp.
References GetCurrentToolState(), KIGFX::VIEW_CONTROLS::GetSettings(), and m_viewControls.
Referenced by COMMON_TOOLS::ResetLocalCoords().
VECTOR2D TOOL_MANAGER::GetCursorPosition | ( | ) |
Definition at line 305 of file tool_manager.cpp.
References KIGFX::VIEW_CONTROLS::GetCursorPosition(), and m_viewControls.
Referenced by invokeTool(), and RunAction().
int TOOL_MANAGER::GetHotKey | ( | const TOOL_ACTION & | aAction | ) |
Definition at line 370 of file tool_manager.cpp.
References ACTION_MANAGER::GetHotKey(), and m_actionMgr.
Referenced by ACTION_MENU::updateHotKeys().
|
inline |
Definition at line 446 of file tool_manager.h.
References m_menuCursor.
Referenced by ROUTER_TOOL::InlineBreakTrack().
|
inline |
Definition at line 296 of file tool_manager.h.
References m_model.
Referenced by BOARD_INSPECTION_TOOL::ClearHighlight(), TOOL_BASE::getModelInt(), BOARD_INSPECTION_TOOL::highlightNet(), and DIALOG_POSITION_RELATIVE::OnUseGridOriginClick().
VECTOR2D TOOL_MANAGER::GetMousePosition | ( | ) |
Definition at line 296 of file tool_manager.cpp.
References KIGFX::VIEW_CONTROLS::GetMousePosition(), and m_viewControls.
Referenced by ACTION_MENU::OnMenuEvent().
int TOOL_MANAGER::GetPriority | ( | int | aToolId | ) | const |
Return priority of a given tool.
Higher number means that the tool is closer to the beginning of the active tools queue (i.e. receives events earlier, tools with lower priority receive events later).
aToolId | is the id of queried tool. |
Definition at line 586 of file tool_manager.cpp.
References m_activeTools.
Referenced by ACTION_MANAGER::RunHotKey().
|
inline |
Definition at line 298 of file tool_manager.h.
References m_settings.
Referenced by COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), COMMON_TOOLS::GridNext(), COMMON_TOOLS::GridPreset(), COMMON_TOOLS::GridPrev(), COMMON_TOOLS::OnGridChanged(), and COMMON_TOOLS::Reset().
|
inline |
Definition at line 219 of file tool_manager.h.
References m_toolTypes, name, and NULL.
Referenced by EDA_BASE_FRAME::AddStandardHelpMenu(), EDA_DRAW_FRAME::AddStandardSubMenus(), SCH_EDITOR_CONTROL::AssignNetclass(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), PAD_TOOL::copyPadSettings(), EDA_3D_VIEWER::CreateMenuBar(), ZONE_CREATE_HELPER::createNewZone(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_EDIT_FRAME::DeleteJunction(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), SCH_EDIT_FRAME::DisplayCurrentSheet(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), SCH_EDITOR_CONTROL::doCopy(), SCH_EDITOR_CONTROL::doCrossProbeSchToPcb(), BOARD_INSPECTION_TOOL::doHideNet(), DRAWING_TOOL::DrawVia(), BOARD_EDITOR_CONTROL::DrillOrigin(), EDIT_TOOL::Duplicate(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SYMBOL_EDITOR_EDIT_TOOL::editGraphicProperties(), PAD_TOOL::EditPad(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), GROUP_TOOL::EnterGroup(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), EE_INSPECTION_TOOL::ExcludeMarker(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), EDIT_TOOL::GetAndPlace(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), FOOTPRINT_EDIT_FRAME::GetCurrentSelection(), FOOTPRINT_VIEWER_FRAME::GetCurrentSelection(), SYMBOL_EDIT_FRAME::GetCurrentSelection(), DISPLAY_FOOTPRINTS_FRAME::GetCurrentSelection(), PL_EDITOR_FRAME::GetCurrentSelection(), SYMBOL_VIEWER_FRAME::GetCurrentSelection(), SCH_EDIT_FRAME::GetCurrentSelection(), GERBVIEW_FRAME::GetCurrentSelection(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), DRAWING_TOOL::getSourceZoneForAction(), EDA_DRAW_FRAME::GetUnitPair(), PCB_CONTROL::GridSetOrigin(), GROUP_TOOL::Group(), PL_EDITOR_FRAME::HardRedraw(), SYMBOL_EDIT_FRAME::HardRedraw(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::highlightNet(), highlightNet(), SCH_EDITOR_CONTROL::HighlightNetCursor(), BOARD_INSPECTION_TOOL::HighlightNetTool(), SYMBOL_EDITOR_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), GROUP_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), GLOBAL_EDIT_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_POINT_EDITOR::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), PCB_POINT_EDITOR::Init(), POSITION_RELATIVE_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), EDIT_TOOL::invokeInlineRouter(), EDIT_TOOL::isInteractiveDragEnabled(), EDIT_TOOL::isRouterActive(), SCH_EDIT_FRAME::KiwayMailIn(), GROUP_TOOL::LeaveGroup(), SYMBOL_EDIT_FRAME::LoadPart(), PCB_EDIT_FRAME::LoadProjectSettings(), FOOTPRINT_EDIT_FRAME::LoadSettings(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PCB_SELECTION_TOOL::Main(), BOARD_EDITOR_CONTROL::modifyLockSelected(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_DRC::OnActivateDlg(), DIALOG_FOOTPRINT_CHECKER::OnCancelClick(), DIALOG_DRC::OnCancelClick(), DIALOG_INSPECTOR::onCellClicked(), DIALOG_POSITION_RELATIVE::OnClear(), DIALOG_ERC::OnCloseErcDialog(), DIALOG_POSITION_RELATIVE::OnOkClick(), DIALOG_PLOT::onRunDRC(), DIALOG_DRC::OnRunDRCClick(), DIALOG_POSITION_RELATIVE::OnSelectItemClick(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), SCH_EDIT_FRAME::OpenProjectFiles(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), SCH_EDITOR_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), PCB_CONTROL::placeBoardItems(), DIALOG_PLOT::Plot(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), SCH_EDIT_FRAME::PutDataInPreviousState(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SYMBOL_VIEWER_FRAME::ReCreateMenuBar(), SYMBOL_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar(), SYMBOL_EDIT_FRAME::ReCreateOptToolbar(), SCH_EDIT_FRAME::ReCreateOptToolbar(), PCB_EDIT_FRAME::ReCreateOptToolbar(), PCB_EDIT_FRAME::ReCreateVToolbar(), SYMBOL_EDITOR_EDIT_TOOL::Redo(), SCH_EDITOR_CONTROL::Redo(), SCH_BASE_FRAME::RefreshSelection(), GROUP_TOOL::RemoveFromGroup(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), PL_EDITOR_FRAME::RollbackFromUndo(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), DRC_TOOL::RunTests(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), SCH_BASE_FRAME::SCH_BASE_FRAME(), SCH_EDIT_FRAME::SchematicCleanUp(), PCB_TOOL_BASE::selection(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), FOOTPRINT_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), EDA_DRAW_FRAME::setupUnits(), PCB_BASE_FRAME::ShowPadPropertiesDialog(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_EDIT_TOOL::Undo(), SCH_EDITOR_CONTROL::Undo(), GROUP_TOOL::Ungroup(), GROUP_CONTEXT_MENU::update(), SYMBOL_UNIT_MENU::update(), BUS_UNFOLD_MENU::update(), EE_INSPECTION_TOOL::UpdateMessagePanel(), GERBVIEW_CONTROL::UpdateMessagePanel(), PL_EDITOR_CONTROL::UpdateMessagePanel(), PCB_CONTROL::UpdateMessagePanel(), BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest(), SCH_EDIT_FRAME::UpdateSymbolFromEditor(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), and BOARD_EDITOR_CONTROL::ZoneMerge().
|
inline |
Definition at line 300 of file tool_manager.h.
References m_frame.
Referenced by TOOL_DISPATCHER::DispatchWxEvent(), ACTION_TOOLBAR::doSelectAction(), VIA_SIZE_MENU::eventHandler(), TOOL_BASE::getToolHolderInt(), highlightNet(), DIALOG_POSITION_RELATIVE::OnUseUserOriginClick(), ACTION_TOOLBAR::popupPalette(), ProcessEvent(), processEvent(), EDA_3D_CONTROLLER::Reset(), ACTION_MANAGER::RunHotKey(), ACTION_MANAGER::SetConditions(), EDA_3D_CONTROLLER::SetMaterial(), EDA_3D_CONTROLLER::ToggleVisibility(), VIA_SIZE_MENU::update(), BUS_UNFOLD_MENU::update(), ACTION_MANAGER::UpdateHotKeys(), and UpdateUI().
|
inline |
Definition at line 289 of file tool_manager.h.
References m_view.
Referenced by PCB_GRID_HELPER::BestDragOrigin(), EE_GRID_HELPER::BestDragOrigin(), EE_GRID_HELPER::BestSnapAnchor(), PCB_GRID_HELPER::BestSnapAnchor(), GRID_HELPER::canUseGrid(), BOARD_INSPECTION_TOOL::ClearHighlight(), PCB_GRID_HELPER::computeAnchors(), BOARD_INSPECTION_TOOL::doHideNet(), EE_GRID_HELPER::EE_GRID_HELPER(), PAD_TOOL::EnumeratePads(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), GRID_HELPER::GetGrid(), EE_SELECTION_TOOL::GetNode(), GRID_HELPER::GetOrigin(), TOOL_DISPATCHER::getView(), TOOL_BASE::getView(), BOARD_INSPECTION_TOOL::HighlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_GRID_HELPER::PCB_GRID_HELPER(), EE_GRID_HELPER::queryVisible(), PCB_GRID_HELPER::queryVisible(), GRID_HELPER::SetAuxAxes(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().
|
inline |
Definition at line 291 of file tool_manager.h.
References m_viewControls.
Referenced by ZONE_CREATE_HELPER::createNewZone(), TOOL_DISPATCHER::DispatchWxEvent(), and TOOL_BASE::getViewControls().
void TOOL_MANAGER::InitTools | ( | ) |
Initializes all registered tools.
If a tool fails during the initialization, it is deactivated and becomes unavailable for further use. Initialization should be done only once.
Definition at line 553 of file tool_manager.cpp.
References TOOL_BASE::GetId(), TOOL_BASE::GetName(), TOOL_BASE::Init(), kicadTraceToolStack, m_actionMgr, m_toolIdIndex, m_toolNameIndex, m_toolOrder, m_toolState, m_toolTypes, ResetTools(), TOOL_BASE::RUN, setActiveState(), and ACTION_MANAGER::UpdateHotKeys().
Referenced by FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), PANEL_PREV_3D::PANEL_PREV_3D(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), KICAD_MANAGER_FRAME::setupTools(), SYMBOL_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), GERBVIEW_FRAME::setupTools(), and SCH_EDIT_FRAME::setupTools().
bool TOOL_MANAGER::InvokeTool | ( | TOOL_ID | aToolId | ) |
Call a tool by sending a tool activation event to tool of given ID.
aToolId | is the ID number of the requested tool. |
Definition at line 252 of file tool_manager.cpp.
References FindTool(), TOOL_BASE::GetType(), INTERACTIVE, invokeTool(), and kicadTraceToolStack.
Referenced by TOOL_INTERACTIVE::Activate(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), EE_SELECTION_TOOL::Main(), PANEL_PREV_3D::PANEL_PREV_3D(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), SYMBOL_EDIT_FRAME::setupTools(), and GERBVIEW_FRAME::setupTools().
bool TOOL_MANAGER::InvokeTool | ( | const std::string & | aToolName | ) |
Call a tool by sending a tool activation event to tool of given name.
aToolName | is the name of the requested tool. |
Definition at line 266 of file tool_manager.cpp.
References FindTool(), TOOL_BASE::GetType(), INTERACTIVE, invokeTool(), and kicadTraceToolStack.
|
private |
Invoke a tool by sending a proper event (in contrary to runTool, which makes the tool run for real).
aTool | is the tool to be invoked. |
Definition at line 376 of file tool_manager.cpp.
References GetCurrentToolState(), GetCursorPosition(), TOOL_BASE::GetName(), NULL, processEvent(), setActiveState(), TOOL_EVENT::SetMousePosition(), TA_ACTIVATE, and TC_COMMAND.
Referenced by InvokeTool().
|
private |
Return information about a tool activation status.
aTool | is the tool to be checked. |
Definition at line 1043 of file tool_manager.cpp.
References alg::contains(), TOOL_BASE::GetId(), isRegistered(), and m_activeTools.
Referenced by runTool(), and ShutdownTool().
|
inline |
True while processing a context menu.
Definition at line 417 of file tool_manager.h.
References m_menuActive.
Referenced by DIALOG_SHIM::DIALOG_SHIM(), and ROUTER_TOOL::InlineBreakTrack().
|
inlineprivate |
Return information about a tool registration status.
aTool | is the tool to be checked. |
Definition at line 501 of file tool_manager.h.
References m_toolState.
Referenced by isActive(), and runTool().
bool TOOL_MANAGER::IsToolActive | ( | TOOL_ID | aId | ) | const |
Return true if a tool with given id is active (executing)
Definition at line 1158 of file tool_manager.cpp.
References m_toolIdIndex.
Referenced by TOOL_BASE::IsToolActive().
|
static |
Generates a unique ID from for a tool with given name.
Definition at line 1023 of file tool_manager.cpp.
|
inline |
Put an event to the event queue to be processed at the end of event processing cycle.
aEvent | is the event to be put into the queue. |
Definition at line 267 of file tool_manager.h.
References TOOL_EVENT::IsSimulator(), and m_eventQueue.
Referenced by SCH_EDIT_FRAME::AddJunction(), SCH_MOVE_TOOL::AlignElements(), EDIT_TOOL::doMoveSelection(), SCH_EDIT_TOOL::editFieldText(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), GROUP_TOOL::Group(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), TOOLS_HOLDER::PopTool(), PrimeTool(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), GROUP_TOOL::RemoveFromGroup(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), RunAction(), SCH_DRAWING_TOOLS::SingleClickPlace(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), GROUP_TOOL::Ungroup(), and EDA_DRAW_FRAME::UpdateMsgPanel().
void TOOL_MANAGER::PrimeTool | ( | const VECTOR2D & | aPosition | ) |
"Prime" a tool by sending a cursor left-click event with the mouse position set to the passed in position.
aPosition | is the mouse position to use in the eventReturn the hot key associated with a given action or 0 if there is none. |
aAction | is the queried action. |
Definition at line 350 of file tool_manager.cpp.
References BUT_LEFT, MD_ALT, MD_CTRL, MD_SHIFT, PostEvent(), TOOL_EVENT::SetMousePosition(), TA_PRIME, and TC_MOUSE.
Referenced by DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawZone(), and ROUTER_TOOL::MainLoop().
bool TOOL_MANAGER::ProcessEvent | ( | const TOOL_EVENT & | aEvent | ) |
Propagate an event to tools that requested events of matching type(s).
aEvent | is the event to be processed. |
Definition at line 935 of file tool_manager.cpp.
References GetCurrentToolState(), GetToolHolder(), KIGFX::VIEW::IsDirty(), m_view, processEvent(), TOOLS_HOLDER::RefreshCanvas(), setActiveState(), and UpdateUI().
Referenced by PL_SELECTION_TOOL::AddItemsToSel(), EE_SELECTION_TOOL::AddItemsToSel(), PL_SELECTION_TOOL::AddItemToSel(), PCB_SELECTION_TOOL::AddItemToSel(), EE_SELECTION_TOOL::AddItemToSel(), EDIT_TOOL::ChangeTrackWidth(), PL_SELECTION_TOOL::ClearSelection(), PCB_SELECTION_TOOL::ClearSelection(), GERBVIEW_SELECTION_TOOL::clearSelection(), EE_SELECTION_TOOL::ClearSelection(), PANEL_KICAD_LAUNCHER::CreateLaunchers(), COMMON_TOOLS::CursorControl(), TOOL_DISPATCHER::DispatchWxCommand(), TOOL_DISPATCHER::DispatchWxEvent(), PCB_TOOL_BASE::doInteractiveItemPlacement(), PCB_SELECTION_TOOL::expandConnection(), PCB_SELECTION_TOOL::filterSelection(), PCB_SELECTION_TOOL::findCallback(), EDIT_TOOL::Flip(), TOOL_DISPATCHER::handleMouseButton(), SYMBOL_EDITOR_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), ACTION_MENU::OnMenuEvent(), ACTION_TOOLBAR::onPaletteEvent(), ACTION_TOOLBAR::onToolEvent(), PAD_TOOL::pastePadProperties(), PCB_CONTROL::placeBoardItems(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), EE_SELECTION_TOOL::RebuildSelection(), SCH_EDITOR_CONTROL::Redo(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), PL_SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::RemoveItemFromSel(), PCB_SELECTION_TOOL::RemoveItemFromSel(), PL_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::RequestSelection(), EDIT_TOOL::Rotate(), EE_SELECTION_TOOL::SelectConnection(), COMMON_TOOLS::SelectionTool(), GERBVIEW_SELECTION_TOOL::SelectItem(), GERBVIEW_SELECTION_TOOL::SelectItems(), PCB_SELECTION_TOOL::SelectItems(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectMultiple(), PCB_SELECTION_TOOL::selectNet(), PL_SELECTION_TOOL::SelectPoint(), GERBVIEW_SELECTION_TOOL::selectPoint(), EE_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectPoint(), PCB_SELECTION_TOOL::selectSameSheet(), PCB_SELECTION_TOOL::selectSheetContents(), SCH_EDITOR_CONTROL::Undo(), GERBVIEW_SELECTION_TOOL::UnselectItem(), GERBVIEW_SELECTION_TOOL::UnselectItems(), and PCB_SELECTION_TOOL::UnselectItems().
|
private |
Main function for event processing.
Definition at line 1099 of file tool_manager.cpp.
References TOOLS_HOLDER::CurrentToolName(), dispatchActivation(), DispatchContextMenu(), DispatchHotKey(), dispatchInternal(), TOOL_EVENT::ForceImmediate(), TOOL_EVENT::Format(), TOOL_EVENT::GetCommandStr(), GetToolHolder(), kicadTraceToolStack, m_eventQueue, and TOOL_EVENT::SetHasPosition().
Referenced by CancelTool(), DeactivateTool(), invokeTool(), ProcessEvent(), and RunAction().
void TOOL_MANAGER::RegisterTool | ( | TOOL_BASE * | aTool | ) |
Add a tool to the manager set and sets it up.
Called once for each tool during application initialization.
aTool | tool to be added. Ownership is transferred. |
Definition at line 230 of file tool_manager.cpp.
References TOOL_BASE::attachManager(), TOOL_BASE::GetId(), TOOL_BASE::GetName(), m_toolIdIndex, m_toolNameIndex, m_toolOrder, m_toolState, m_toolTypes, and TOOL_MANAGER::TOOL_STATE::theTool.
Referenced by FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), PANEL_PREV_3D::PANEL_PREV_3D(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), KICAD_MANAGER_FRAME::setupTools(), SYMBOL_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), GERBVIEW_FRAME::setupTools(), and SCH_EDIT_FRAME::setupTools().
void TOOL_MANAGER::ResetTools | ( | TOOL_BASE::RESET_REASON | aReason | ) |
Reset all tools (i.e.
calls their Reset() method).
Definition at line 537 of file tool_manager.cpp.
References DeactivateTool(), TOOL_BASE::GetType(), INTERACTIVE, m_toolState, TOOL_BASE::Reset(), and setActiveState().
Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), GERBVIEW_FRAME::Clear_DrawLayers(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), GERBVIEW_FRAME::Erase_Current_DrawLayer(), InitTools(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), SYMBOL_EDIT_FRAME::OnSelectUnit(), FOOTPRINT_WIZARD_FRAME::ReloadFootprint(), PCB_BASE_EDIT_FRAME::SetBoard(), SYMBOL_EDIT_FRAME::SetCurPart(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DISPLAY_FOOTPRINTS_FRAME::updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), and FOOTPRINT_EDIT_FRAME::UpdateView().
|
inline |
Run the specified action.
The common format for action names is "application.ToolName.Action".
aActionName | is the name of action to be invoked. |
aNow | decides if the action has to be run immediately or after the current coroutine is preemptied. |
aParam | is an optional parameter that might be used by the invoked action. Its meaning depends on the action. |
Definition at line 141 of file tool_manager.h.
Referenced by DIALOG_GLOBAL_DELETION::acceptPcbDelete(), PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SCH_MOVE_TOOL::AlignElements(), APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), CVPCB_ASSOCIATION_TOOL::Associate(), SCH_EDIT_TOOL::AutoplaceFields(), SCH_EDIT_TOOL::BreakWire(), SCH_EDIT_FRAME::canCloseWindow(), ROUTER_TOOL::CanInlineDrag(), SCH_EDIT_TOOL::ChangeTextType(), EDIT_TOOL::ChangeTrackWidth(), SCH_EDIT_TOOL::CleanupSheetPins(), GERBVIEW_CONTROL::ClearAllLayers(), PCB_SELECTION_TOOL::ClearSelection(), ZONE_CREATE_HELPER::commitZone(), SCH_EDIT_TOOL::ConvertDeMorgan(), SCH_EDIT_FRAME::ConvertPart(), MICROWAVE_TOOL::createInductorBetween(), SYMBOL_EDIT_FRAME::CreateNewPart(), COMMON_TOOLS::CursorControl(), SCH_EDITOR_CONTROL::Cut(), SYMBOL_VIEWER_FRAME::DClickOnCmpList(), DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers(), DIALOG_ERC::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), SCH_EDIT_FRAME::DisplayCurrentSheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), SIM_PLOT_FRAME::doCloseWindow(), SYMBOL_EDITOR_EDIT_TOOL::DoDelete(), SCH_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SCH_FIELD::DoHypertextMenu(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawRectangle(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::Duplicate(), EDIT_TOOL::Duplicate(), SCH_EDIT_TOOL::EditField(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), PAD_TOOL::EditPad(), SYMBOL_EDITOR_EDIT_TOOL::editSymbolProperties(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), SYMBOL_EDIT_FRAME::emptyScreen(), SCH_NAVIGATE_TOOL::EnterSheet(), SCH_EDITOR_CONTROL::EnterSheet(), PAD_TOOL::EnumeratePads(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), PAD_TOOL::explodePad(), SCH_EDITOR_CONTROL::FindComponentAndItem(), PCB_POINT_EDITOR::finishItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), EDIT_TOOL::Flip(), GERBVIEW_FRAME::GERBVIEW_FRAME(), EDIT_TOOL::GetAndPlace(), DRAWING_TOOL::getSourceZoneForAction(), SYMBOL_EDIT_FRAME::GetSymbolFromRedoList(), SYMBOL_EDIT_FRAME::GetSymbolFromUndoList(), PCB_CONTROL::GridSetOrigin(), BOARD_INSPECTION_TOOL::HighlightItem(), SCH_EDITOR_CONTROL::HighlightNetCursor(), BOARD_INSPECTION_TOOL::HighlightNetTool(), SCH_NAVIGATE_TOOL::HypertextCommand(), SCH_EDIT_FRAME::importFile(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), PL_EDIT_TOOL::ImportWorksheetContent(), SCH_EDIT_FRAME::initScreenZoom(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), EDIT_TOOL::invokeInlineRouter(), SCH_EDIT_FRAME::KiwayMailIn(), PCB_EDIT_FRAME::KiwayMailIn(), SCH_NAVIGATE_TOOL::LeaveSheet(), SCH_EDITOR_CONTROL::LeaveSheet(), SYMBOL_EDIT_FRAME::LoadOneLibraryPartAux(), SYMBOL_EDIT_FRAME::LoadSymbolFromCurrentLib(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PL_EDIT_TOOL::Main(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), CVPCB_CONTROL::Main(), SCH_MOVE_TOOL::Main(), PL_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), PCB_SELECTION_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), SYMBOL_EDITOR_EDIT_TOOL::Mirror(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), DIALOG_GROUP_PROPERTIES::OnAddMember(), SYMBOL_TREE_PANE::onComponentSelected(), DIALOG_DRC::OnDeleteOneClick(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), PCB_EDIT_FRAME::OnEditItemRequest(), DIALOG_ERC::OnERCItemSelected(), DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked(), DIALOG_INSPECTION_REPORTER::OnErrorLinkClicked(), SCH_EDIT_FRAME::OnFindDialogClose(), ZONE_CREATE_HELPER::OnFirstPoint(), KICAD_MANAGER_FRAME::OnIdle(), FOOTPRINTS_LISTBOX::OnLeftDClick(), ACTION_MENU::OnMenuEvent(), APPEARANCE_CONTROLS::onNetclassContextMenu(), APPEARANCE_CONTROLS::onNetContextMenu(), PL_EDITOR_FRAME::OnNewPageLayout(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), SIM_PLOT_FRAME::onProbe(), EDA_DRAW_FRAME::OnSelectGrid(), DIALOG_POSITION_RELATIVE::OnSelectItemClick(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), SYMBOL_EDIT_FRAME::OnSelectUnit(), EDA_DRAW_FRAME::OnSelectZoom(), SCH_EDIT_FRAME::onSize(), SIM_PLOT_FRAME::onTune(), SCH_EDIT_FRAME::OpenProjectFiles(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), ROUTER_TOOL::performRouting(), ZONE_CREATE_HELPER::performZoneCutout(), GROUP_TOOL::PickNewMember(), EDIT_TOOL::pickReferencePoint(), SYMBOL_EDITOR_EDIT_TOOL::PinTable(), PCB_CONTROL::placeBoardItems(), SCH_DRAWING_TOOLS::PlaceComponent(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), PCB_CONTROL::Print(), GERBVIEW_CONTROL::Print(), SYMBOL_EDITOR_EDIT_TOOL::Properties(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDIT_FRAME::PutDataInPreviousState(), CVPCB_MAINFRAME::refreshAfterComponentSearch(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), GROUP_TOOL::RemoveFromGroup(), SCH_EDIT_TOOL::RepeatDrawItem(), SYMBOL_EDITOR_DRAWING_TOOLS::RepeatDrawItem(), PCB_SELECTION_TOOL::RequestSelection(), PL_EDITOR_FRAME::RollbackFromUndo(), SYMBOL_EDIT_FRAME::RollbackSymbolFromUndo(), SYMBOL_EDITOR_EDIT_TOOL::Rotate(), SCH_EDIT_TOOL::Rotate(), EDIT_TOOL::Rotate(), RunAction(), ACTION_MANAGER::RunHotKey(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), SYMBOL_EDIT_FRAME::saveLibrary(), DIALOG_FIND::search(), PL_SELECTION_TOOL::SelectPoint(), EE_SELECTION_TOOL::selectPoint(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), GERBVIEW_FRAME::SetActiveLayer(), DRAWING_TOOL::SetAnchor(), SYMBOL_EDIT_FRAME::SetCurPart(), SCH_EDIT_FRAME::SetScreen(), SYMBOL_VIEWER_FRAME::SetSelectedComponent(), CVPCB_MAINFRAME::setupEventHandlers(), SCH_EDIT_FRAME::setupTools(), EDA_DRAW_FRAME::setupUnits(), DRC_TOOL::ShowDRCDialog(), APPEARANCE_CONTROLS::showNetclass(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_GROUP_PROPERTIES::TransferDataFromWindow(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), GROUP_TOOL::Ungroup(), EDA_DRAW_FRAME::unitsChangeRefresh(), NET_GRID_TABLE::updateNetVisibility(), SCH_EDIT_FRAME::UpdateSymbolFromEditor(), DISPLAY_FOOTPRINTS_FRAME::updateView(), FOOTPRINT_WIZARD_FRAME::updateView(), FOOTPRINT_VIEWER_FRAME::updateView(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), BOARD_EDITOR_CONTROL::ZoneMerge(), EDA_DRAW_FRAME::Zoom_Automatique(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().
bool TOOL_MANAGER::RunAction | ( | const std::string & | aActionName, |
bool | aNow, | ||
void * | aParam | ||
) |
Definition at line 280 of file tool_manager.cpp.
References ACTION_MANAGER::FindAction(), Format(), m_actionMgr, and RunAction().
|
inline |
Definition at line 148 of file tool_manager.h.
References NULL, and RunAction().
|
inline |
Run the specified action.
This function will only return if the action has been handled when the action is run immediately (aNow = true), otherwise it will always return false.
aAction | is the action to be invoked. |
aNow | decides if the action has to be run immediately or after the current coroutine is preemptied. |
aParam | is an optional parameter that might be used by the invoked action. Its meaning depends on the action. |
Definition at line 167 of file tool_manager.h.
References RunAction().
bool TOOL_MANAGER::RunAction | ( | const TOOL_ACTION & | aAction, |
bool | aNow, | ||
void * | aParam | ||
) |
Definition at line 314 of file tool_manager.cpp.
References GetCursorPosition(), m_activeState, TOOL_ACTION::MakeEvent(), PostEvent(), processEvent(), setActiveState(), TOOL_EVENT::SetMousePosition(), TC_COMMAND, and UpdateUI().
|
inline |
Definition at line 174 of file tool_manager.h.
References NULL, and RunAction().
void TOOL_MANAGER::RunMainStack | ( | TOOL_BASE * | aTool, |
std::function< void()> | aFunc | ||
) |
Definition at line 617 of file tool_manager.cpp.
References TOOL_MANAGER::TOOL_STATE::cofunc, m_toolState, COROUTINE< ReturnType, ArgType >::RunMainStack(), and setActiveState().
Referenced by TOOL_INTERACTIVE::RunMainStack().
|
private |
Make a tool active, so it can receive events and react to them.
The activated tool is pushed on the active tools stack, so the last activated tool receives events first.
aTool | is the tool to be run. |
Definition at line 391 of file tool_manager.cpp.
References TOOL_BASE::GetId(), TOOL_BASE::GetType(), INTERACTIVE, isActive(), isRegistered(), m_activeTools, m_toolIdIndex, NULL, TOOL_BASE::Reset(), TOOL_BASE::RUN, and setActiveState().
Referenced by dispatchActivation().
bool TOOL_MANAGER::SaveClipboard | ( | const std::string & | aTextUTF8 | ) |
Store information to the system clipboard.
aText | is the information to be stored, expected UTF8 encoding. The text will be stored as Unicode string (not stored as UTF8 string). |
Definition at line 970 of file tool_manager.cpp.
Referenced by PL_EDIT_TOOL::Copy(), SYMBOL_EDITOR_EDIT_TOOL::Copy(), and SCH_EDITOR_CONTROL::doCopy().
|
private |
Save the #VIEW_CONTROLS settings to the tool state object.
If #VIEW_CONTROLS settings are affected by TOOL_MANAGER, the original settings are saved.
Definition at line 1053 of file tool_manager.cpp.
References TOOL_BASE::GetId(), KIGFX::VIEW_CONTROLS::GetSettings(), m_cursorSettings, KIGFX::VC_SETTINGS::m_forceCursorPosition, KIGFX::VC_SETTINGS::m_forcedPosition, m_menuActive, m_menuCursor, m_viewControls, NULLOPT, TOOL_MANAGER::TOOL_STATE::theTool, and TOOL_MANAGER::TOOL_STATE::vcSettings.
Referenced by setActiveState().
void TOOL_MANAGER::ScheduleContextMenu | ( | TOOL_BASE * | aTool, |
ACTION_MENU * | aMenu, | ||
CONTEXT_MENU_TRIGGER | aTrigger | ||
) |
Set behavior of the tool's context popup menu.
aTool | is the parent tool. |
aMenu | is the menu structure, defined by the tool. |
aTrigger | determines when the menu is activated: CMENU_NOW: opens the menu right now CMENU_BUTTON: opens the menu when RMB is pressed CMENU_OFF: menu is disabled. May be called from a coroutine context. |
Definition at line 960 of file tool_manager.cpp.
References TOOL_MANAGER::TOOL_STATE::contextMenu, TOOL_MANAGER::TOOL_STATE::contextMenuTrigger, and m_toolState.
Referenced by TOOL_INTERACTIVE::SetContextMenu().
void TOOL_MANAGER::ScheduleNextState | ( | TOOL_BASE * | aTool, |
TOOL_STATE_FUNC & | aHandler, | ||
const TOOL_EVENT_LIST & | aConditions | ||
) |
Define a state transition.
The events that cause a given handler method in the tool to be called. Called by TOOL_INTERACTIVE::Go(). May be called from a coroutine context.
Definition at line 602 of file tool_manager.cpp.
References m_toolState, and TOOL_MANAGER::TOOL_STATE::transitions.
Referenced by TOOL_INTERACTIVE::goInternal().
TOOL_EVENT * TOOL_MANAGER::ScheduleWait | ( | TOOL_BASE * | aTool, |
const TOOL_EVENT_LIST & | aConditions | ||
) |
Pause execution of a given tool until one or more events matching aConditions arrives.
The pause/resume operation is done through COROUTINE object. Called only from coroutines.
Definition at line 625 of file tool_manager.cpp.
References TOOL_MANAGER::TOOL_STATE::cofunc, COROUTINE< ReturnType, ArgType >::KiYield(), m_toolState, TOOL_MANAGER::TOOL_STATE::pendingWait, TOOL_MANAGER::TOOL_STATE::shutdown, TOOL_MANAGER::TOOL_STATE::waitEvents, and TOOL_MANAGER::TOOL_STATE::wakeupEvent.
Referenced by TOOL_INTERACTIVE::Wait().
|
private |
Save the previous active state and sets a new one.
aState | is the new active state. Might be null to indicate there is no new active state.List of tools in the order they were registered |
Definition at line 1146 of file tool_manager.cpp.
References applyViewControls(), m_activeState, m_viewControls, and saveViewControls().
Referenced by dispatchInternal(), finishTool(), InitTools(), invokeTool(), ProcessEvent(), ResetTools(), RunAction(), RunMainStack(), runTool(), and ShutdownTool().
void TOOL_MANAGER::SetEnvironment | ( | EDA_ITEM * | aModel, |
KIGFX::VIEW * | aView, | ||
KIGFX::VIEW_CONTROLS * | aViewControls, | ||
APP_SETTINGS_BASE * | aSettings, | ||
TOOLS_HOLDER * | aFrame | ||
) |
Set the work environment (model, view, view controls and the parent window).
These are made available to the tool. Called by the parent frame when it is set up.
Definition at line 1031 of file tool_manager.cpp.
References m_frame, m_model, m_settings, m_view, and m_viewControls.
Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME(), EVT_GRID_CMD_CELL_CHANGED(), EVT_TOOL_RANGE(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), PANEL_PREV_3D::PANEL_PREV_3D(), PCB_BASE_EDIT_FRAME::SetBoard(), PCB_EDIT_FRAME::setupTools(), PL_EDITOR_FRAME::setupTools(), FOOTPRINT_EDIT_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), KICAD_MANAGER_FRAME::setupTools(), SYMBOL_EDIT_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), GERBVIEW_FRAME::setupTools(), and SCH_EDIT_FRAME::setupTools().
void TOOL_MANAGER::ShutdownAllTools | ( | ) |
Shutdown all tools with a currently registered event loop in this tool manager by waking them up with a null event.
Definition at line 433 of file tool_manager.cpp.
References m_activeTools, and ShutdownTool().
Referenced by SCH_EDIT_FRAME::doCloseWindow(), CVPCB_MAINFRAME::~CVPCB_MAINFRAME(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), FOOTPRINT_EDIT_FRAME::~FOOTPRINT_EDIT_FRAME(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::~GERBVIEW_FRAME(), KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME(), PL_EDITOR_FRAME::~PL_EDITOR_FRAME(), SCH_EDIT_FRAME::~SCH_EDIT_FRAME(), SYMBOL_EDIT_FRAME::~SYMBOL_EDIT_FRAME(), and SYMBOL_VIEWER_FRAME::~SYMBOL_VIEWER_FRAME().
void TOOL_MANAGER::ShutdownTool | ( | TOOL_BASE * | aTool | ) |
Shutdown the specified tool by waking it up with a null event to terminate the processing loop.
aTool | is the tool to shutdown |
Definition at line 470 of file tool_manager.cpp.
References finishTool(), TOOL_BASE::GetId(), isActive(), kicadTraceToolStack, m_activeTools, m_toolIdIndex, NULL, and setActiveState().
Referenced by ShutdownAllTools(), and ShutdownTool().
void TOOL_MANAGER::ShutdownTool | ( | TOOL_ID | aToolId | ) |
Shutdown the specified tool by waking it up with a null event to terminate the processing loop.
aToolId | is the ID of the tool to shutdown |
Definition at line 446 of file tool_manager.cpp.
References FindTool(), TOOL_BASE::GetType(), INTERACTIVE, kicadTraceToolStack, and ShutdownTool().
void TOOL_MANAGER::ShutdownTool | ( | const std::string & | aToolName | ) |
Shutdown the specified tool by waking it up with a null event to terminate the processing loop.
aToolName | is name of the tool to shutdown |
Definition at line 458 of file tool_manager.cpp.
References FindTool(), TOOL_BASE::GetType(), INTERACTIVE, kicadTraceToolStack, and ShutdownTool().
void TOOL_MANAGER::UpdateUI | ( | const TOOL_EVENT & | aEvent | ) |
Update the status bar and synchronizes toolbars.
Definition at line 1165 of file tool_manager.cpp.
References GetToolHolder(), and EDA_BASE_FRAME::UpdateStatusBar().
Referenced by ProcessEvent(), and RunAction().
|
inline |
Disable mouse warping after the current context menu is closed.
This must be called before invoking each context menu. It's a good idea to call this from non-modal dialogs (e.g. DRC window).
Definition at line 428 of file tool_manager.h.
References m_warpMouseAfterContextMenu.
Referenced by DIALOG_SHIM::DIALOG_SHIM(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), LIB_TREE::onContextMenu(), SCH_DRAWING_TOOLS::PlaceComponent(), SCH_DRAWING_TOOLS::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_DRAWING_TOOLS::TwoClickPlace().
|
private |
Original cursor position, if overridden by the context menu handler.
Definition at line 560 of file tool_manager.h.
Referenced by DispatchHotKey(), GetActionManager(), GetActions(), GetHotKey(), InitTools(), RunAction(), TOOL_MANAGER(), and ~TOOL_MANAGER().
|
private |
Definition at line 586 of file tool_manager.h.
Referenced by finishTool(), RunAction(), and setActiveState().
|
private |
Instance of ACTION_MANAGER that handles TOOL_ACTIONs.
Definition at line 557 of file tool_manager.h.
Referenced by DispatchContextMenu(), dispatchInternal(), finishTool(), GetCurrentToolId(), GetPriority(), isActive(), runTool(), ShutdownAllTools(), and ShutdownTool().
Definition at line 563 of file tool_manager.h.
Referenced by DispatchContextMenu(), and saveViewControls().
|
private |
Right click context menu position.
Definition at line 572 of file tool_manager.h.
Referenced by PostEvent(), and processEvent().
|
private |
Definition at line 568 of file tool_manager.h.
Referenced by DispatchContextMenu(), GetToolHolder(), and SetEnvironment().
|
private |
Tool currently displaying a popup menu. It is negative when there is no menu displayed.
Definition at line 580 of file tool_manager.h.
Referenced by DispatchContextMenu(), IsContextMenuActive(), and saveViewControls().
|
private |
Definition at line 575 of file tool_manager.h.
Referenced by DispatchContextMenu(), GetMenuCursorPos(), and saveViewControls().
|
private |
Pointer to the state object corresponding to the currently executed tool.
Definition at line 583 of file tool_manager.h.
Referenced by DispatchContextMenu(), and dispatchInternal().
|
private |
Definition at line 565 of file tool_manager.h.
Referenced by GetModel(), and SetEnvironment().
|
private |
Queue that stores events to be processed at the end of the event processing cycle.
Definition at line 569 of file tool_manager.h.
Referenced by GetSettings(), and SetEnvironment().
|
private |
Index of the registered tools to easily lookup by their type.
Definition at line 551 of file tool_manager.h.
Referenced by DispatchContextMenu(), dispatchInternal(), FindTool(), GetCurrentToolState(), InitTools(), IsToolActive(), RegisterTool(), runTool(), and ShutdownTool().
|
private |
Index of the registered tools current states, associated by tools' ID numbers.
Definition at line 548 of file tool_manager.h.
Referenced by dispatchActivation(), FindTool(), InitTools(), and RegisterTool().
|
private |
Index of registered tools current states, associated by tools' objects.
Definition at line 542 of file tool_manager.h.
Referenced by InitTools(), and RegisterTool().
|
private |
Index of the registered tools current states, associated by tools' names.
Definition at line 545 of file tool_manager.h.
Referenced by ClearTransitions(), dispatchInternal(), InitTools(), isRegistered(), RegisterTool(), ResetTools(), RunMainStack(), ScheduleContextMenu(), ScheduleNextState(), ScheduleWait(), and ~TOOL_MANAGER().
|
private |
Stack of the active tools.
Definition at line 554 of file tool_manager.h.
Referenced by GetTool(), InitTools(), and RegisterTool().
|
private |
Definition at line 566 of file tool_manager.h.
Referenced by GetView(), ProcessEvent(), and SetEnvironment().
|
private |
Definition at line 567 of file tool_manager.h.
Referenced by applyViewControls(), DispatchContextMenu(), GetCurrentToolVC(), GetCursorPosition(), GetMousePosition(), GetViewControls(), saveViewControls(), setActiveState(), and SetEnvironment().
|
private |
Flag indicating whether a context menu is currently displayed.
Definition at line 577 of file tool_manager.h.
Referenced by DispatchContextMenu(), and VetoContextMenuMouseWarp().