|
Krita Source Code Documentation
|
Select Layer implementation of KisAbstractInputAction. More...
#include <kis_select_layer_action.h>
Inheritance diagram for KisSelectLayerAction:Classes | |
| class | Private |
Public Types | |
| enum | LayerSelectionMode { LayerSelectionMode_TopLayer , LayerSelectionMode_AllLayers , LayerSelectionMode_Ask } |
| enum | SelectionOverrideMode { SelectionOverrideMode_Replace , SelectionOverrideMode_Add } |
Public Member Functions | |
| void | activate (int shortcut) override |
| void | begin (int shortcut, QEvent *event) override |
| void | deactivate (int shortcut) override |
| void | inputEvent (QEvent *event) override |
| KisSelectLayerAction () | |
| int | priority () const override |
| ~KisSelectLayerAction () override | |
Public Member Functions inherited from KisAbstractInputAction | |
| virtual bool | canIgnoreModifiers () const |
| virtual QString | description () const |
| virtual void | end (QEvent *event) |
| virtual QString | id () const |
| virtual KisInputActionGroup | inputActionGroup (int shortcut) const |
| virtual bool | isAvailable () const |
| virtual bool | isShortcutRequired (int shortcut) const |
| KisAbstractInputAction (const QString &id) | |
| virtual QString | name () const |
| virtual QHash< QString, int > | shortcutIndexes () const |
| virtual bool | supportsHiResInputEvents (int shortcut) const |
| virtual | ~KisAbstractInputAction () |
Private Attributes | |
| Private *const | d |
Additional Inherited Members | |
Public Attributes inherited from KisAbstractInputAction | |
| QString | description |
| QString | id |
| QHash< QString, int > | indexes |
| QPointF | lastCursorPosition |
| QString | name |
| QPointF | startCursorPosition |
Static Public Attributes inherited from KisAbstractInputAction | |
| static KisInputManager * | inputManager |
Protected Member Functions inherited from KisAbstractInputAction | |
| virtual void | cursorMoved (const QPointF &lastPos, const QPointF &pos) |
| virtual void | cursorMovedAbsolute (const QPointF &startPos, const QPointF &pos) |
| QPoint | eventPos (const QEvent *event) |
| QPointF | eventPosF (const QEvent *event) |
| KisInputManager * | inputManager () const |
| void | setDescription (const QString &description) |
| void | setName (const QString &name) |
| void | setShortcutIndexes (const QHash< QString, int > &indexes) |
Select Layer implementation of KisAbstractInputAction.
The Select Layer action selects a layer under a cursor.
Definition at line 17 of file kis_select_layer_action.h.
| Enumerator | |
|---|---|
| LayerSelectionMode_TopLayer | |
| LayerSelectionMode_AllLayers | |
| LayerSelectionMode_Ask | |
Definition at line 20 of file kis_select_layer_action.h.
| Enumerator | |
|---|---|
| SelectionOverrideMode_Replace | |
| SelectionOverrideMode_Add | |
Definition at line 27 of file kis_select_layer_action.h.
|
explicit |
Definition at line 112 of file kis_select_layer_action.cpp.
References d, LayerSelectionMode_AllLayers, LayerSelectionMode_Ask, LayerSelectionMode_TopLayer, KisSelectLayerAction::Private::makeShortcut(), SelectionOverrideMode_Add, SelectionOverrideMode_Replace, KisAbstractInputAction::setDescription(), KisAbstractInputAction::setName(), and KisAbstractInputAction::setShortcutIndexes().
|
override |
|
overridevirtual |
The method is called when the action is yet to be started, that is, e.g. the user has pressed all the modifiers for the action but hasn't started painting yet. This method is a right place to show the user what is going to happen, e.g. change the cursor.
Reimplemented from KisAbstractInputAction.
Definition at line 145 of file kis_select_layer_action.cpp.
References KisCursor::pickLayerCursor().
|
overridevirtual |
Begin the action.
| shortcut | The index of the behaviour to trigger. |
| event | The mouse event that has triggered this action. Is null for keyboard-activated actions. |
Reimplemented from KisAbstractInputAction.
Definition at line 157 of file kis_select_layer_action.cpp.
References KisAbstractInputAction::begin(), d, inputEvent(), and KisSelectLayerAction::Private::shortcut.
|
overridevirtual |
The method is called when the action is not a candidate for the starting anymore. The action should revert everything that was done in activate() method.
Reimplemented from KisAbstractInputAction.
Definition at line 151 of file kis_select_layer_action.cpp.
|
overridevirtual |
Process an input event.
By default handles MouseMove events and passes the data to a convenience cursorMoved() method
| event | An event to process. |
Reimplemented from KisAbstractInputAction.
Definition at line 165 of file kis_select_layer_action.cpp.
References Private::canvas, KisInputManager::canvas(), KisCanvas2::canvasWidget, d, KisSharedPtr< T >::data(), KisAbstractInputAction::eventPos(), KisAbstractInputAction::eventPosF(), KisToolUtils::findNode(), KisToolUtils::findNodes(), KisAbstractInputAction::inputManager, KIS_SAFE_ASSERT_RECOVER_RETURN, KisSelectLayerAction::Private::layerSelectionMode(), LayerSelectionMode_AllLayers, LayerSelectionMode_Ask, LayerSelectionMode_TopLayer, KisBaseNode::name(), KisNode::parent, KisSelectLayerAction::Private::selectionOverrideMode(), SelectionOverrideMode_Add, SelectionOverrideMode_Replace, KisSelectLayerAction::Private::selectNode(), KisSelectLayerAction::Private::selectNodes(), and KisSelectLayerAction::Private::shortcut.
|
overridevirtual |
The priority for this action.
Priority determines how "important" the action is and is used to resolve conflicts when multiple actions can be activated.
Reimplemented from KisAbstractInputAction.
Definition at line 140 of file kis_select_layer_action.cpp.
|
private |
Definition at line 46 of file kis_select_layer_action.h.