|
Krita Source Code Documentation
|
#include <KisView.h>
Inheritance diagram for KisView:Classes | |
| class | StatusBarItem |
Public Slots | |
| bool | queryClose () |
| void | slotClearStatusText () |
| void | slotGamutCheck (bool gamutCheck) |
| slotGamutCheck set whether or not we're gamutchecking in this view. Will be setting the same in the vans belonging to the view. | |
| void | slotImageResolutionChanged () |
| void | slotImageSizeChanged (const QPointF &oldStillPoint, const QPointF &newStillPoint) |
| void | slotLoadingFinished () |
| void | slotMigratedToScreen (QScreen *screen) |
| void | slotSavingStatusMessage (const QString &text, int timeout, bool isAutoSaving=false) |
| void | slotScreenOrResolutionChanged () |
| void | slotSoftProofing (bool softProofing) |
| slotSoftProofing set whether or not we're softproofing in this view. Will be setting the same in the canvas belonging to the view. | |
| void | slotThemeChanged (QPalette pal) |
| void | slotUpdateDocumentTitle () |
Signals | |
| void | sigColorSpaceChanged (const KoColorSpace *cs) |
| void | sigProfileChanged (const KoColorProfile *profile) |
| void | sigSizeChanged (const QPointF &oldStillPoint, const QPointF &newStillPoint) |
Public Attributes | |
| KisKActionCollection * | actionCollection {nullptr} |
| KisSynchronizedConnection< KisNodeSP, KisNodeAdditionFlags > | addNodeConnection |
| KisCanvas2 | canvas |
| KisCanvasController | canvasController |
| KisNodeSP | currentNode |
| QPointer< KisDocument > | document |
| KisSignalCompressor | floatingMessageCompressor |
| bool | gamutCheck {false} |
| bool | inOperation {false} |
| bool | isCurrent {false} |
| KisPaintingAssistantsDecorationSP | paintingAssistantsDecoration |
| KisReferenceImagesDecorationSP | referenceImagesDecoration |
| KisSynchronizedConnection< KisNodeSP > | removeNodeConnection |
| QPointer< KisFloatingMessage > | savedFloatingMessage |
| KisScreenMigrationTracker | screenMigrationTracker |
| bool | showFloatingMessage {true} |
| bool | softProofing {false} |
| QMdiSubWindow * | subWindow {nullptr} |
| QWidget * | tempActiveWidget {nullptr} |
| KisCoordinatesConverter | viewConverter |
| KisViewManager * | viewManager {nullptr} |
| KisZoomManager | zoomManager |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *event) override |
| void | dragEnterEvent (QDragEnterEvent *event) override |
| void | dragMoveEvent (QDragMoveEvent *event) override |
| void | dropEvent (QDropEvent *event) override |
| QString | newObjectName () |
Private Slots | |
| void | slotContinueAddNode (KisNodeSP newActiveNode, KisNodeAdditionFlags flags) |
| void | slotContinueRemoveNode (KisNodeSP newActiveNode) |
| void | slotImageNodeRemoved (KisNodeSP node) |
Private Member Functions | |
| bool | shouldAcceptDrag (const QDropEvent *event) const |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Static Private Attributes | |
| static bool | s_firstView = true |
This class is used to display a KisDocument.
Multiple views can be attached to one document at a time.
Definition at line 102 of file KisView.cpp.
| KisView::KisView | ( | KisDocument * | document, |
| KisViewManager * | viewManager, | ||
| QWidget * | parent = 0 ) |
Creates a new view for the document.
Definition at line 202 of file KisView.cpp.
References KisCanvas2::addDecoration(), Private::canvas, d, document, KisMemoryStatisticsServer::instance(), newObjectName(), KisCanvas2::setup(), KisConfig::showCanvasMessages(), slotClearStatusText(), slotLoadingFinished(), slotSavingStatusMessage(), slotScreenOrResolutionChanged(), slotUpdateDocumentTitle(), and statusBar().
|
override |
KisCanvas2 maintains direct connections to the image, so we should disconnect it from the image before the destruction process starts
Definition at line 257 of file KisView.cpp.
References Private::canvas, d, KisCanvas2::disconnectImage(), image(), KoToolManager::instance(), KisPart::instance(), KoToolManager::removeCanvasController(), KisPart::removeView(), and KisImage::requestStrokeCancellation().
| void KisView::addStatusBarItem | ( | QWidget * | widget, |
| int | stretch = 0, | ||
| bool | permanent = false ) |
This adds a widget to the statusbar for this view. If you use this method instead of using statusBar() directly, KisView will take care of removing the items when the view GUI is deactivated and readding them when it is reactivated. The parameters are the same as QStatusBar::addWidget().
| KisCanvas2 * KisView::canvasBase | ( | ) | const |
Definition at line 427 of file KisView.cpp.
References Private::canvas, and d.
| KisCanvasController * KisView::canvasController | ( | ) | const |
The CanvasController decorates the canvas with scrollbars and knows where to start painting on the canvas widget, i.e., the document offset.
| bool KisView::canvasIsMirrored | ( | ) | const |
Definition at line 332 of file KisView.cpp.
References Private::canvas, d, KisCanvas2::xAxisMirrored(), and KisCanvas2::yAxisMirrored().
|
overrideprotected |
Definition at line 1136 of file KisView.cpp.
References document, KisPart::instance(), queryClose(), and KisPart::viewCount().
| void KisView::closeView | ( | ) |
| QList< QAction * > KisView::createChangeUnitActions | ( | bool | addPixelUnit = false | ) |
create a list of actions that when activated will change the unit on the document.
Definition at line 1130 of file KisView.cpp.
References d.
| KisLayerSP KisView::currentLayer | ( | ) | const |
Definition at line 1315 of file KisView.cpp.
References currentMask(), d, KisSharedPtr< T >::data(), and KisNode::parent.
| KisMaskSP KisView::currentMask | ( | ) | const |
| KisNodeSP KisView::currentNode | ( | ) | const |
| QScreen * KisView::currentScreen | ( | ) | const |
Returns the current screen that the view belongs to
Definition at line 1218 of file KisView.cpp.
References d.
| KisDocument * KisView::document | ( | ) | const |
Retrieves the document object of this view.
|
overrideprotected |
Definition at line 446 of file KisView.cpp.
References dbgUI, and shouldAcceptDrag().
|
overrideprotected |
Definition at line 1062 of file KisView.cpp.
References dbgUI, and shouldAcceptDrag().
|
overrideprotected |
Definition at line 461 of file KisView.cpp.
References KisViewManager::activeLayer(), KisImportCatcher::adaptClipToImageColorSpace(), KisNodeCommandsAdapter::addNode(), KisReferenceImagesDecoration::addReferenceImage(), KisClipboard::askUserForSource(), KisImage::bounds(), canvasBase(), KisClipboard::clipFromBoardContents(), KisClipboard::clipFromMimeData(), KisCanvas2::coordinatesConverter, d, dbgUI, KisCanvasDrop::dropAs(), KisImportExportErrorCode::errorMessage(), KisRemoteFileFetcher::fetchFile(), ImportExportCodes::FileFormatNotSupported, KisReferenceImage::fromFile(), KisReferenceImage::fromPaintDevice(), image(), KisViewManager::image(), KisViewManager::imageManager(), KisCoordinatesConverter::imageToDocument(), KisImportExportManager::Import, KisImageManager::importImage(), KisCanvasDrop::INSERT_AS_NEW_FILE_LAYER, KisCanvasDrop::INSERT_AS_NEW_LAYER, KisCanvasDrop::INSERT_AS_REFERENCE_IMAGE, KisCanvasDrop::INSERT_AS_REFERENCE_IMAGES, KisCanvasDrop::INSERT_MANY_FILE_LAYERS, KisCanvasDrop::INSERT_MANY_LAYERS, KoToolManager::instance(), KisClipboard::instance(), KisMimeData::loadNodesFast(), KisMimeData::loadNodesFastAndRecenter(), mainWindow(), KisMimeDatabase::mimeTypeForFile(), KisPaintDevice::moveTo(), KisFileLayer::None, KisMainWindow::None, KisCanvasDrop::NONE, OPACITY_OPAQUE_U8, KisCanvasDrop::OPEN_IN_NEW_DOCUMENT, KisCanvasDrop::OPEN_MANY_DOCUMENTS, KisMainWindow::openDocument(), KisNode::parent, KisClipboard::PASTE_FORMAT_CLIP, KisClipboard::PASTE_FORMAT_LOCAL, KisCanvas2::referenceImagesDecoration(), KisNodeFacade::root, KisImage::rootLayer(), shouldAcceptDrag(), source(), KisImportExportManager::supportedMimeTypes(), KoToolManager::switchToolRequested(), viewConverter, KisMainWindow::viewManager, viewManager, warnUI, and KisCoordinatesConverter::widgetToImage().
| bool KisView::gamutCheck | ( | ) |
gamutCheck
| KisInputManager * KisView::globalInputManager | ( | ) | const |
Filters events and sends them to canvas actions. Shared among all the views/canvases
NOTE: May be null while initialization!
Definition at line 422 of file KisView.cpp.
References d.
| KisImageWSP KisView::image | ( | ) | const |
| bool KisView::isCurrent | ( | ) | const |
| KisMainWindow * KisView::mainWindow | ( | ) | const |
Definition at line 1089 of file KisView.cpp.
References d.
|
protected |
Generate a name for this view.
Definition at line 93 of file KisView.cpp.
| void KisView::notifyCurrentStateChanged | ( | bool | isCurrent | ) |
When current view is changed, currently selected node is also changed, therefore we should update selection overlay mask
Definition at line 282 of file KisView.cpp.
References KisInputManager::attachPriorityEventFilter(), d, KisInputManager::detachPriorityEventFilter(), globalInputManager(), isCurrent, KisSelectionManager::selectionChanged(), KisViewManager::selectionManager(), and viewManager.
|
inline |
Definition at line 105 of file KisView.cpp.
|
slot |
Definition at line 1155 of file KisView.cpp.
References KisViewManager::blockUntilOperationsFinishedForced(), document, image(), KisViewManager::mainWindow(), KisImage::requestStrokeCancellation(), KisMainWindow::saveDocument(), and viewManager.
| void KisView::removeStatusBarItem | ( | QWidget * | widget | ) |
Remove a widget from the statusbar for this view.
| KisView * KisView::replaceBy | ( | KisDocument * | document | ) |
Deletes the view and creates a new one, displaying document, in the same sub-window.
Definition at line 1081 of file KisView.cpp.
References d, mainWindow(), KisMainWindow::newView(), and subWindow.
| KisCanvasResourceProvider * KisView::resourceProvider | ( | ) | const |
| void KisView::restoreViewState | ( | const KisPropertiesConfiguration & | config | ) |
Definition at line 1289 of file KisView.cpp.
References d, KisPropertiesConfiguration::getFloat(), KisPropertiesConfiguration::getInt(), KisPropertiesConfiguration::getString(), and KoZoomMode::ZOOM_PAGE.
| void KisView::saveViewState | ( | KisPropertiesConfiguration & | config | ) | const |
Definition at line 1272 of file KisView.cpp.
References d, mainWindow(), KoZoomState::mode, KisPropertiesConfiguration::setProperty(), and KoZoomState::zoom.
| KisSelectionSP KisView::selection | ( | ) |
Convenience method to get at the active selection (the selection of the current layer, or, if that does not exist, the global selection.
Definition at line 1333 of file KisView.cpp.
References currentLayer(), KisImage::globalSelection(), image(), and KisLayer::selection().
Definition at line 1302 of file KisView.cpp.
References Private::canvas, d, KisCanvas2::slotTrySwitchShapeManager(), and syncLastActiveNodeToDocument().
| void KisView::setShowFloatingMessage | ( | bool | show | ) |
Definition at line 309 of file KisView.cpp.
References d.
| void KisView::setSubWindow | ( | QMdiSubWindow * | subWindow | ) |
| void KisView::setViewManager | ( | KisViewManager * | view | ) |
Definition at line 337 of file KisView.cpp.
References KoToolManager::addController(), Private::canvas, d, image(), KoToolManager::instance(), KisShapeController::setInitialShapeForCanvas(), KisImage::sigNodeAddedAsync(), sigSizeChanged(), slotContinueAddNode(), slotContinueRemoveNode(), slotImageNodeRemoved(), slotImageResolutionChanged(), slotImageSizeChanged(), and KoToolManager::switchToolRequested().
|
private |
Definition at line 1442 of file KisView.cpp.
References image(), and KisMimeData::isNodeMimeDataFromSameImage().
| void KisView::showFloatingMessage | ( | const QString & | message, |
| const QIcon & | icon, | ||
| int | timeout = 4500, | ||
| KisFloatingMessage::Priority | priority = KisFloatingMessage::Medium, | ||
| int | alignment = Qt::AlignCenter|Qt::TextWordWrap ) |
|
signal |
|
signal |
|
signal |
|
slot |
End of the message in the status bar (calls QStatusBar::clear())
Definition at line 1122 of file KisView.cpp.
References statusBar().
|
privateslot |
When deleting the last layer, root node got selected. We should fix it when the first layer is added back.
Here we basically reimplement what Qt's view/model do. But since they are not connected, we should do it manually.
Definition at line 372 of file KisView.cpp.
References d.
Definition at line 397 of file KisView.cpp.
References d.
|
slot |
slotGamutCheck set whether or not we're gamutchecking in this view. Will be setting the same in the vans belonging to the view.
Definition at line 1364 of file KisView.cpp.
References canvasBase(), d, gamutCheck, image(), KisViewManager::showFloatingMessage(), KisCanvas2::slotGamutCheck(), and viewManager.
Definition at line 392 of file KisView.cpp.
References d, and KritaUtils::nearestNodeAfterRemoval().
|
slot |
Definition at line 1424 of file KisView.cpp.
References d, KisZoomManager::updateImageBoundsSnapping(), and zoomManager.
|
slot |
Definition at line 1431 of file KisView.cpp.
References d, KisZoomManager::updateImageBoundsSnapping(), and zoomManager.
|
slot |
Cold-start of image size/resolution signals
Definition at line 1397 of file KisView.cpp.
References canvasBase(), d, document, image(), KisCanvas2::initializeImage(), sigColorSpaceChanged(), sigProfileChanged(), sigSizeChanged(), slotImageResolutionChanged(), slotMigratedToScreen(), slotScreenOrResolutionChanged(), KisImage::unlock(), KisZoomManager::updateImageBoundsSnapping(), and zoomManager.
|
slot |
Definition at line 1199 of file KisView.cpp.
References Private::canvas, d, and KisCanvas2::slotScreenChanged().
|
slot |
Display a message in the status bar (calls QStatusBar::message())
| value | determines autosaving |
Definition at line 1105 of file KisView.cpp.
References KisConfig::forceShowAutosaveMessages(), KisConfig::forceShowSaveMessages(), KisViewManager::showFloatingMessage(), statusBar(), and viewManager.
|
slot |
slotScreenOrResolutionChanged() is guaranteed to come after slotMigratedToScreen() when a migration happens
Definition at line 1204 of file KisView.cpp.
References Private::canvas, d, and KoCanvasBase::resourceManager.
|
slot |
slotSoftProofing set whether or not we're softproofing in this view. Will be setting the same in the canvas belonging to the view.
Definition at line 1345 of file KisView.cpp.
References canvasBase(), d, image(), KisViewManager::showFloatingMessage(), KisCanvas2::slotSoftProofing(), softProofing, and viewManager.
|
slot |
Definition at line 1223 of file KisView.cpp.
References canvasBase(), canvasController, and KisCanvas2::canvasWidget.
|
slot |
Definition at line 1240 of file KisView.cpp.
References d, KisMemoryStatisticsServer::fetchMemoryStatistics(), KisMemoryStatisticsServer::Statistics::imageSize, and KisMemoryStatisticsServer::instance().
| bool KisView::softProofing | ( | ) |
softProofing
| QStatusBar * KisView::statusBar | ( | ) | const |
Definition at line 1099 of file KisView.cpp.
References mainWindow().
| void KisView::syncLastActiveNodeToDocument | ( | ) |
Definition at line 1264 of file KisView.cpp.
References d, document, and KisDocument::setPreActivatedNode().
| KisCoordinatesConverter * KisView::viewConverter | ( | ) | const |
| KisViewManager * KisView::viewManager | ( | ) | const |
| KisZoomManager * KisView::zoomManager | ( | ) | const |
The zoommanager handles everything action-related to zooming
| KisKActionCollection* KisView::actionCollection {nullptr} |
Definition at line 124 of file KisView.cpp.
| KisSynchronizedConnection<KisNodeSP, KisNodeAdditionFlags> KisView::addNodeConnection |
Definition at line 142 of file KisView.cpp.
| KisCanvas2 KisView::canvas |
Definition at line 127 of file KisView.cpp.
| KisCanvasController * KisView::canvasController |
Definition at line 126 of file KisView.cpp.
| KisNodeSP KisView::currentNode |
Definition at line 130 of file KisView.cpp.
| KisDocument * KisView::document |
Definition at line 121 of file KisView.cpp.
| KisSignalCompressor KisView::floatingMessageCompressor |
Definition at line 136 of file KisView.cpp.
| bool KisView::gamutCheck {false} |
Definition at line 140 of file KisView.cpp.
| bool KisView::inOperation {false} |
Definition at line 119 of file KisView.cpp.
| bool KisView::isCurrent {false} |
Definition at line 133 of file KisView.cpp.
| KisPaintingAssistantsDecorationSP KisView::paintingAssistantsDecoration |
Definition at line 131 of file KisView.cpp.
| KisReferenceImagesDecorationSP KisView::referenceImagesDecoration |
Definition at line 132 of file KisView.cpp.
| KisSynchronizedConnection<KisNodeSP> KisView::removeNodeConnection |
Definition at line 143 of file KisView.cpp.
| QPointer<KisFloatingMessage> KisView::savedFloatingMessage |
Definition at line 135 of file KisView.cpp.
| KisScreenMigrationTracker KisView::screenMigrationTracker |
Definition at line 145 of file KisView.cpp.
| void KisView::showFloatingMessage {true} |
Definition at line 134 of file KisView.cpp.
| bool KisView::softProofing {false} |
Definition at line 139 of file KisView.cpp.
| QMdiSubWindow* KisView::subWindow {nullptr} |
Definition at line 137 of file KisView.cpp.
| QWidget* KisView::tempActiveWidget {nullptr} |
Definition at line 122 of file KisView.cpp.
| KisCoordinatesConverter * KisView::viewConverter |
Definition at line 125 of file KisView.cpp.
| KisViewManager * KisView::viewManager {nullptr} |
Definition at line 129 of file KisView.cpp.
| KisZoomManager * KisView::zoomManager |
Definition at line 128 of file KisView.cpp.