|
| enum | MoveDirection { Up
, Down
, Left
, Right
} |
| |
| enum | MoveToolMode { MoveSelectedLayer
, MoveFirstLayer
, MoveGroup
} |
| |
| enum | { FLAG_USES_CUSTOM_PRESET =0x01
, FLAG_USES_CUSTOM_COMPOSITEOP =0x02
, FLAG_USES_CUSTOM_SIZE =0x04
} |
| |
| enum | AlternateAction {
ChangeSize = AlternateChangeSize
, ChangeSizeSnap = AlternateChangeSizeSnap
, SampleFgNode = AlternateSampleFgNode
, SampleBgNode = AlternateSampleBgNode
,
SampleFgImage = AlternateSampleFgImage
, SampleBgImage = AlternateSampleBgImage
, Secondary = AlternateSecondary
, Third = AlternateThird
,
Fourth = AlternateFourth
, Fifth = AlternateFifth
, NONE = 10000
} |
| |
| enum | NodePaintAbility {
VECTOR
, CLONE
, PAINT
, UNPAINTABLE
,
MYPAINTBRUSH_UNPAINTABLE
} |
| |
| enum | ToolAction {
Primary
, AlternateChangeSize
, AlternateChangeSizeSnap
, AlternateSampleFgNode
,
AlternateSampleBgNode
, AlternateSampleFgImage
, AlternateSampleBgImage
, AlternateSecondary
,
AlternateThird
, AlternateFourth
, AlternateFifth
, Alternate_NONE = 10000
} |
| |
|
| void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| |
| void | beginPrimaryAction (KoPointerEvent *event) override |
| |
| void | continueAction (KoPointerEvent *event) |
| |
| void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| |
| void | continuePrimaryAction (KoPointerEvent *event) override |
| |
| QWidget * | createOptionWidget () override |
| |
| void | endAction (KoPointerEvent *event) |
| |
| void | endAlternateAction (KoPointerEvent *event, AlternateAction action) override |
| |
| void | endPrimaryAction (KoPointerEvent *event) override |
| |
| | KisToolMove (KoCanvasBase *canvas) |
| |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| |
| MoveToolMode | moveToolMode () const |
| |
| void | paint (QPainter &gc, const KoViewConverter &converter) override |
| |
| void | setShowCoordinates (bool value) |
| |
| void | startAction (KoPointerEvent *event, MoveToolMode mode) |
| |
| void | updateUIUnit (int newUnit) |
| |
| bool | wantsAutoScroll () const override |
| | wantsAutoScroll reimplemented from KoToolBase there's an issue where autoscrolling with this tool never makes the stroke end, so we return false here so that users don't get stuck with the tool. See bug 362659
|
| |
| | ~KisToolMove () override |
| |
| virtual void | activateAlternateAction (AlternateAction action) |
| |
| virtual void | activatePrimaryAction () |
| |
| virtual bool | alternateActionSupportsHiResEvents (AlternateAction action) const |
| |
| virtual void | beginAlternateDoubleClickAction (KoPointerEvent *event, AlternateAction action) |
| |
| virtual void | beginPrimaryDoubleClickAction (KoPointerEvent *event) |
| |
| virtual void | deactivateAlternateAction (AlternateAction action) |
| |
| virtual void | deactivatePrimaryAction () |
| |
| void | deleteSelection () override |
| |
| virtual int | flags () const |
| |
| bool | isActive () const |
| |
| | KisTool (KoCanvasBase *canvas, const QCursor &cursor) |
| |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| |
| void | mousePressEvent (KoPointerEvent *event) override |
| |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| |
| void | mouseTripleClickEvent (KoPointerEvent *event) override |
| |
| virtual void | newActivationWithExternalSource (KisPaintDeviceSP externalSource) |
| | newActivationWithExternalSource Makes sure that the tool is active and starts a new stroke, which will be able to access the pixels from the specified external source.
|
| |
| KisTool::NodePaintAbility | nodePaintAbility () |
| |
| virtual bool | primaryActionSupportsHiResEvents () const |
| |
| virtual bool | supportsPaintingAssistants () const |
| |
| | ~KisTool () override |
| |
| | Private (KisCanvas2 *c) |
| |
| QAction * | action (const QString &name) const |
| |
| KoCanvasBase * | canvas () const |
| | Returns the canvas the tool is working on.
|
| |
| virtual void | copy () const |
| |
| QCursor | cursor () const |
| | return the last emitted cursor
|
| |
| virtual void | customMoveEvent (KoPointerEvent *event) |
| |
| virtual void | customPressEvent (KoPointerEvent *event) |
| |
| virtual void | customReleaseEvent (KoPointerEvent *event) |
| |
| virtual void | cut () |
| |
| virtual QRectF | decorationsRect () const |
| |
| int | decorationThickness () const |
| | decorationThickness The minimum thickness for tool decoration lines, this is derived from the screen magnification, thus the HiDPI settings. Note: to use this effectively, also set the pen to isCosmetic(true);
|
| |
| virtual void | deselect () |
| | deselect the tool should clear the selection if it has one.
|
| |
| virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
| |
| virtual void | dragMoveEvent (QDragMoveEvent *event, const QPointF &point) |
| |
| virtual void | dropEvent (QDropEvent *event, const QPointF &point) |
| |
| virtual void | explicitUserStrokeEndRequest () |
| | explicitUserStrokeEndRequest is called by the input manager when the user presses Enter key or any equivalent. This callback comes before requestStrokeEnd(), which comes from a different source.
|
| |
| KoToolFactoryBase * | factory () const |
| |
| virtual void | focusInEvent (QFocusEvent *event) |
| |
| virtual void | focusOutEvent (QFocusEvent *event) |
| |
| virtual bool | hasSelection () |
| |
| virtual void | inputMethodEvent (QInputMethodEvent *event) |
| |
| virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| |
| bool | isInTextMode () const |
| |
| bool | isOpacityPresetMode () const |
| |
| virtual void | keyPressEvent (QKeyEvent *event) |
| |
| virtual void | keyReleaseEvent (QKeyEvent *event) |
| |
| | KoToolBase (KoCanvasBase *canvas) |
| |
| bool | maskSyntheticEvents () const |
| |
| QList< QPointer< QWidget > > | optionWidgets () |
| |
| virtual bool | paste () |
| |
| virtual QMenu * | popupActionsMenu () |
| |
| virtual KisPopupWidgetInterface * | popupWidget () |
| |
| virtual bool | selectAll () |
| | selectAll select all data the tool can select.
|
| |
| virtual KoToolSelection * | selection () |
| |
| Q_INVOKABLE QString | toolId () const |
| |
| | ~KoToolBase () override |
| |
|
| static AlternateAction | actionToAlternateAction (ToolAction action) |
| |
| KoColor | currentBgColor |
| |
| float | currentExposure {1.0} |
| |
| KoColor | currentFgColor |
| |
| KisFilterConfigurationSP | currentGenerator |
| |
| KoAbstractGradientSP | currentGradient |
| |
| KoPatternSP | currentPattern |
| |
| QCursor | cursor |
| |
| bool | m_isActive {false} |
| |
| ToolMode | m_mode {HOVER_MODE} |
| |
| QWidget * | optionWidget {0} |
| |
| KisCanvas2 * | canvas |
| |
| int | displayedFrame |
| |
| int | intendedFrame |
| |
| enum | ToolMode : int {
HOVER_MODE
, PAINT_MODE
, SECONDARY_PAINT_MODE
, MIRROR_AXIS_SETUP_MODE
,
GESTURE_MODE
, PAN_MODE
, OTHER
, OTHER_1
} |
| |
| bool | blockUntilOperationsFinished () |
| |
| void | blockUntilOperationsFinishedForced () |
| |
| QPointF | convertDocumentToWidget (const QPointF &pt) |
| |
| QPoint | convertToImagePixelCoordFloored (KoPointerEvent *e) |
| |
| QPointF | convertToPixelCoord (const QPointF &pt) |
| |
| QPointF | convertToPixelCoord (KoPointerEvent *e) |
| |
| QPointF | convertToPixelCoordAndAlignOnWidget (const QPointF &pt) |
| |
| QPointF | convertToPixelCoordAndSnap (const QPointF &pt, const QPointF &offset=QPointF()) |
| |
| QPointF | convertToPixelCoordAndSnap (KoPointerEvent *e, const QPointF &offset=QPointF(), bool useModifiers=true) |
| |
| QRectF | convertToPt (const QRectF &rect) |
| |
| qreal | convertToPt (qreal value) |
| |
| KoColor | currentBgColor () |
| |
| KoColor | currentFgColor () |
| |
| KisFilterConfigurationSP | currentGenerator () |
| |
| KoAbstractGradientSP | currentGradient () |
| |
| KisImageWSP | currentImage () |
| |
| KisNodeSP | currentNode () const |
| |
| KisPaintOpPresetSP | currentPaintOpPreset () |
| |
| KoPatternSP | currentPattern () |
| |
| QCursor | cursor () const |
| |
| KisImageWSP | image () const |
| |
| virtual bool | listeningToModifiers () |
| |
| virtual void | listenToModifiers (bool listen) |
| |
| virtual ToolMode | mode () const |
| |
| bool | nodeEditable () |
| | Checks checks if the current node is editable.
|
| |
| bool | overrideCursorIfNotEditable () |
| | Override the cursor appropriately if current node is not editable.
|
| |
| void | paintToolOutline (QPainter *painter, const KisOptimizedBrushOutline &path) |
| |
| KisOptimizedBrushOutline | pixelToView (const KisOptimizedBrushOutline &path) const |
| |
| QPainterPath | pixelToView (const QPainterPath &pixelPath) const |
| | Convert a pixel path into a view path.
|
| |
| QPointF | pixelToView (const QPoint &pixelCoord) const |
| |
| QPointF | pixelToView (const QPointF &pixelCoord) const |
| | Convert a floating point pixel coordinate into a view coordinate.
|
| |
| QPolygonF | pixelToView (const QPolygonF &pixelPolygon) const |
| | Convert a pixel polygon into a view path.
|
| |
| QRectF | pixelToView (const QRectF &pixelRect) const |
| | Convert a pixel rectangle into a view rectangle.
|
| |
| KisNodeList | selectedNodes () const |
| |
| bool | selectionEditable () |
| | Checks checks if the selection is editable, only applies to local selection as global selection is always editable.
|
| |
| void | setCursor (const QCursor &cursor) |
| |
| virtual void | setMode (ToolMode mode) |
| |
| void | updateCanvasPixelRect (const QRectF &pixelRect) |
| | Update the canvas for the given rectangle in image pixel coordinates.
|
| |
| void | updateCanvasViewRect (const QRectF &viewRect) |
| | Update the canvas for the given rectangle in view coordinates.
|
| |
| QPointF | viewToPixel (const QPointF &viewCoord) const |
| |
| QPointF | widgetCenterInWidgetPixels () |
| |
| virtual QList< QPointer< QWidget > > | createOptionWidgets () |
| |
| int | grabSensitivity () const |
| | Convenience function to get the current grab sensitivity.
|
| |
| qreal | handleDocRadius () const |
| |
| QRectF | handleGrabRect (const QPointF &position) const |
| |
| QRectF | handlePaintRect (const QPointF &position) const |
| |
| int | handleRadius () const |
| | Convenience function to get the current handle radius.
|
| |
| bool | isActivated () const |
| |
| | KoToolBase (KoToolBasePrivate &dd) |
| |
| KoPointerEvent * | lastDeliveredPointerEvent () const |
| |
| void | setAbstractResource (KoAbstractCanvasResourceInterfaceSP abstractResource) |
| |
| void | setConverter (KoDerivedResourceConverterSP converter) |
| |
| void | setIsOpacityPresetMode (bool value) |
| |
| void | setMaskSyntheticEvents (bool value) |
| |
| void | setTextMode (bool value) |
| |
| QHash< int, KoAbstractCanvasResourceInterfaceSP > | toolAbstractResources () |
| |
| QHash< int, KoDerivedResourceConverterSP > | toolConverters () |
| |
| void | useCursor (const QCursor &cursor) |
| |
| KoToolBasePrivate * | d_ptr |
| |
| bool | isActive |
| |
Definition at line 34 of file kis_tool_move.h.
| void KisToolMove::activate |
( |
const QSet< KoShape * > & | shapes | ) |
|
|
overrideslot |
Definition at line 392 of file kis_tool_move.cc.
393{
395
397
406
415
418
424
428
429
431}
void addUniqueConnection(Sender sender, Signal signal, Receiver receiver, Method method)
void addConnection(Sender sender, Signal signal, Receiver receiver, Method method, Qt::ConnectionType type=Qt::AutoConnection)
References KoToolBase::action(), KisToolUtils::MoveShortcutsHelper::activate(), KisTool::activate(), KisSignalAutoConnectionsStore::addConnection(), KisSignalAutoConnectionsStore::addUniqueConnection(), Private::canvas, commitChanges(), m_actionConnections, m_canvasConnections, m_changesTracker, m_moveShortcutsHelper, m_optionsWidget, m_showCoordinatesAction, moveBySpinX(), moveBySpinY(), KisTool::selectedNodes(), setShowCoordinates(), slotMoveDiscreteDown(), slotMoveDiscreteDownMore(), slotMoveDiscreteLeft(), slotMoveDiscreteLeftMore(), slotMoveDiscreteRight(), slotMoveDiscreteRightMore(), slotMoveDiscreteUp(), slotMoveDiscreteUpMore(), slotNodeChanged(), slotSelectionChanged(), and slotTrackerChangedConfig().
| void KisToolMove::resetCursorStyle |
( |
| ) |
|
|
overrideprotectedslot |
noop; whatever the cursor position, we always show move cursor, because we don't use 'layer under cursor' mode for moving selections
we cannot pick layer's pixel data while the stroke is running, because it may run in lodN mode; therefore, we delegate this work to the stroke itself
Definition at line 89 of file kis_tool_move.cc.
90{
92
93 bool canMove = true;
94
106
108 return;
109 }
110 } else {
114
117
118 const bool canUseSelectionMode =
121 !
selection->selectedExactRect().isEmpty();
122
123 if (canUseSelectionMode) {
125 } else {
131
133 canMove = false;
134 }
135 }
136 }
137
138 if (canMove) {
140 } else {
142 }
143}
KisNodeList selectNodesToProcess() const
bool isEditable(bool checkVisibility=true) const
References KisResourcesSnapshot::activeSelection(), KisImage::addJob(), Private::canvas, KisTool::currentNode(), currentOffset(), KisSharedPtr< T >::data(), KisTool::image(), KisTool::isActive, KisBaseNode::isEditable(), m_currentlyUsingSelection, m_currentMode, m_handlesRect, m_lastCursorPos, m_strokeId, MoveSelectedLayer, moveToolMode(), KisTool::resetCursorStyle(), KisTool::selectedNodes(), KoToolBase::selection(), KisNodeSelectionRecipe::selectNodesToProcess(), and KoToolBase::useCursor().
| void KisToolMove::slotStrokeStartedEmpty |
( |
| ) |
|
|
slot |
| bool KisToolMove::startStrokeImpl |
( |
MoveToolMode | mode, |
|
|
const QPoint * | pos ) |
|
private |
Definition at line 145 of file kis_tool_move.cc.
146{
149
153
156
157
158
159 const bool canUseSelectionMode =
162 !
selection->selectedExactRect().isEmpty();
163
164 if (pos) {
165
168 return false;
169 }
170
171
172
179
181 }
182 }
183
185
186
188
189
190 return false;
191 }
192
194
196
197 bool isMoveSelection = false;
198 if (canUseSelectionMode) {
200
206
207 connect(moveStrategy,
208 SIGNAL(sigHandlesRectCalculated(const QRect&)),
210 connect(moveStrategy,
211 SIGNAL(sigStrokeStartedEmpty()),
213
214 strategy = moveStrategy;
215 isMoveSelection = true;
216 nodes = {paintLayer};
217
218 } else {
220 pos ?
224 *pos) :
226
227
230 connect(moveStrategy,
231 SIGNAL(sigHandlesRectCalculated(const QRect&)),
233 connect(moveStrategy,
234 SIGNAL(sigStrokeStartedEmpty()),
236 connect(moveStrategy,
239
240 strategy = moveStrategy;
242 }
243
244 {
245 KConfigGroup group = KSharedConfig::openConfig()->group(
toolId());
246 const bool forceLodMode = group.readEntry("forceLodMode", false);
248 }
249
250
251
259
260 if (!isMoveSelection) {
262 }
263
266 }
268
269 return true;
270}
void startUpdateStream(KisStrokesFacade *strokesFacade, KisStrokeId strokeId)
KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy) override
QRect bounds() const override
KisNodeList selectedNodes
void setForceLodModeIfPossible(bool forceLodModeIfPossible)
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
References KisResourcesSnapshot::activeSelection(), KisImage::bounds(), Private::canvas, commitChanges(), KisTool::currentNode(), currentOffset(), KisSharedPtr< T >::data(), KisWeakSharedPtr< T >::data(), endStroke(), KisTool::image(), KisToolChangesTracker::isEmpty(), KIS_SAFE_ASSERT_RECOVER, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, m_accumulatedOffset, m_asyncUpdateHelper, m_changesTracker, m_currentlyProcessingNodes, m_currentlyUsingSelection, m_currentMode, m_handlesRect, m_moveShortcutsHelper, m_strokeId, KisTool::mode(), MoveSelectedLayer, KisTool::nodeEditable(), KisToolChangesTracker::reset(), KisTool::selectedNodes(), KisNodeSelectionRecipe::selectedNodes, KoToolBase::selection(), KisStrokeStrategy::setForceLodModeIfPossible(), slotHandlesRectCalculated(), slotStrokePickedLayers(), slotStrokeStartedEmpty(), KisToolUtils::MoveShortcutsHelper::startMoveAction(), KisImage::startStroke(), KisAsynchronousStrokeUpdateHelper::startUpdateStream(), and KoToolBase::toolId().