|
Krita Source Code Documentation
|
Pan Canvas implementation of KisAbstractInputAction. More...
#include <kis_pan_action.h>
Inheritance diagram for KisPanAction:Classes | |
| class | Private |
Public Types | |
| enum | Shortcut { PanModeShortcut , PanLeftShortcut , PanRightShortcut , PanUpShortcut , PanDownShortcut } |
Public Member Functions | |
| void | activate (int shortcut) override |
| void | begin (int shortcut, QEvent *event) override |
| void | cursorMovedAbsolute (const QPointF &lastPos, const QPointF &pos) override |
| void | deactivate (int shortcut) override |
| void | end (QEvent *event) override |
| KisInputActionGroup | inputActionGroup (int shortcut) const override |
| void | inputEvent (QEvent *event) override |
| bool | isShortcutRequired (int shortcut) const override |
| KisPanAction () | |
| int | priority () const override |
| bool | supportsHiResInputEvents (int shortcut) const override |
| ~KisPanAction () override | |
Public Member Functions inherited from KisAbstractInputAction | |
| virtual bool | canIgnoreModifiers () const |
| virtual QString | description () const |
| virtual QString | id () const |
| virtual bool | isAvailable () const |
| KisAbstractInputAction (const QString &id) | |
| virtual QString | name () const |
| virtual QHash< QString, int > | shortcutIndexes () 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) |
| 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) |
Pan Canvas implementation of KisAbstractInputAction.
The Pan Canvas action pans the canvas.
Definition at line 17 of file kis_pan_action.h.
The different behaviours for this action.
Definition at line 23 of file kis_pan_action.h.
|
explicit |
Definition at line 36 of file kis_pan_action.cpp.
References PanDownShortcut, PanLeftShortcut, PanModeShortcut, PanRightShortcut, PanUpShortcut, 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 62 of file kis_pan_action.cpp.
|
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 74 of file kis_pan_action.cpp.
References KisPanAction::Private::averagePoint(), KisAbstractInputAction::begin(), KisInputManager::canvas(), KoCanvasBase::canvasController(), d, KisAbstractInputAction::inputManager, KisPanAction::Private::lastPosition, KisPanAction::Private::originalPreferredCenter, KoCanvasController::pan(), KisPanAction::Private::panDistance, PanDownShortcut, PanLeftShortcut, PanModeShortcut, PanRightShortcut, PanUpShortcut, KoCanvasController::preferredCenter(), and KisPanAction::Private::touchPointsCount.
|
overridevirtual |
Reimplemented from KisAbstractInputAction.
Definition at line 160 of file kis_pan_action.cpp.
References KisInputManager::canvas(), KoCanvasBase::canvasController(), d, KisAbstractInputAction::inputManager, KisPanAction::Private::originalPreferredCenter, and KoCanvasController::setPreferredCenter().
|
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 68 of file kis_pan_action.cpp.
|
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 120 of file kis_pan_action.cpp.
References KisAbstractInputAction::end().
|
overridevirtual |
shortcut belongs to Reimplemented from KisAbstractInputAction.
Definition at line 193 of file kis_pan_action.cpp.
References ViewTransformActionGroup.
|
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 126 of file kis_pan_action.cpp.
References KisPanAction::Private::averagePoint(), KisInputManager::canvas(), KoCanvasBase::canvasController(), d, KisAbstractInputAction::inputEvent(), KisAbstractInputAction::inputManager, KisPanAction::Private::lastPosition, KoCanvasController::pan(), and KisPanAction::Private::touchPointsCount.
|
overridevirtual |
Return true when the specified shortcut is required for basic user interaction. This is used by the configuration system to prevent basic actions like painting from being removed.
| shortcut | The shortcut index to check. |
Reimplemented from KisAbstractInputAction.
Definition at line 188 of file kis_pan_action.cpp.
References PanModeShortcut.
|
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 57 of file kis_pan_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 199 of file kis_pan_action.cpp.
|
private |
Definition at line 52 of file kis_pan_action.h.