|
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 |
| 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 101 of file KoToolProxy.cpp.
References canvas(), connect(), d, KoToolManager::instance(), KoToolManager::priv(), and KoToolProxyPrivate::scrollTimer.
|
override |
|
protected |
Definition at line 125 of file KoToolProxy.cpp.
References KoCanvasController::canvas(), KoToolProxyPrivate::controller, and d.
| void KoToolProxy::copy | ( | ) | const |
Forwarded to the current KoToolBase.
Definition at line 447 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolBase::copy(), and d.
|
private |
Definition at line 130 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 441 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, KoToolBase::cut(), d, and KoToolProxyPrivate::isActiveLayerEditable().
| void KoToolProxy::deleteSelection | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 499 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::deleteSelection().
| void KoToolProxy::deselect | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 475 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 487 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 481 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 493 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::dropEvent().
| void KoToolProxy::explicitUserStrokeEndRequest | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 322 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::explicitUserStrokeEndRequest().
| void KoToolProxy::focusInEvent | ( | QFocusEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 341 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::focusInEvent().
| void KoToolProxy::focusOutEvent | ( | QFocusEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 346 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 436 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::hasSelection().
| void KoToolProxy::inputMethodEvent | ( | QInputMethodEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 336 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 329 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::inputMethodQuery().
| void KoToolProxy::keyPressEvent | ( | QKeyEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 304 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::keyPressEvent().
| void KoToolProxy::keyReleaseEvent | ( | QKeyEvent * | event | ) |
Forwarded to the current KoToolBase.
Definition at line 312 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isToolPressed, and KoToolBase::keyReleaseEvent().
| KoPointerEvent * KoToolProxy::lastDeliveredPointerEvent | ( | ) | const |
Definition at line 421 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::lastPointerEvent.
| void KoToolProxy::mouseDoubleClickEvent | ( | KoPointerEvent * | event | ) |
Definition at line 250 of file KoToolProxy.cpp.
References mousePressEvent().
| void KoToolProxy::mouseDoubleClickEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Forwarded to the current KoToolBase.
Definition at line 243 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseDoubleClickEvent().
| void KoToolProxy::mouseMoveEvent | ( | KoPointerEvent * | event | ) |
Definition at line 263 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 256 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseMoveEvent().
| void KoToolProxy::mousePressEvent | ( | KoPointerEvent * | event | ) |
Definition at line 208 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 236 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mousePressEvent().
| void KoToolProxy::mouseReleaseEvent | ( | KoPointerEvent * | event | ) |
Definition at line 288 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 281 of file KoToolProxy.cpp.
References d, KoPointerEvent::deepCopyEvent(), KoToolProxyPrivate::lastPointerEvent, and mouseReleaseEvent().
| void KoToolProxy::paint | ( | QPainter & | painter, |
| const KoViewConverter & | converter ) |
Forwarded to the current KoToolBase.
Definition at line 115 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::paint().
| bool KoToolProxy::paste | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 453 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, KoToolProxyPrivate::isActiveLayerEditable(), and KoToolBase::paste().
| QMenu * KoToolProxy::popupActionsMenu | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 351 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::popupActionsMenu().
| KisPopupWidgetInterface * KoToolProxy::popupWidget | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 356 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 505 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::isInTextMode().
| void KoToolProxy::repaintDecorations | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 120 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::repaintDecorations().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 529 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestRedoDuringStroke().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 536 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestStrokeCancellation().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 543 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestStrokeEnd().
|
protectedslot |
Forwarded to the current KoToolBase.
Definition at line 522 of file KoToolProxy.cpp.
References KoToolProxyPrivate::activeTool, d, and KoToolBase::requestUndoDuringStroke().
| bool KoToolProxy::selectAll | ( | ) |
Forwarded to the current KoToolBase.
Definition at line 464 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 361 of file KoToolProxy.cpp.
References KoCanvasController::actionCollection, KisKActionCollection::actions(), KoToolProxyPrivate::activeTool, connect(), 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 176 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 426 of file KoToolProxy.cpp.
References d, and KoToolProxyPrivate::toolPriorityShortcuts.
| void KoToolProxy::touchEvent | ( | QTouchEvent * | event, |
| const QPointF & | point ) |
Definition at line 396 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.