|
Krita Source Code Documentation
|
Change Primary Setting implementation of KisAbstractInputAction. More...
#include <kis_change_primary_setting_action.h>
Inheritance diagram for KisChangePrimarySettingAction:Public Types | |
| enum | Shortcut { PrimaryAlternateChangeSizeShortcut , SecondaryAlternateChangeSizeShortcut } |
Public Member Functions | |
| void | activate (int shortcut) override |
| void | begin (int shortcut, QEvent *event) override |
| void | deactivate (int shortcut) override |
| void | end (QEvent *event) override |
| void | inputEvent (QEvent *event) override |
| KisChangePrimarySettingAction () | |
| int | priority () const override |
| bool | supportsHiResInputEvents (int shortcut) const override |
| ~KisChangePrimarySettingAction () override | |
Public Member Functions inherited from KisAbstractInputAction | |
| virtual bool | canIgnoreModifiers () const |
| virtual QString | description () const |
| 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 | ~KisAbstractInputAction () |
Private Member Functions | |
| KisTool::ToolAction | decodeAction (int shortcut) const |
Private Attributes | |
| KisTool::ToolAction | savedAction {KisTool::Alternate_NONE} |
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) |
Change Primary Setting implementation of KisAbstractInputAction.
The Change Primary Setting action changes a tool's "Primary Setting", for example the brush size for the brush tool.
Definition at line 19 of file kis_change_primary_setting_action.h.
| Enumerator | |
|---|---|
| PrimaryAlternateChangeSizeShortcut | Default Mapping: Shift+Left Mouse. |
| SecondaryAlternateChangeSizeShortcut | Secondary Mode (snap to closest pixel value): Shift+Z+Left Mouse. |
Definition at line 25 of file kis_change_primary_setting_action.h.
|
explicit |
Definition at line 22 of file kis_change_primary_setting_action.cpp.
References PrimaryAlternateChangeSizeShortcut, SecondaryAlternateChangeSizeShortcut, KisAbstractInputAction::setDescription(), KisAbstractInputAction::setName(), and KisAbstractInputAction::setShortcutIndexes().
|
override |
Definition at line 47 of file kis_change_primary_setting_action.cpp.
|
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 52 of file kis_change_primary_setting_action.cpp.
References decodeAction(), KisAbstractInputAction::inputManager, and KisInputManager::toolProxy().
|
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 67 of file kis_change_primary_setting_action.cpp.
References KisToolProxy::BEGIN, KisAbstractInputAction::begin(), decodeAction(), KisAbstractInputAction::eventPosF(), KisAbstractInputAction::inputManager, savedAction, and KisInputManager::toolProxy().
|
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 57 of file kis_change_primary_setting_action.cpp.
References decodeAction(), KisAbstractInputAction::inputManager, and KisInputManager::toolProxy().
|
private |
Definition at line 33 of file kis_change_primary_setting_action.cpp.
References KisTool::Alternate_NONE, KisTool::AlternateChangeSize, and KisTool::AlternateChangeSizeSnap.
|
overridevirtual |
End the action.
| event | The mouse event that has finished this action. Is null for keyboard-activated actions. |
Reimplemented from KisAbstractInputAction.
Definition at line 78 of file kis_change_primary_setting_action.cpp.
References KisToolProxy::END, KisAbstractInputAction::end(), KisAbstractInputAction::eventPosF(), KisAbstractInputAction::inputManager, savedAction, and KisInputManager::toolProxy().
|
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 88 of file kis_change_primary_setting_action.cpp.
References KisToolProxy::CONTINUE, KisAbstractInputAction::eventPosF(), KisAbstractInputAction::inputManager, savedAction, and KisInputManager::toolProxy().
|
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 62 of file kis_change_primary_setting_action.cpp.
|
overridevirtual |
Returns true if the action can handle HiRes flow of move events which is generated by the tablet. If the function returns false, some of the events will be dropped or postponed. For most of the actions in Krita (except of real painting) it is perfectly acceptable, so 'false' is the default value.
Reimplemented from KisAbstractInputAction.
Definition at line 98 of file kis_change_primary_setting_action.cpp.
References KisTool::actionToAlternateAction(), decodeAction(), KisAbstractInputAction::inputManager, and KisInputManager::toolProxy().
|
private |
Definition at line 41 of file kis_change_primary_setting_action.h.