|
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 canvas(), d, KoToolManager::instance(), KoToolManager::priv(), and KoToolProxyPrivate::scrollTimer.
|
override |
|
protected |
Definition at line 143 of file KoToolProxy.cpp.
References KoCanvasController::canvas(), KoToolProxyPrivate::controller, and d.
| void KoToolProxy::copy | ( | ) | const |
Forwarded to the current KoToolBase.
Definition at line 470 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolBase::copy(), and d.
|
private |
Definition at line 153 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 464 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolBase::cut(), d, and KoToolProxyPrivate::isActiveLayerEditable().
| void KoToolProxy::deleteSelection | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 522 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::deleteSelection().
| void KoToolProxy::deselect | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 498 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 510 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 504 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 516 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::dropEvent().
| void KoToolProxy::explicitUserStrokeEndRequest | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 345 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::explicitUserStrokeEndRequest().
| void KoToolProxy::focusInEvent | ( | QFocusEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 364 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::focusInEvent().
| void KoToolProxy::focusOutEvent | ( | QFocusEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 369 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 459 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::hasSelection().
| void KoToolProxy::inputMethodEvent | ( | QInputMethodEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 359 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 352 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::inputMethodQuery().
| void KoToolProxy::keyPressEvent | ( | QKeyEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 327 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::keyPressEvent().
| void KoToolProxy::keyReleaseEvent | ( | QKeyEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 335 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isToolPressed, and KoToolBase::keyReleaseEvent().
| KoPointerEvent * KoToolProxy::lastDeliveredPointerEvent | ( | ) | const |
Definition at line 444 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::lastPointerEvent.
| void KoToolProxy::mouseDoubleClickEvent | ( | KoPointerEvent * | event | ) |
Definition at line 273 of file KoToolProxy.cpp.
References mousePressEvent().
| void KoToolProxy::mouseDoubleClickEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 266 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseDoubleClickEvent().
| void KoToolProxy::mouseMoveEvent | ( | KoPointerEvent * | event | ) |
Definition at line 286 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolProxyPrivate::checkAutoScroll(), d, KoToolManager::instance(), KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseMoveEvent(), and KoToolManager::priv().
| void KoToolProxy::mouseMoveEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 279 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseMoveEvent().
| void KoToolProxy::mousePressEvent | ( | KoPointerEvent * | event | ) |
Definition at line 231 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, countMultiClick(), d, KoToolManager::instance(), KoToolProxyPrivate::isToolPressed, KoToolProxyPrivate::mouseDownPoint, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseReleaseEvent(), mouseReleaseEvent(), KoPointerEvent::pos(), KoToolManager::priv(), and KoToolProxyPrivate::scrollTimer.
| void KoToolProxy::mousePressEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 259 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mousePressEvent().
| void KoToolProxy::mouseReleaseEvent | ( | KoPointerEvent * | event | ) |
Definition at line 311 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolManager::instance(), KoToolProxyPrivate::isToolPressed, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseReleaseEvent(), KoToolManager::priv(), and KoToolProxyPrivate::scrollTimer.
| void KoToolProxy::mouseReleaseEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 304 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseReleaseEvent().
|
protected |
Definition at line 148 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 133 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::paint().
| bool KoToolProxy::paste | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 476 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isActiveLayerEditable(), and KoToolBase::paste().
| QMenu * KoToolProxy::popupActionsMenu | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 374 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::popupActionsMenu().
| KisPopupWidgetInterface * KoToolProxy::popupWidget | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 379 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 528 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::isInTextMode().
| void KoToolProxy::repaintDecorations | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 138 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::repaintDecorations().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 552 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestRedoDuringStroke().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 559 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestStrokeCancellation().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 566 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestStrokeEnd().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 545 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestUndoDuringStroke().
| bool KoToolProxy::selectAll | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 487 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 384 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 199 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolProxyPrivate::checkAutoScroll(), KoInputDevice::convertDeviceType(), KoInputDevice::convertPointerType(), countMultiClick(), d, KoPointerEvent::deepCopyEvent(), KoToolManager::instance(), KoToolProxyPrivate::lastPointerEvent, KoToolProxyPrivate::mouseLeaveWorkaround, KoToolBase::mouseMoveEvent(), KoToolBase::mouseReleaseEvent(), KoToolManager::priv(), and KoToolProxyPrivate::scrollTimer.
|
signal |
Emitted every time a tool is changed.
| toolId | the id of the tool. |
| QVector< QKeySequence > KoToolProxy::toolPriorityShortcuts | ( | ) | const |
Definition at line 449 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::toolPriorityShortcuts.
| void KoToolProxy::touchEvent | ( | QTouchEvent * | event, |
| const QPointF & | point ) |
Definition at line 419 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.