|
Krita Source Code Documentation
|
#include <kis_canvas_controller.h>
Inheritance diagram for KisCanvasController:Classes | |
| struct | Private |
Public Slots | |
| void | beginCanvasRotation () |
| void | endCanvasRotation () |
| void | mirrorCanvas (bool enable) |
| void | mirrorCanvasAroundCanvas (bool enable) |
| void | mirrorCanvasAroundCursor (bool enable) |
| void | resetCanvasRotation () |
| void | rotateCanvas (qreal angle) |
| void | rotateCanvasLeft15 () |
| void | rotateCanvasRight15 () |
| qreal | rotation () const |
| void | setUsePrintResolutionMode (bool value) |
| void | slotSetWrapAroundModeAxis (WrapAroundAxis axis) |
| void | slotSetWrapAroundModeAxisH () |
| void | slotSetWrapAroundModeAxisHV () |
| void | slotSetWrapAroundModeAxisV () |
| void | slotToggleLevelOfDetailMode (bool value) |
| void | slotTogglePixelGrid (bool value) |
| void | slotToggleWrapAroundMode (bool value) |
Signals | |
| void | documentSizeChanged () |
| void | sigUsePrintResolutionModeChanged (bool value) |
Public Member Functions | |
| void | activate () override |
| Reimplemented from KoCanvasController. | |
| KisCanvasState | canvasState () const override |
| QPointF | currentCursorPosition () const override |
| qreal | effectiveCanvasResolutionX () const |
| qreal | effectiveCanvasResolutionY () const |
| void | ensureVisibleDoc (const QRectF &docRect, bool smooth) override |
| Scrolls the content of the canvas so that the given rect is visible. | |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| void | keyPressEvent (QKeyEvent *event) override |
| KisCanvasController (QPointer< KisView >parent, KoCanvasSupervisor *observerProvider, KisKActionCollection *actionCollection) | |
| bool | levelOfDetailMode () const |
| QPointF | preferredCenter () const override |
| Returns the currently set preferred center point in view coordinates (pixels) | |
| void | resetScrollBars () override |
| void | restoreCanvasState (const KisPropertiesConfiguration &config) |
| void | rotateCanvas (qreal angle, const std::optional< KoViewTransformStillPoint > &stillPoint, bool isNativeGesture=false) |
| void | saveCanvasState (KisPropertiesConfiguration &config) const |
| void | setCanvas (KoCanvasBase *canvas) override |
| void | setPreferredCenter (const QPointF &viewPoint) override |
| void | syncOnImageResolutionChange () |
| void | syncOnImageSizeChange (const QPointF &oldStillPoint, const QPointF &newStillPoint) |
| void | syncOnReferencesChange (const QRectF &referencesRect) |
| void | updateScreenResolution (QWidget *parentWidget) |
| bool | usePrintResolutionMode () |
| void | wheelEvent (QWheelEvent *event) override |
| bool | wrapAroundMode () const |
| WrapAroundAxis | wrapAroundModeAxis () const |
| void | zoomIn () override |
| void | zoomIn (const KoViewTransformStillPoint &widgetStillPoint) override |
zooms in keeping stillPoint not moved. | |
| void | zoomOut () override |
| void | zoomOut (const KoViewTransformStillPoint &widgetStillPoint) override |
zooms out keeping stillPoint not moved. | |
| KoZoomState | zoomState () const override |
| ~KisCanvasController () override | |
Public Member Functions inherited from KoCanvasControllerWidget | |
| void | activate () |
| KoCanvasBase * | canvas () const override |
| virtual void | changeCanvasWidget (QWidget *widget) |
| KoCanvasControllerWidget (KisKActionCollection *actionCollection, KoCanvasSupervisor *observerProvider, QWidget *parent=0) | |
| void | pan (const QPoint &distance) override |
| virtual void | panDown () override |
| virtual void | panLeft () override |
| virtual void | panRight () override |
| virtual void | panUp () override |
| KoCanvasControllerWidget::Private * | priv () |
| Private (KoCanvasControllerWidget *qq, KoCanvasSupervisor *observerProvider) | |
| QPoint | scrollBarValue () const override |
| void | scrollContentsBy (int dx, int dy) override |
| void | setCanvas (KoCanvasBase *canvas) override |
| void | setScrollBarValue (const QPoint &value) override |
| void | setToolOptionWidgets (const QList< QPointer< QWidget > > &widgets) |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom) override |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom, const KoViewTransformStillPoint &stillPoint) |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom, qreal resolutionX, qreal resolutionY) |
| void | setZoom (KoZoomMode::Mode mode, qreal zoom, qreal resolutionX, qreal resolutionY, const std::optional< KoViewTransformStillPoint > &docStillPoint) |
| void | unsetCanvas () |
| void | zoomTo (const QRect &rect) override |
| zoom so that rect is exactly visible (as close as possible) | |
| ~KoCanvasControllerWidget () override | |
Public Member Functions inherited from KoCanvasController | |
| KisKActionCollection * | actionCollection () const |
| KoCanvasController (KisKActionCollection *actionCollection) | |
| Private () | |
| virtual | ~KoCanvasController () |
Protected Member Functions | |
| void | updateCanvasOffsetInternal (const QPointF &newOffset) override |
| void | updateCanvasWidgetSizeInternal (const QSize &newSize) override |
| void | updateCanvasZoomInternal (KoZoomMode::Mode mode, qreal zoom, qreal resolutionX, qreal resolutionY, const std::optional< KoViewTransformStillPoint > &docStillPoint) override |
| void | zoomToInternal (const QRect &viewRect) override |
Protected Member Functions inherited from KoCanvasControllerWidget | |
| void | dragEnterEvent (QDragEnterEvent *event) override |
| reimplemented from QWidget | |
| void | dragLeaveEvent (QDragLeaveEvent *event) override |
| reimplemented from QWidget | |
| void | dragMoveEvent (QDragMoveEvent *event) override |
| reimplemented from QWidget | |
| void | dropEvent (QDropEvent *event) override |
| reimplemented from QWidget | |
| void | emitSignals (const KisCanvasState &oldState, const KisCanvasState &newState) |
| bool | focusNextPrevChild (bool next) override |
| reimplemented from QWidget | |
| void | paintEvent (QPaintEvent *event) override |
| reimplemented from QWidget | |
| void | resizeEvent (QResizeEvent *resizeEvent) override |
| reimplemented from QWidget | |
| bool | viewportEvent (QEvent *event) override |
| reimplemented from QAbstractScrollArea | |
Protected Member Functions inherited from KoCanvasController | |
| void | setDocumentOffset (const QPoint &offset) |
Private Member Functions | |
| void | mirrorCanvasImpl (const std::optional< KoViewTransformStillPoint > &stillPoint, bool enable) |
| void | zoomInImpl (const std::optional< KoViewTransformStillPoint > &stillPoint) |
| void | zoomOutImpl (const std::optional< KoViewTransformStillPoint > &stillPoint) |
Private Attributes | |
| Private *const | m_d |
Additional Inherited Members | |
Public Attributes inherited from KoCanvasControllerWidget | |
| QPointer< KoCanvasBase > | canvas |
| bool | ignoreScrollSignals |
| KoCanvasSupervisor * | observerProvider |
| KoCanvasControllerWidget * | q |
| Viewport * | viewportWidget |
Public Attributes inherited from KoCanvasController | |
| KisKActionCollection * | actionCollection |
| QPoint | documentOffset |
| QSizeF | documentSize |
| qreal | preferredCenterFractionX |
| qreal | preferredCenterFractionY |
| QPointer< KoCanvasControllerProxyObject > | proxyObject |
Definition at line 23 of file kis_canvas_controller.h.
| KisCanvasController::KisCanvasController | ( | QPointer< KisView > | parent, |
| KoCanvasSupervisor * | observerProvider, | ||
| KisKActionCollection * | actionCollection ) |
Definition at line 74 of file kis_canvas_controller.cpp.
References m_d, and KisCanvasController::Private::view.
|
override |
|
overridevirtual |
Reimplemented from KoCanvasController.
Activate this canvascontroller
Reimplemented from KoCanvasControllerWidget.
Definition at line 129 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::activate().
|
slot |
Definition at line 279 of file kis_canvas_controller.cpp.
References KisCoordinatesConverter::beginRotation(), KisCanvasController::Private::coordinatesConverter, and m_d.
|
overridevirtual |
Implements KoCanvasControllerWidget.
Definition at line 526 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCanvasState::fromConverter(), and m_d.
|
overridevirtual |
Implements KoCanvasController.
Definition at line 134 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, KisCanvasController::Private::coordinatesConverter, m_d, KisCanvasController::Private::view, and KisCoordinatesConverter::widgetToDocument().
|
signal |
| qreal KisCanvasController::effectiveCanvasResolutionX | ( | ) | const |
Definition at line 117 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::devicePixelRatio, m_d, KisCanvasController::Private::physicalDpiX, POINT_TO_INCH(), KisCanvasController::Private::usePrintResolutionMode, KisCanvasController::Private::view, and KisImage::xRes().
| qreal KisCanvasController::effectiveCanvasResolutionY | ( | ) | const |
Definition at line 123 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::devicePixelRatio, m_d, KisCanvasController::Private::physicalDpiY, POINT_TO_INCH(), KisCanvasController::Private::usePrintResolutionMode, KisCanvasController::Private::view, and KisImage::yRes().
|
slot |
Definition at line 284 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::endRotation(), and m_d.
|
overridevirtual |
Scrolls the content of the canvas so that the given rect is visible.
The rect is to be specified in document coordinates (points). The scrollbar positions are changed so that the centerpoint of the rectangle is centered if possible.
| rect | the rectangle to make visible |
| smooth | if true the viewport translation will make be just enough to ensure visibility, no more. |
Implements KoCanvasController.
Definition at line 181 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::documentToWidget(), m_d, and KoCanvasControllerWidget::pan().
|
override |
Definition at line 163 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, m_d, KisCanvasController::Private::mousePositionCompressor, and KisCanvasController::Private::view.
|
override |
Dirty Hack Alert: Do not call the KoCanvasControllerWidget::keyPressEvent() to avoid activation of Pan and Default tool activation shortcuts
Definition at line 143 of file kis_canvas_controller.cpp.
| bool KisCanvasController::levelOfDetailMode | ( | ) | const |
Definition at line 429 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, and KisCanvas2::lodPreferredInCanvas().
|
slot |
Definition at line 237 of file kis_canvas_controller.cpp.
References mirrorCanvasImpl().
|
slot |
Definition at line 261 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::imageRectInDocumentPixels(), m_d, KisCoordinatesConverter::makeDocStillPoint(), and mirrorCanvasImpl().
|
slot |
Definition at line 242 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, KisCanvasController::Private::coordinatesConverter, m_d, KisCoordinatesConverter::makeWidgetStillPoint(), mirrorCanvasImpl(), and KisCanvasController::Private::view.
|
private |
Definition at line 227 of file kis_canvas_controller.cpp.
References canvasState(), KisCanvasController::Private::coordinatesConverter, KoCanvasControllerWidget::emitSignals(), m_d, KisCoordinatesConverter::mirror(), and KisCanvasController::Private::showMirrorStateOnCanvas().
|
overridevirtual |
Returns the currently set preferred center point in view coordinates (pixels)
Implements KoCanvasController.
Definition at line 536 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::imageRectInWidgetPixels(), m_d, and KisCoordinatesConverter::widgetCenterPoint().
|
slot |
Definition at line 322 of file kis_canvas_controller.cpp.
References canvasState(), KisCanvasController::Private::coordinatesConverter, KoCanvasControllerWidget::emitSignals(), m_d, KisCoordinatesConverter::resetRotation(), and KisCanvasController::Private::showRotationValueOnCanvas().
|
overridevirtual |
Update the range of scroll bars
Implements KoCanvasController.
Definition at line 601 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::documentOffset(), m_d, KisCoordinatesConverter::maximumOffset(), and KisCoordinatesConverter::minimumOffset().
| void KisCanvasController::restoreCanvasState | ( | const KisPropertiesConfiguration & | config | ) |
Definition at line 450 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, KisPropertiesConfiguration::getBool(), KisPropertiesConfiguration::getFloat(), KisPropertiesConfiguration::getInt(), mirrorCanvas(), preferredCenter(), rotateCanvas(), KisCanvas2::setLodPreferredInCanvas(), setPreferredCenter(), slotSetWrapAroundModeAxis(), and slotToggleWrapAroundMode().
|
slot |
Definition at line 302 of file kis_canvas_controller.cpp.
References rotateCanvas().
| void KisCanvasController::rotateCanvas | ( | qreal | angle, |
| const std::optional< KoViewTransformStillPoint > & | stillPoint, | ||
| bool | isNativeGesture = false ) |
Definition at line 289 of file kis_canvas_controller.cpp.
References canvasState(), KisCanvasController::Private::coordinatesConverter, KoCanvasControllerWidget::emitSignals(), KisCoordinatesConverter::enableNatureGestureFlag(), m_d, KisCoordinatesConverter::rotate(), and KisCanvasController::Private::showRotationValueOnCanvas().
|
slot |
Definition at line 312 of file kis_canvas_controller.cpp.
References rotateCanvas().
|
slot |
Definition at line 307 of file kis_canvas_controller.cpp.
References rotateCanvas().
|
slot |
Definition at line 317 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, m_d, and KisCoordinatesConverter::rotationAngle().
| void KisCanvasController::saveCanvasState | ( | KisPropertiesConfiguration & | config | ) | const |
Definition at line 437 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, levelOfDetailMode(), m_d, preferredCenter(), rotation(), KisPropertiesConfiguration::setProperty(), wrapAroundMode(), wrapAroundModeAxis(), and KisCoordinatesConverter::xAxisMirrored().
|
overridevirtual |
Set the new canvas to be shown as a child Calling this will Q_EMIT canvasRemoved() if there was a canvas before, and will emit canvasSet() with the new canvas.
| canvas | the new canvas. The KoCanvasBase::canvas() will be called to retrieve the actual widget which will then be added as child of this one. |
Implements KoCanvasController.
Definition at line 86 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, KisCanvas2::coordinatesConverter, KisCanvasController::Private::coordinatesConverter, m_d, and KoCanvasControllerWidget::setCanvas().
|
overridevirtual |
Sets the preferred center point in view coordinates (pixels).
| viewPoint | the new preferred center |
Implements KoCanvasController.
Definition at line 542 of file kis_canvas_controller.cpp.
References canvasState(), KisCanvasController::Private::coordinatesConverter, KoCanvasControllerWidget::emitSignals(), m_d, updateCanvasOffsetInternal(), and KisCoordinatesConverter::widgetCenterPoint().
|
slot |
Definition at line 636 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, effectiveCanvasResolutionX(), effectiveCanvasResolutionY(), m_d, KoCanvasControllerWidget::setZoom(), sigUsePrintResolutionModeChanged(), KisCanvasController::Private::usePrintResolutionMode, value(), KisCanvasController::Private::view, KoZoomHandler::zoom(), KoZoomMode::ZOOM_CONSTANT, and KoZoomHandler::zoomMode().
|
signal |
|
slot |
Definition at line 353 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, KisCanvas2::image(), KisImage::setWrapAroundModeAxis(), KisCanvas2::setWrapAroundViewingModeAxis(), and value().
|
slot |
Definition at line 367 of file kis_canvas_controller.cpp.
References slotSetWrapAroundModeAxis(), and WRAPAROUND_HORIZONTAL.
|
slot |
Definition at line 362 of file kis_canvas_controller.cpp.
References slotSetWrapAroundModeAxis(), and WRAPAROUND_BOTH.
|
slot |
Definition at line 372 of file kis_canvas_controller.cpp.
References slotSetWrapAroundModeAxis(), and WRAPAROUND_VERTICAL.
|
slot |
Definition at line 393 of file kis_canvas_controller.cpp.
References KisOpenGL::BilinearFilterMode, KoCanvasControllerWidget::canvas, KisCanvas2::canvasIsOpenGL(), levelOfDetailMode(), KisFloatingMessage::Low, m_d, KisOpenGL::NearestFilterMode, KisCanvas2::openGLFilterMode, KisCanvas2::setLodPreferredInCanvas(), value(), and KisCanvasController::Private::view.
|
slot |
Definition at line 385 of file kis_canvas_controller.cpp.
References KisConfig::enablePixelGrid(), KisConfigNotifier::instance(), KisConfigNotifier::notifyPixelGridModeChanged(), and value().
|
slot |
Definition at line 332 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, KisCanvas2::image(), m_d, KisImage::setWrapAroundModePermitted(), KisCanvas2::setWrapAroundViewingMode(), value(), and KisCanvasController::Private::view.
| void KisCanvasController::syncOnImageResolutionChange | ( | ) |
Definition at line 477 of file kis_canvas_controller.cpp.
References canvasState(), KisCanvasController::Private::coordinatesConverter, effectiveCanvasResolutionX(), effectiveCanvasResolutionY(), KoCanvasControllerWidget::emitSignals(), KisCoordinatesConverter::imageCenterInWidgetPixel(), m_d, KisCoordinatesConverter::makeWidgetStillPoint(), KisCoordinatesConverter::setImageResolution(), KisCoordinatesConverter::setZoom(), KisCanvasController::Private::usePrintResolutionMode, KisCanvasController::Private::view, KisImage::xRes(), KisImage::yRes(), KoZoomHandler::zoom(), and KoZoomHandler::zoomMode().
| void KisCanvasController::syncOnImageSizeChange | ( | const QPointF & | oldStillPoint, |
| const QPointF & | newStillPoint ) |
Definition at line 498 of file kis_canvas_controller.cpp.
References KisImage::bounds(), canvasState(), KisCanvasController::Private::coordinatesConverter, KoCanvasControllerWidget::emitSignals(), m_d, KisCoordinatesConverter::setImageBounds(), and KisCanvasController::Private::view.
| void KisCanvasController::syncOnReferencesChange | ( | const QRectF & | referencesRect | ) |
Definition at line 468 of file kis_canvas_controller.cpp.
References canvasState(), KisCanvasController::Private::coordinatesConverter, KoCanvasControllerWidget::emitSignals(), m_d, and KisCoordinatesConverter::setExtraReferencesBounds().
|
overrideprotectedvirtual |
Implements KoCanvasControllerWidget.
Definition at line 510 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, m_d, and KisCoordinatesConverter::setDocumentOffset().
|
overrideprotectedvirtual |
Implements KoCanvasControllerWidget.
Definition at line 516 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, m_d, and KisCoordinatesConverter::setCanvasWidgetSizeKeepZoom().
|
overrideprotectedvirtual |
Implements KoCanvasControllerWidget.
Definition at line 521 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, m_d, and KisCoordinatesConverter::setZoom().
| void KisCanvasController::updateScreenResolution | ( | QWidget * | parentWidget | ) |
Definition at line 99 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCanvasController::Private::devicePixelRatio, m_d, KisCanvasController::Private::physicalDpiX, KisCanvasController::Private::physicalDpiY, qFuzzyCompare(), KisCoordinatesConverter::setDevicePixelRatio(), setUsePrintResolutionMode(), and KisCanvasController::Private::usePrintResolutionMode.
| bool KisCanvasController::usePrintResolutionMode | ( | ) |
Definition at line 631 of file kis_canvas_controller.cpp.
References m_d, and KisCanvasController::Private::usePrintResolutionMode.
|
override |
Dirty Hack Alert: Do not call the KoCanvasControllerWidget::wheelEvent() to disable the default behavior of KoCanvasControllerWidget and QAbstractScrollArea
Definition at line 153 of file kis_canvas_controller.cpp.
| bool KisCanvasController::wrapAroundMode | ( | ) | const |
Definition at line 345 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, and KisCanvas2::wrapAroundViewingMode().
| WrapAroundAxis KisCanvasController::wrapAroundModeAxis | ( | ) | const |
Definition at line 377 of file kis_canvas_controller.cpp.
References KoCanvasControllerWidget::canvas, and KisCanvas2::wrapAroundViewingModeAxis().
|
overridevirtual |
Implements KoCanvasController.
Definition at line 552 of file kis_canvas_controller.cpp.
References zoomInImpl().
|
overridevirtual |
zooms in keeping stillPoint not moved.
Implements KoCanvasController.
Definition at line 562 of file kis_canvas_controller.cpp.
References zoomInImpl().
|
private |
Definition at line 572 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::findNextZoom(), m_d, qFuzzyCompare(), KoCanvasControllerWidget::setZoom(), KisCoordinatesConverter::standardZoomLevels(), KoZoomHandler::zoom(), and KoZoomMode::ZOOM_CONSTANT.
|
overridevirtual |
Implements KoCanvasController.
Definition at line 557 of file kis_canvas_controller.cpp.
References zoomOutImpl().
|
overridevirtual |
zooms out keeping stillPoint not moved.
Implements KoCanvasController.
Definition at line 567 of file kis_canvas_controller.cpp.
References zoomOutImpl().
|
private |
Definition at line 584 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, KisCoordinatesConverter::findPrevZoom(), m_d, qFuzzyCompare(), KoCanvasControllerWidget::setZoom(), KisCoordinatesConverter::standardZoomLevels(), KoZoomHandler::zoom(), and KoZoomMode::ZOOM_CONSTANT.
|
overridevirtual |
Implements KoCanvasController.
Definition at line 531 of file kis_canvas_controller.cpp.
References canvasState(), and KisCanvasState::zoomState().
|
overrideprotectedvirtual |
Implements KoCanvasControllerWidget.
Definition at line 596 of file kis_canvas_controller.cpp.
References KisCanvasController::Private::coordinatesConverter, m_d, and KisCoordinatesConverter::zoomTo().
|
private |
Definition at line 116 of file kis_canvas_controller.h.