|
Krita Source Code Documentation
|
#include <KoToolProxy.h>
Inheritance diagram for KoToolProxy:Signals | |
| void | selectionChanged (bool hasSelection) |
| void | toolChanged (const QString &toolId) |
Public Member Functions | |
| void | copy () const |
| Forwarded to the current KoToolBase. | |
| void | cut () |
| Forwarded to the current KoToolBase. | |
| void | deleteSelection () |
| Forwarded to the current KoToolBase. | |
| void | deselect () |
| Forwarded to the current KoToolBase. | |
| void | dragLeaveEvent (QDragLeaveEvent *event) |
| Forwarded to the current KoToolBase. | |
| void | dragMoveEvent (QDragMoveEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| void | dropEvent (QDropEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| void | explicitUserStrokeEndRequest () |
| Forwarded to the current KoToolBase. | |
| void | focusInEvent (QFocusEvent *event) |
| Forwarded to the current KoToolBase. | |
| void | focusOutEvent (QFocusEvent *event) |
| Forwarded to the current KoToolBase. | |
| bool | hasSelection () const |
| returns true if the current tool holds a selection | |
| void | inputMethodEvent (QInputMethodEvent *event) |
| Forwarded to the current KoToolBase. | |
| QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
| Forwarded to the current KoToolBase. | |
| void | keyPressEvent (QKeyEvent *event) |
| Forwarded to the current KoToolBase. | |
| void | keyReleaseEvent (QKeyEvent *event) |
| Forwarded to the current KoToolBase. | |
| KoToolProxy (KoCanvasBase *canvas, QObject *parent=0) | |
| KoPointerEvent * | lastDeliveredPointerEvent () const |
| void | mouseDoubleClickEvent (KoPointerEvent *event) |
| void | mouseDoubleClickEvent (QMouseEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| void | mouseMoveEvent (KoPointerEvent *event) |
| void | mouseMoveEvent (QMouseEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| void | mousePressEvent (KoPointerEvent *event) |
| void | mousePressEvent (QMouseEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| void | mouseReleaseEvent (KoPointerEvent *event) |
| void | mouseReleaseEvent (QMouseEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| void | paint (QPainter &painter, const KoViewConverter &converter) |
| Forwarded to the current KoToolBase. | |
| bool | paste () |
| Forwarded to the current KoToolBase. | |
| QMenu * | popupActionsMenu () |
| Forwarded to the current KoToolBase. | |
| KisPopupWidgetInterface * | popupWidget () |
| Forwarded to the current KoToolBase. | |
| KoToolProxyPrivate * | priv () |
| void | processEvent (QEvent *) const |
| void | repaintDecorations () |
| Forwarded to the current KoToolBase. | |
| bool | selectAll () |
| Forwarded to the current KoToolBase. | |
| virtual void | setActiveTool (KoToolBase *tool) |
| Set the new active tool. | |
| void | tabletEvent (QTabletEvent *event, const QPointF &point) |
| Forwarded to the current KoToolBase. | |
| QVector< QKeySequence > | toolPriorityShortcuts () const |
| void | touchEvent (QTouchEvent *event, const QPointF &point) |
| ~KoToolProxy () override | |
Protected Slots | |
| void | requestRedoDuringStroke () |
| Forwarded to the current KoToolBase. | |
| void | requestStrokeCancellation () |
| Forwarded to the current KoToolBase. | |
| void | requestStrokeEnd () |
| Forwarded to the current KoToolBase. | |
| void | requestUndoDuringStroke () |
| Forwarded to the current KoToolBase. | |
Protected Member Functions | |
| KoCanvasBase * | canvas () const |
| virtual QPointF | documentToWidget (const QPointF &documentPoint) const =0 |
| int | multiClickCount () const |
| virtual QPointF | widgetToDocument (const QPointF &widgetPoint) const =0 |
Private Member Functions | |
| void | countMultiClick (KoPointerEvent *ev, int eventType) |
Private Attributes | |
| KoToolProxyPrivate *const | d |
Friends | |
| class | KoToolProxyPrivate |
Tool proxy object which allows an application to address the current tool.
Applications typically have a canvas and a canvas requires a tool for the user to do anything. Since the flake system is responsible for handling tools and also to change the active tool when needed we provide one class that can be used by an application canvas to route all the native events too which will transparently be routed to the active tool. Without the application having to bother about which tool is active.
Definition at line 47 of file KoToolProxy.h.
|
explicit |
Constructor
| canvas | Each canvas has 1 toolProxy. Pass the parent here. |
| parent | a parent QObject for memory management purposes. |
Definition at line 119 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::scrollTimer.
|
override |
|
protected |
Definition at line 141 of file KoToolProxy.cpp.
References KoCanvasController::canvas(), KoToolProxyPrivate::controller, and d.
| void KoToolProxy::copy | ( | ) | const |
Forwarded to the current KoToolBase.
Definition at line 468 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolBase::copy(), and d.
|
private |
Definition at line 151 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoPointerEvent::globalPos(), KoPointerEvent::ignore(), KoToolBase::mouseDoubleClickEvent(), KoToolBase::mousePressEvent(), KoToolBase::mouseTripleClickEvent(), KoToolProxyPrivate::multiClickCount, KoToolProxyPrivate::multiClickGlobalPoint, KoToolProxyPrivate::multiClickSource, and KoToolProxyPrivate::multiClickTimeStamp.
| void KoToolProxy::cut | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 462 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolBase::cut(), d, and KoToolProxyPrivate::isActiveLayerEditable().
| void KoToolProxy::deleteSelection | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 520 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::deleteSelection().
| void KoToolProxy::deselect | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 496 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::deselect().
|
protectedpure virtual |
Implemented in KisToolProxy.
| void KoToolProxy::dragLeaveEvent | ( | QDragLeaveEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 508 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::dragLeaveEvent().
| void KoToolProxy::dragMoveEvent | ( | QDragMoveEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 502 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::dragMoveEvent().
| void KoToolProxy::dropEvent | ( | QDropEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 514 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::dropEvent().
| void KoToolProxy::explicitUserStrokeEndRequest | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 343 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::explicitUserStrokeEndRequest().
| void KoToolProxy::focusInEvent | ( | QFocusEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 362 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::focusInEvent().
| void KoToolProxy::focusOutEvent | ( | QFocusEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 367 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::focusOutEvent().
| bool KoToolProxy::hasSelection | ( | ) | const |
returns true if the current tool holds a selection
Definition at line 457 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::hasSelection().
| void KoToolProxy::inputMethodEvent | ( | QInputMethodEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 357 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::inputMethodEvent().
| QVariant KoToolProxy::inputMethodQuery | ( | Qt::InputMethodQuery | query | ) | const |
Forwarded to the current KoToolBase.
Definition at line 350 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::inputMethodQuery().
| void KoToolProxy::keyPressEvent | ( | QKeyEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 325 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::keyPressEvent().
| void KoToolProxy::keyReleaseEvent | ( | QKeyEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 333 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isToolPressed, and KoToolBase::keyReleaseEvent().
| KoPointerEvent * KoToolProxy::lastDeliveredPointerEvent | ( | ) | const |
Definition at line 442 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::lastPointerEvent.
| void KoToolProxy::mouseDoubleClickEvent | ( | KoPointerEvent * | event | ) |
Definition at line 271 of file KoToolProxy.cpp.
References mousePressEvent().
| void KoToolProxy::mouseDoubleClickEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 264 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseDoubleClickEvent().
| void KoToolProxy::mouseMoveEvent | ( | KoPointerEvent * | event | ) |
Definition at line 284 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolProxyPrivate::checkAutoScroll(), KoToolProxyPrivate::controller, d, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseMoveEvent(), and KoCanvasController::toolManager.
| void KoToolProxy::mouseMoveEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 277 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseMoveEvent().
| void KoToolProxy::mousePressEvent | ( | KoPointerEvent * | event | ) |
Definition at line 229 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolProxyPrivate::controller, countMultiClick(), d, KoToolProxyPrivate::isToolPressed, KoToolProxyPrivate::mouseDownPoint, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseReleaseEvent(), mouseReleaseEvent(), KoPointerEvent::pos(), KoToolProxyPrivate::scrollTimer, and KoCanvasController::toolManager.
| void KoToolProxy::mousePressEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 257 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mousePressEvent().
| void KoToolProxy::mouseReleaseEvent | ( | KoPointerEvent * | event | ) |
Definition at line 309 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolProxyPrivate::controller, d, KoToolProxyPrivate::isToolPressed, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseReleaseEvent(), KoToolProxyPrivate::scrollTimer, and KoCanvasController::toolManager.
| void KoToolProxy::mouseReleaseEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 302 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseReleaseEvent().
|
protected |
Definition at line 146 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::multiClickCount.
| void KoToolProxy::paint | ( | QPainter & | painter, |
| const KoViewConverter & | converter ) |
Forwarded to the current KoToolBase.
Definition at line 131 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::paint().
| bool KoToolProxy::paste | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 474 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isActiveLayerEditable(), and KoToolBase::paste().
| QMenu * KoToolProxy::popupActionsMenu | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 372 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::popupActionsMenu().
| KisPopupWidgetInterface * KoToolProxy::popupWidget | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 377 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::popupWidget().
| KoToolProxyPrivate * KoToolProxy::priv | ( | ) |
| void KoToolProxy::processEvent | ( | QEvent * | e | ) | const |
This method gives the proxy a chance to do things. for example it is need to have working singlekey shortcuts. call it from the canvas' event function and forward it to QWidget::event() later.
Definition at line 526 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::isInTextMode().
| void KoToolProxy::repaintDecorations | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 136 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::repaintDecorations().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 550 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestRedoDuringStroke().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 557 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestStrokeCancellation().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 564 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestStrokeEnd().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 543 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestUndoDuringStroke().
| bool KoToolProxy::selectAll | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 485 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isActiveLayerEditable(), and KoToolBase::selectAll().
|
signal |
A tool can have a selection that is copy-able, this signal is emitted when that status changes.
| hasSelection | is true when the tool holds selected data. |
|
virtual |
Set the new active tool.
Reimplemented in KisToolProxy.
Definition at line 382 of file KoToolProxy.cpp.
References KoCanvasController::actionCollection, KisKActionCollection::actions(), KoToolProxyPrivate::activeTool, KoToolProxyPrivate::controller, d, hasSelection(), KIS_SAFE_ASSERT_RECOVER_NOOP, selectionChanged(), KoToolProxyPrivate::selectionChanged(), toolChanged(), KoToolBase::toolId(), and KoToolProxyPrivate::toolPriorityShortcuts.
| void KoToolProxy::tabletEvent | ( | QTabletEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 197 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolProxyPrivate::checkAutoScroll(), KoToolProxyPrivate::controller, KoInputDevice::convertDeviceType(), KoInputDevice::convertPointerType(), countMultiClick(), d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseMoveEvent(), KoToolBase::mouseReleaseEvent(), KoToolProxyPrivate::scrollTimer, and KoCanvasController::toolManager.
|
signal |
Emitted every time a tool is changed.
| toolId | the id of the tool. |
| QVector< QKeySequence > KoToolProxy::toolPriorityShortcuts | ( | ) | const |
Definition at line 447 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::toolPriorityShortcuts.
| void KoToolProxy::touchEvent | ( | QTouchEvent * | event, |
| const QPointF & | point ) |
Definition at line 417 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, countMultiClick(), d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, KoToolBase::mouseMoveEvent(), and KoToolBase::mouseReleaseEvent().
|
protectedpure virtual |
Implemented in KisToolProxy.
|
friend |
Definition at line 196 of file KoToolProxy.h.
|
private |
Definition at line 197 of file KoToolProxy.h.