|
Krita Source Code Documentation
|
#include <kis_tool.h>
Inheritance diagram for KisTool:Public Types | |
| 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 } |
Public Slots | |
| void | activate (const QSet< KoShape * > &shapes) override |
| void | canvasResourceChanged (int key, const QVariant &res) override |
| void | deactivate () override |
| virtual void | updateSettingsViews () |
Public Slots inherited from KoToolBase | |
| virtual void | activate (const QSet< KoShape * > &shapes) |
| virtual void | canvasResourceChanged (int key, const QVariant &res) |
| virtual void | deactivate () |
| virtual void | documentResourceChanged (int key, const QVariant &res) |
| virtual void | repaintDecorations () |
| virtual void | requestRedoDuringStroke () |
| virtual void | requestStrokeCancellation () |
| virtual void | requestStrokeEnd () |
| virtual void | requestUndoDuringStroke () |
| void | setStatusText (const QString &statusText) |
| void | updateOptionsWidgetIcons () |
Signals | |
| void | isActiveChanged (bool isActivated) |
Signals inherited from KoToolBase | |
| void | activateTool (const QString &id) |
| void | cursorChanged (const QCursor &cursor) |
| void | selectionChanged (bool hasSelection) |
| void | statusTextChanged (const QString &statusText) |
| void | textModeChanged (bool inTextMode) |
Public Member Functions | |
| virtual void | activateAlternateAction (AlternateAction action) |
| virtual void | activatePrimaryAction () |
| virtual bool | alternateActionSupportsHiResEvents (AlternateAction action) const |
| virtual void | beginAlternateAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | beginAlternateDoubleClickAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | beginPrimaryAction (KoPointerEvent *event) |
| virtual void | beginPrimaryDoubleClickAction (KoPointerEvent *event) |
| virtual void | continueAlternateAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | continuePrimaryAction (KoPointerEvent *event) |
| virtual void | deactivateAlternateAction (AlternateAction action) |
| virtual void | deactivatePrimaryAction () |
| void | deleteSelection () override |
| virtual void | endAlternateAction (KoPointerEvent *event, AlternateAction action) |
| virtual void | endPrimaryAction (KoPointerEvent *event) |
| virtual int | flags () const |
| bool | isActive () const |
| KisTool (KoCanvasBase *canvas, const QCursor &cursor) | |
| void | mouseDoubleClickEvent (KoPointerEvent *event) override |
| void | mouseMoveEvent (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 | |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Public Member Functions inherited from KoToolBase | |
| 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 void | paint (QPainter &painter, const KoViewConverter &converter)=0 |
| 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 |
| virtual bool | wantsAutoScroll () const |
| ~KoToolBase () override | |
Static Public Member Functions | |
| static AlternateAction | actionToAlternateAction (ToolAction action) |
Public Attributes | |
| 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} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Protected Types | |
| enum | ToolMode : int { HOVER_MODE , PAINT_MODE , SECONDARY_PAINT_MODE , MIRROR_AXIS_SETUP_MODE , GESTURE_MODE , PAN_MODE , OTHER , OTHER_1 } |
Protected Slots | |
| virtual void | resetCursorStyle () |
Protected Member Functions | |
| 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) |
| QWidget * | createOptionWidget () override |
| 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 () |
Protected Member Functions inherited from KoToolBase | |
| 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) |
Properties | |
| bool | isActive |
Private Attributes | |
| Private *const | d |
Friends | |
| class | KisToolPaintingInformationBuilder |
Additional Inherited Members | |
Protected Attributes inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Definition at line 63 of file kis_tool.cc.
| anonymous enum |
| Enumerator | |
|---|---|
| FLAG_USES_CUSTOM_PRESET | |
| FLAG_USES_CUSTOM_COMPOSITEOP | |
| FLAG_USES_CUSTOM_SIZE | |
Definition at line 47 of file kis_tool.h.
| Enumerator | |
|---|---|
| ChangeSize | |
| ChangeSizeSnap | |
| SampleFgNode | |
| SampleBgNode | |
| SampleFgImage | |
| SampleBgImage | |
| Secondary | |
| Third | |
| Fourth | |
| Fifth | |
| NONE | |
Definition at line 134 of file kis_tool.h.
| Enumerator | |
|---|---|
| VECTOR | |
| CLONE | |
| PAINT | |
| UNPAINTABLE | |
| MYPAINTBRUSH_UNPAINTABLE | |
Definition at line 148 of file kis_tool.h.
| enum KisTool::ToolAction |
Definition at line 117 of file kis_tool.h.
|
protected |
| Enumerator | |
|---|---|
| HOVER_MODE | |
| PAINT_MODE | |
| SECONDARY_PAINT_MODE | |
| MIRROR_AXIS_SETUP_MODE | |
| GESTURE_MODE | |
| PAN_MODE | |
| OTHER | |
| OTHER_1 | |
Definition at line 298 of file kis_tool.h.
| KisTool::KisTool | ( | KoCanvasBase * | canvas, |
| const QCursor & | cursor ) |
Definition at line 78 of file kis_tool.cc.
References connect(), cursor, d, KisConfigNotifier::instance(), isActiveChanged(), and resetCursorStyle().
|
override |
|
static |
Definition at line 416 of file kis_tool.cc.
References KoToolBase::action(), KIS_ASSERT_RECOVER_RETURN_VALUE, Primary, and Secondary.
Definition at line 93 of file kis_tool.cc.
References KoToolBase::activate(), KoCanvasResource::BackgroundColor, Private::canvas, KoCanvasResource::CurrentGeneratorConfiguration, KoCanvasResource::CurrentGradient, KoCanvasResource::CurrentPaintOpPreset, KoCanvasResource::CurrentPattern, d, KoCanvasResource::ForegroundColor, KoCanvasResource::HdrExposure, isActiveChanged(), resetCursorStyle(), and KoCanvasBase::resourceManager.
|
virtual |
Reimplemented in KisToolFreehand, KisToolPaint, KisToolEncloseAndFill, KisToolBasicBrushBase, KisToolLazyBrush, KisToolTransform, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 456 of file kis_tool.cc.
References KoToolBase::action().
|
virtual |
Called by KisToolProxy when the primary action of the tool is going to be started now, that is when all the modifiers are pressed and the only thing left is just to press the mouse button. On coming of this callback the tool is supposed to prepare the cursor and/or the outline to show the user shat is going to happen next
Reimplemented in KisToolPaint, KisToolColorSampler, KisDynamicDelegatedTool< KisToolShape >, KisToolLazyBrush, KisToolSmartPatch, and KisToolTransform.
Definition at line 421 of file kis_tool.cc.
References resetCursorStyle().
|
virtual |
Reimplemented in KisToolSelectOutline.
Definition at line 489 of file kis_tool.cc.
References KoToolBase::action().
|
virtual |
Reimplemented in KisToolFreehand, KisToolPaint, KisToolPolylineBase, KisToolFill, KisToolMove, KisToolMultihand, KisToolEncloseAndFill, KisToolBasicBrushBase, KisToolLazyBrush, KisToolTransform, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, and KisAssistantTool.
Definition at line 466 of file kis_tool.cc.
References KoToolBase::action().
|
virtual |
Reimplemented in KisToolEncloseAndFill.
Definition at line 472 of file kis_tool.cc.
References KoToolBase::action(), and beginAlternateAction().
|
virtual |
Called by KisToolProxy when a primary action for the tool is started. The event stores the original event that started the stroke. The event is accepted by default. If the tool decides to ignore this particular action (e.g. when the node is not editable), it should call event->ignore(). Then no further continuePrimaryAction() or endPrimaryAction() will be called until the next user action.
Reimplemented in KisToolFreehand, KisToolPolylineBase, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KisAssistantTool, KisToolColorSampler, KisToolFill, KisToolGradient, KisToolLine, KisToolMeasure, KisToolMove, KisToolMultihand, KisToolPan, KisToolCrop, KisToolDyna, KisToolEncloseAndFill, KisDynamicDelegatedTool< KisToolShape >, KisToolBasicBrushBase, KisToolLazyBrush, KisToolSmartPatch, and KisToolTransform.
Definition at line 431 of file kis_tool.cc.
|
virtual |
The same as beginPrimaryAction(), but called when the stroke is started by a double-click
Reimplemented in KisToolPolylineBase, KisToolCrop, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 436 of file kis_tool.cc.
References beginPrimaryAction().
|
protected |
Definition at line 632 of file kis_tool.cc.
References KisViewManager::blockUntilOperationsFinished(), Private::canvas, image(), and KisCanvas2::viewManager().
|
protected |
Definition at line 639 of file kis_tool.cc.
References KisViewManager::blockUntilOperationsFinishedForced(), Private::canvas, image(), and KisCanvas2::viewManager().
|
overrideslot |
Definition at line 139 of file kis_tool.cc.
References KoCanvasResource::BackgroundColor, KoCanvasResource::CurrentGeneratorConfiguration, KoCanvasResource::CurrentGradient, KoCanvasResource::CurrentKritaNode, KoCanvasResource::CurrentPattern, d, KoCanvasResource::ForegroundColor, KoCanvasResource::HdrExposure, resetCursorStyle(), and v.
|
virtual |
Reimplemented in KisToolFreehand, KisToolPaint, KisAssistantTool, KisToolFill, KisToolMove, KisToolMultihand, KisToolEncloseAndFill, KisToolBasicBrushBase, KisToolLazyBrush, KisToolTransform, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 477 of file kis_tool.cc.
References KoToolBase::action().
|
virtual |
Called by KisToolProxy when the primary action is in progress of pointer movement. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented in KisToolFreehand, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KisAssistantTool, KisToolColorSampler, KisToolFill, KisToolGradient, KisToolLine, KisToolMeasure, KisToolMove, KisToolMultihand, KisToolPan, KisToolCrop, KisToolDyna, KisDynamicDelegatedTool< KisToolShape >, KisToolBasicBrushBase, KisToolLazyBrush, KisToolSmartPatch, and KisToolTransform.
Definition at line 441 of file kis_tool.cc.
|
protected |
Definition at line 181 of file kis_tool.cc.
References Private::canvas, KisCanvas2::coordinatesConverter, and KisCoordinatesConverter::documentToWidget().
|
protected |
Convert from native (postscript points) to integer image pixel coordinates. This rounds down (not truncate) the pixel coordinates and should be used in preference to QPointF::toPoint(), which rounds, to ensure the cursor acts on the pixel it is visually over.
Definition at line 236 of file kis_tool.cc.
References KisImage::documentToImagePixelFloored(), image(), and KoPointerEvent::point.
|
protected |
Definition at line 197 of file kis_tool.cc.
References KisImage::documentToPixel(), and image().
|
protected |
Convert from native (postscript points) to image pixel coordinates.
Definition at line 189 of file kis_tool.cc.
References KisImage::documentToPixel(), image(), and KoPointerEvent::point.
|
protected |
Definition at line 205 of file kis_tool.cc.
References Private::canvas, KisCanvas2::coordinatesConverter, KisCoordinatesConverter::documentToWidget(), KIS_ASSERT, and KisCoordinatesConverter::widgetToImage().
|
protected |
Definition at line 225 of file kis_tool.cc.
References Private::canvas, KisImage::documentToPixel(), image(), KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
protected |
Definition at line 214 of file kis_tool.cc.
References Private::canvas, KisImage::documentToPixel(), image(), KoPointerEvent::modifiers(), KoPointerEvent::point, KoSnapGuide::snap(), and KoCanvasBase::snapGuide.
|
protected |
Definition at line 252 of file kis_tool.cc.
References image().
|
protected |
Definition at line 263 of file kis_tool.cc.
References image(), value(), KisImage::xRes(), and KisImage::yRes().
|
overrideprotectedvirtual |
Reimplement this if your tool actually has an option widget. Sets the option widget to 0 by default.
Reimplemented from KoToolBase.
Reimplemented in KisToolPaint, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolShape, KisToolBrush, KisToolColorSampler, KisToolFill, KisToolGradient, KisToolLine, KisToolMeasure, KisToolMove, KisToolMultihand, KisToolCrop, KisToolDyna, KisToolEncloseAndFill, KisToolLazyBrush, KisToolPolyline, KisToolSmartPatch, and KisToolTransform.
Definition at line 578 of file kis_tool.cc.
References d.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 370 of file kis_tool.cc.
References Private::canvas, KoCanvasResource::CurrentKritaNode, and KoCanvasBase::resourceManager.
|
protected |
Definition at line 359 of file kis_tool.cc.
References Private::canvas, KoCanvasResource::CurrentPaintOpPreset, KoCanvasBase::resourceManager, and v.
|
protected |
|
protected |
|
overrideslot |
Definition at line 131 of file kis_tool.cc.
References d, KoToolBase::deactivate(), and isActiveChanged().
|
virtual |
Reimplemented in KisToolFreehand, KisToolPaint, KisToolEncloseAndFill, KisToolBasicBrushBase, KisToolLazyBrush, KisToolTransform, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 461 of file kis_tool.cc.
References KoToolBase::action().
|
virtual |
Called by KisToolProxy when the primary is no longer possible to be started now, e.g. when its modifiers and released. The tool is supposed to revert all the preparations it has done in activatePrimaryAction().
Reimplemented in KisToolPaint, KisToolColorSampler, KisDynamicDelegatedTool< KisToolShape >, KisToolLazyBrush, KisToolSmartPatch, and KisToolTransform.
Definition at line 426 of file kis_tool.cc.
References resetCursorStyle().
|
overridevirtual |
Delete the tools selection. The default implementation is empty to aid tools that don't have any selection.
Reimplemented from KoToolBase.
Definition at line 525 of file kis_tool.cc.
References KisResourcesSnapshot::activeSelection(), blockUntilOperationsFinished(), Private::canvas, KisToolUtils::clearImage(), currentNode(), KoToolBase::deleteSelection(), image(), KisResourcesSnapshot::selectedNodes(), and selectedNodes().
|
virtual |
Reimplemented in KisToolFreehand, KisToolPaint, KisAssistantTool, KisToolFill, KisToolMove, KisToolMultihand, KisToolEncloseAndFill, KisToolBasicBrushBase, KisToolLazyBrush, KisToolTransform, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, and KisToolSelectBase< __KisToolSelectRectangularLocal >.
Definition at line 483 of file kis_tool.cc.
References KoToolBase::action().
|
virtual |
Called by KisToolProxy when the primary action is being finished, that is while mouseRelease or tabletRelease event. If the tool has ignored the event in beginPrimaryAction(), this method will not be called.
Reimplemented in KisToolFreehand, KisToolPolylineBase, KisToolRectangleBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KisAssistantTool, KisToolColorSampler, KisToolFill, KisToolGradient, KisToolLine, KisToolMeasure, KisToolMove, KisToolMultihand, KisToolPan, KisToolCrop, KisDynamicDelegatedTool< KisToolShape >, KisToolBasicBrushBase, KisToolLazyBrush, KisToolSmartPatch, and KisToolTransform.
Definition at line 446 of file kis_tool.cc.
|
inlinevirtual |
Reimplemented in KisToolFreehand, KisToolPaint, KisToolShape, KisToolEncloseAndFill, and KisToolSmartPatch.
Definition at line 52 of file kis_tool.h.
|
protected |
Definition at line 332 of file kis_tool.cc.
References Private::canvas, and KisCanvas2::currentImage().
| bool KisTool::isActive | ( | ) | const |
|
signal |
|
protectedvirtual |
To determine whether this tool will change its behavior when modifier keys are pressed
Reimplemented in KisDynamicDelegatedTool< KisToolShape >.
Definition at line 714 of file kis_tool.cc.
|
protectedvirtual |
Request that this tool no longer listen to modifier keys (Responding to the request is optional)
Reimplemented in KisDynamicDelegatedTool< KisToolShape >.
Definition at line 709 of file kis_tool.cc.
|
protectedvirtual |
Reimplemented in KisDynamicDelegatedTool< KisToolShape >.
Definition at line 407 of file kis_tool.cc.
References d.
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is double clicked. Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this mouse or stylus press |
Reimplemented from KoToolBase.
Definition at line 500 of file kis_tool.cc.
|
overridevirtual |
Called when the mouse or stylus moved over the canvas. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus move |
Implements KoToolBase.
Reimplemented in KisToolCrop, KisToolTransform, KisToolFreehand, KisToolPaint, KisToolPolylineBase, KisToolSelectBase< __KisToolSelectEllipticalLocal >, KisToolSelectBase< __KisToolSelectOutlineLocal >, KisToolSelectBase< __KisToolSelectPolygonalLocal >, KisToolSelectBase< __KisToolSelectRectangularLocal >, KisToolOutlineBase, KisToolColorSampler, KisToolMove, KisToolMultihand, and KisToolBasicBrushBase.
Definition at line 520 of file kis_tool.cc.
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is pressed. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus press |
Implements KoToolBase.
Reimplemented in KisToolTransform, and KisToolPaint.
Definition at line 510 of file kis_tool.cc.
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is released. Implementors should call event->ignore() if they do not actually use the event.
| event | state and reason of this mouse or stylus release |
Implements KoToolBase.
Reimplemented in KisToolTransform, and KisToolPaint.
Definition at line 515 of file kis_tool.cc.
|
overridevirtual |
Called when (one of) the mouse or stylus buttons is triple clicked. Implementors should call event->ignore() if they do not actually use the event. Default implementation ignores this event.
| event | state and reason of this mouse or stylus press |
Reimplemented from KoToolBase.
Definition at line 505 of file kis_tool.cc.
References mouseDoubleClickEvent().
|
virtual |
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.
This is currently implemented by the Transform tool to paste an image into the current layer and transform it.
Reimplemented in KisDynamicDelegatedTool< KisToolShape >, and KisToolTransform.
Definition at line 573 of file kis_tool.cc.
|
protected |
Checks checks if the current node is editable.
Definition at line 651 of file kis_tool.cc.
References Private::canvas, currentNode(), currentPaintOpPreset(), KisSharedPtr< T >::data(), KisBaseNode::isEditable(), KisIconUtils::loadIcon(), nodeEditable(), KisViewManager::showFloatingMessage(), KisIndirectPaintingSupport::supportsNonIndirectPainting(), KisBaseNode::userLocked(), KisCanvas2::viewManager(), and KisBaseNode::visible().
| KisTool::NodePaintAbility KisTool::nodePaintAbility | ( | ) |
Definition at line 539 of file kis_tool.cc.
References Private::canvas, CLONE, KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), currentNode(), KoCanvasResource::CurrentPaintOpPreset, currentPaintOpPreset(), MYPAINTBRUSH_UNPAINTABLE, PAINT, KisBaseNode::paintDevice(), KoCanvasBase::resourceManager, RGBAColorModelID, UNPAINTABLE, and VECTOR.
|
protected |
Override the cursor appropriately if current node is not editable.
Definition at line 618 of file kis_tool.cc.
References Private::canvas, currentNode(), isActive, KisBaseNode::isEditable(), and KisCanvas2::setCursor().
|
protected |
paint the path which is in view coordinates, default paint mode is XOR_MODE, BW_MODE is also possible never apply transformations to the painter, they would be useless, if drawing in OpenGL mode. The coordinates in the path should be in view coordinates.
Definition at line 589 of file kis_tool.cc.
References Private::canvas, KisCanvas2::canvasWidget, KoToolBase::decorationThickness(), p, and KisOpenGLCanvas2::paintToolOutline().
|
protected |
Definition at line 304 of file kis_tool.cc.
References Private::canvas, KisCanvas2::coordinatesConverter, KisCoordinatesConverter::documentToFlakeTransform(), KisCoordinatesConverter::imageToDocumentTransform(), and KIS_ASSERT.
|
protected |
Convert a pixel path into a view path.
Definition at line 295 of file kis_tool.cc.
References Private::canvas, image(), KisCanvas2::viewConverter(), and KoViewConverter::zoom().
|
protected |
Convert an integer pixel coordinate into a view coordinate. The view coordinate is at the centre of the pixel.
Definition at line 269 of file kis_tool.cc.
References Private::canvas, KoViewConverter::documentToView(), image(), KisImage::pixelToDocument(), and KisCanvas2::viewConverter().
|
protected |
Convert a floating point pixel coordinate into a view coordinate.
Definition at line 277 of file kis_tool.cc.
References Private::canvas, KoViewConverter::documentToView(), image(), KisImage::pixelToDocument(), and KisCanvas2::viewConverter().
|
protected |
Convert a pixel polygon into a view path.
Definition at line 313 of file kis_tool.cc.
References Private::canvas, image(), KisCanvas2::viewConverter(), and KoViewConverter::zoom().
|
protected |
Convert a pixel rectangle into a view rectangle.
Definition at line 285 of file kis_tool.cc.
References image(), and pixelToView().
|
virtual |
Returns true if the tool can handle (and wants to handle) a very tight flow of input events from the tablet
Reimplemented in KisToolFreehand, KisToolLine, KisToolSelectOutline, and KisDynamicDelegatedTool< KisToolShape >.
Definition at line 451 of file kis_tool.cc.
|
protectedvirtualslot |
Called whenever the configuration settings change.
Reimplemented in KisToolSelectElliptical, KisToolSelectOutline, KisToolSelectPolygonal, and KisToolSelectRectangular.
Definition at line 613 of file kis_tool.cc.
References d, and KoToolBase::useCursor().
|
protected |
Definition at line 376 of file kis_tool.cc.
References Private::canvas, KisViewManager::nodeManager(), KisNodeManager::selectedNodes(), and KisCanvas2::viewManager().
|
protected |
Checks checks if the selection is editable, only applies to local selection as global selection is always editable.
Definition at line 696 of file kis_tool.cc.
References Private::canvas, KisIconUtils::loadIcon(), KisViewManager::selectionEditable(), KisViewManager::showFloatingMessage(), and KisCanvas2::viewManager().
|
protected |
|
virtual |
Reimplemented in KisToolFreehand, KisToolEllipse, KisToolLine, KisToolRectangle, KisToolPolygon, and KisToolPolyline.
Definition at line 495 of file kis_tool.cc.
|
protected |
Update the canvas for the given rectangle in image pixel coordinates.
Definition at line 322 of file kis_tool.cc.
References Private::canvas, convertToPt(), and KisCanvas2::updateCanvas().
|
protected |
Update the canvas for the given rectangle in view coordinates.
Definition at line 327 of file kis_tool.cc.
References Private::canvas, and KisCanvas2::updateCanvas().
|
virtualslot |
Definition at line 168 of file kis_tool.cc.
|
protected |
Definition at line 244 of file kis_tool.cc.
References Private::canvas, KisImage::documentToPixel(), and image().
|
protected |
Definition at line 172 of file kis_tool.cc.
References Private::canvas, KisCanvas2::coordinatesConverter, KisCoordinatesConverter::flakeCenterPoint(), and KisCoordinatesConverter::flakeToWidget().
|
friend |
Definition at line 204 of file kis_tool.h.
| KoColor KisTool::currentBgColor |
Definition at line 70 of file kis_tool.cc.
| float KisTool::currentExposure {1.0} |
Definition at line 71 of file kis_tool.cc.
| KoColor KisTool::currentFgColor |
Definition at line 69 of file kis_tool.cc.
| KisFilterConfigurationSP KisTool::currentGenerator |
Definition at line 72 of file kis_tool.cc.
| KoAbstractGradientSP KisTool::currentGradient |
Definition at line 68 of file kis_tool.cc.
| KoPatternSP KisTool::currentPattern |
Definition at line 67 of file kis_tool.cc.
| QCursor KisTool::cursor |
Definition at line 64 of file kis_tool.cc.
|
private |
Definition at line 321 of file kis_tool.h.
| bool KisTool::m_isActive {false} |
Definition at line 75 of file kis_tool.cc.
| ToolMode KisTool::m_mode {HOVER_MODE} |
Definition at line 74 of file kis_tool.cc.
| QWidget* KisTool::optionWidget {0} |
Definition at line 73 of file kis_tool.cc.
|
read |
Definition at line 44 of file kis_tool.h.