|
Krita Source Code Documentation
|
#include <KarbonCalligraphyTool.h>
Inheritance diagram for KarbonCalligraphyTool:Signals | |
| void | pathSelectedChanged (bool selection) |
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 | |
| void | activate (const QSet< KoShape * > &shapes) override |
| QList< QPointer< QWidget > > | createOptionWidgets () override |
| void | deactivate () override |
| KarbonCalligraphyTool (KoCanvasBase *canvas) | |
| void | mouseMoveEvent (KoPointerEvent *event) override |
| void | mousePressEvent (KoPointerEvent *event) override |
| void | mouseReleaseEvent (KoPointerEvent *event) override |
| void | paint (QPainter &painter, const KoViewConverter &converter) override |
| KisPopupWidgetInterface * | popupWidget () override |
| ~KarbonCalligraphyTool () override | |
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 | deleteSelection () |
| 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 |
| virtual void | mouseDoubleClickEvent (KoPointerEvent *event) |
| virtual void | mouseTripleClickEvent (KoPointerEvent *event) |
| QList< QPointer< QWidget > > | optionWidgets () |
| virtual bool | paste () |
| virtual QMenu * | popupActionsMenu () |
| 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 | |
Private Slots | |
| void | setAngle (int angle) |
| void | setCaps (double caps) |
| void | setDrag (double drag) |
| void | setFixation (double fixation) |
| void | setMass (double mass) |
| void | setStrokeWidth (double width) |
| void | setThinning (double thinning) |
| void | setUseAngle (bool useAngle) |
| void | setUsePath (bool usePath) |
| void | setUsePressure (bool usePressure) |
| void | updateSelectedPath () |
Private Member Functions | |
| void | addPoint (KoPointerEvent *event) |
| qreal | calculateAngle (const QPointF &oldSpeed, const QPointF &newSpeed) |
| QPointF | calculateNewPoint (const QPointF &mousePos, QPointF *speed) |
| qreal | calculateWidth (qreal pressure) |
| void | setAngle (KoPointerEvent *event) |
Private Attributes | |
| qreal | m_angle |
| qreal | m_caps |
| qreal | m_customAngle |
| bool | m_deviceSupportsTilt |
| qreal | m_drag |
| bool | m_endOfPath |
| qreal | m_fixation |
| qreal | m_followPathPosition |
| bool | m_isDrawing |
| QPointF | m_lastMousePos |
| QPointF | m_lastPoint |
| qreal | m_lastWidth |
| qreal | m_mass |
| int | m_pointCount |
| KoPathShape * | m_selectedPath |
| QPainterPath | m_selectedPathOutline |
| KarbonCalligraphicShape * | m_shape |
| QPointF | m_speed |
| qreal | m_strokeWidth |
| qreal | m_thinning |
| bool | m_useAngle |
| bool | m_usePath |
| bool | m_usePressure |
| KarbonCalligraphyOptionWidget * | m_widget {0} |
Additional Inherited Members | |
Public Slots inherited from KoToolBase | |
| virtual void | canvasResourceChanged (int key, const QVariant &res) |
| 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 () |
Protected Member Functions inherited from KoToolBase | |
| virtual QWidget * | createOptionWidget () |
| 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) |
Protected Attributes inherited from KoToolBase | |
| KoToolBasePrivate * | d_ptr |
Definition at line 20 of file KarbonCalligraphyTool.h.
|
explicit |
Definition at line 39 of file KarbonCalligraphyTool.cpp.
References KoToolBase::canvas(), connect(), KoCanvasBase::selectedShapesProxy(), KoToolBase::selectionChanged(), and updateSelectedPath().
|
override |
Definition at line 52 of file KarbonCalligraphyTool.cpp.
This method is called when this tool instance is activated. For any main window there is only one tool active at a time, which then gets all user input. Switching between tools will call deactivate on one and activate on the new tool allowing the tool to flush items (like a selection) when it is not in use.
| shapes | the set of shapes that are selected or suggested for editing by a selected shape for the tool to work on. Not all shapes will be meant for this tool. |
Reimplemented from KoToolBase.
Definition at line 329 of file KarbonCalligraphyTool.cpp.
References KoToolBase::action(), KoToolBase::activate(), connect(), createOptionWidgets(), m_widget, and KoToolBase::useCursor().
|
private |
Definition at line 150 of file KarbonCalligraphyTool.cpp.
References KoShape::absoluteTransformation(), KarbonCalligraphicShape::appendPoint(), calculateAngle(), calculateNewPoint(), calculateWidth(), KoToolBase::canvas(), KarbonCalligraphicShape::lastPieceBoundingRect(), m_deviceSupportsTilt, m_endOfPath, m_followPathPosition, m_lastMousePos, m_lastPoint, m_pointCount, m_selectedPath, m_selectedPathOutline, m_shape, m_speed, m_usePath, KoPathShape::outline(), KoPointerEvent::point, KoPointerEvent::pressure(), setAngle(), and KoCanvasBase::updateCanvas().
|
private |
Definition at line 271 of file KarbonCalligraphyTool.cpp.
References m_angle, m_fixation, M_PI, and qFuzzyCompare().
|
private |
Definition at line 218 of file KarbonCalligraphyTool.cpp.
References m_drag, m_endOfPath, m_followPathPosition, m_lastMousePos, m_lastPoint, m_mass, m_selectedPath, m_selectedPathOutline, m_speed, and m_usePath.
|
private |
Definition at line 247 of file KarbonCalligraphyTool.cpp.
References m_speed, m_strokeWidth, m_thinning, and m_usePressure.
Reimplemented from KoToolBase.
Definition at line 370 of file KarbonCalligraphyTool.cpp.
References connect(), KarbonCalligraphyOptionWidget::emitAll(), m_widget, pathSelectedChanged(), setAngle(), setCaps(), setDrag(), setFixation(), setMass(), setStrokeWidth(), setThinning(), setUseAngle(), setUsePath(), and setUsePressure().
|
overridevirtual |
This method is called whenever this tool is no longer the active tool
Reimplemented from KoToolBase.
Definition at line 353 of file KarbonCalligraphyTool.cpp.
References KoToolBase::action(), and KoToolBase::deactivate().
|
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.
Definition at line 100 of file KarbonCalligraphyTool.cpp.
References addPoint(), and m_isDrawing.
|
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.
Definition at line 84 of file KarbonCalligraphyTool.cpp.
References KoToolBase::canvas(), m_caps, m_isDrawing, m_lastPoint, m_pointCount, m_shape, m_speed, and KoShape::setBackground().
|
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.
Definition at line 109 of file KarbonCalligraphyTool.cpp.
References KoCanvasBase::addCommand(), addPoint(), KoPathShape::boundingRect(), KoToolBase::canvas(), KoSelection::deselectAll(), m_endOfPath, m_isDrawing, m_lastPoint, m_pointCount, m_shape, KoPointerEvent::point, KoSelection::select(), KoShapeManager::selection, KoShapeManager::shapeAt(), KoCanvasBase::shapeController, KoCanvasBase::shapeManager(), KarbonCalligraphicShape::simplifyGuidePath(), and KoCanvasBase::updateCanvas().
|
overridevirtual |
Called by the canvas to paint any decorations that the tool deems needed. The painter has the top left of the canvas as its origin.
| painter | used for painting the shape |
| converter | to convert between internal and view coordinates. |
Implements KoToolBase.
Definition at line 56 of file KarbonCalligraphyTool.cpp.
References KoShape::absoluteTransformation(), KoPathShape::boundingRect(), KoViewConverter::documentToView(), m_selectedPath, m_shape, p1, p2, and KoPathShape::paint().
|
signal |
|
overridevirtual |
popupActionsMenu() does not return null. Reimplemented from KoToolBase.
Definition at line 422 of file KarbonCalligraphyTool.cpp.
|
privateslot |
Definition at line 437 of file KarbonCalligraphyTool.cpp.
References m_customAngle.
|
private |
Definition at line 190 of file KarbonCalligraphyTool.cpp.
References m_angle, m_customAngle, m_deviceSupportsTilt, M_PI, m_useAngle, KoPointerEvent::x(), KoPointerEvent::xTilt(), and KoPointerEvent::yTilt().
|
privateslot |
Definition at line 472 of file KarbonCalligraphyTool.cpp.
References m_caps.
|
privateslot |
Definition at line 452 of file KarbonCalligraphyTool.cpp.
References m_drag.
|
privateslot |
Definition at line 442 of file KarbonCalligraphyTool.cpp.
References m_fixation.
|
privateslot |
Definition at line 447 of file KarbonCalligraphyTool.cpp.
References m_mass.
|
privateslot |
Definition at line 427 of file KarbonCalligraphyTool.cpp.
References m_strokeWidth.
|
privateslot |
Definition at line 432 of file KarbonCalligraphyTool.cpp.
References m_thinning.
|
privateslot |
Definition at line 467 of file KarbonCalligraphyTool.cpp.
References m_useAngle.
|
privateslot |
Definition at line 457 of file KarbonCalligraphyTool.cpp.
References m_usePath.
|
privateslot |
Definition at line 462 of file KarbonCalligraphyTool.cpp.
References m_usePressure.
|
privateslot |
Definition at line 477 of file KarbonCalligraphyTool.cpp.
References KoToolBase::canvas(), m_selectedPath, pathSelectedChanged(), KoShapeManager::selection, KoToolBase::selection(), KoCanvasBase::shapeManager(), and KoPathShape::subpathCount().
|
private |
Definition at line 79 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 82 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 78 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 71 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 84 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 89 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 80 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 88 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 92 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 90 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 67 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 77 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 83 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 93 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 86 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 87 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 68 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 96 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 76 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 81 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 75 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 73 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 74 of file KarbonCalligraphyTool.h.
|
private |
Definition at line 98 of file KarbonCalligraphyTool.h.