21#include <QApplication>
24#include <QDeadlineTimer>
25#include <QStandardPaths>
27#include <QDesktopServices>
35#include <QPrintDialog>
43#include <QActionGroup>
47#include <klocalizedstring.h>
49#include <kselectaction.h>
138 if(
dynamic_cast<QWheelEvent*
>(event)
139 ||
dynamic_cast<QKeyEvent*
>(event)
140 ||
dynamic_cast<QMouseEvent*
>(event)) {
285 d->
mainWindow =
dynamic_cast<QMainWindow*
>(parent);
348 KoColor foreground(Qt::black, cs);
350 KoColor background(Qt::white, cs);
411 KSharedConfigPtr config = KSharedConfig::openConfig();
412 KConfigGroup miscGroup = config->group(
"Misc");
413 const uint handleRadius = miscGroup.readEntry(
"HandleRadius", 5);
456 doc->disconnect(
this);
471 d->
softProof->setChecked(imageView->softProofing());
472 d->
gamutCheck->setChecked(imageView->gamutCheck());
477 if (
KisConfig(
true).readEntry<bool>(
"EnablePositionLabel",
false)) {
479 SIGNAL(documentMousePositionChanged(QPointF)),
481 SLOT(documentMousePositionChanged(QPointF)));
521 QSignalBlocker b(d->viewPrintSize);
522 d->viewPrintSize->setChecked(value);
524 d->
viewPrintSize->setChecked(imageView->canvasController()->usePrintResolutionMode());
530 imageView->zoomManager()->zoomAction(),
532 imageView->zoomManager()->zoomAction()->setUsePrintResolutionMode(imageView->canvasController()->usePrintResolutionMode());
535 imageView->canvasController(),
571 image(), SIGNAL(sigSizeChanged(QPointF,QPointF)),
575 image(), SIGNAL(sigResolutionChanged(
double,
double)),
775 connect(tAction, SIGNAL(toggled(
bool)),
this, SLOT(
showStatusBar(
bool)));
778 tAction->setChecked(
false);
779 connect(tAction, SIGNAL(toggled(
bool)),
this, SLOT(
switchCanvasOnly(
bool)));
898 const int busyWaitDelay = 1000;
900 dialog.blockIfImageIsBusy();
902 return dialog.result() == QDialog::Accepted;
931 KisImageReadOnlyBarrierLock l(srcDoc->
image());
932 doc = srcDoc->
clone(
true);
937 if (name.isEmpty()) {
940 name = i18n(
"%1 (Copy)", name);
956 QMainWindow* w = qobject_cast<QMainWindow*>(qApp->activeWindow());
977 QString path = QFileInfo(
document()->localFilePath()).canonicalPath();
980 if (QDir(path).exists()) {
984 dialog.setDirectoryUrl(QUrl(
document()->localFilePath()));
985 return dialog.filename();
988 return QFileInfo(
document()->localFilePath()).canonicalPath();
1003 bool fileAlreadyExists;
1005 QString version =
"000";
1010 QString fileName = QFileInfo(
document()->localFilePath()).fileName();
1015 QRegExp regex(
"_\\d{1,4}[.]|_\\d{1,4}[a-z][.]|_\\d{1,4}[~]|_\\d{1,4}[a-z][~]");
1016 regex.indexIn(fileName);
1018 foundVersion = matches.at(0).isEmpty() ? false :
true;
1023 QRegExp regexAux(
"_\\d{1,4}[~]|_\\d{1,4}[a-z][~]");
1024 regexAux.indexIn(fileName);
1025 QStringList matchesAux = regexAux.capturedTexts();
1026 isBackup = matchesAux.at(0).isEmpty() ? false :
true;
1030 version = matches.at(matches.count() - 1);
1031#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1032 if (version.contains(QRegExp(
"[a-z]"))) {
1034 if (QRegExp(
"[a-z]").containedIn(version)) {
1038 letter = version.right(1);
1043 version.remove(0, 1);
1047 QRegExp regex2(
"[.][a-z]{2,4}$");
1048 regex2.indexIn(fileName);
1050 QString extensionPlusVersion = matches2.at(0);
1051 extensionPlusVersion.prepend(version);
1052 extensionPlusVersion.prepend(
"_");
1053#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1054 fileName.replace(regex2, extensionPlusVersion);
1056 regex2.replaceIn(fileName, extensionPlusVersion);
1061 int intVersion = version.toInt(0);
1063 QString baseNewVersion = QString::number(intVersion);
1064 while (baseNewVersion.length() < version.length()) {
1065 baseNewVersion.prepend(
"0");
1070 newVersion = baseNewVersion;
1071 newVersion.prepend(
"_");
1072 if (!letter.isNull()) newVersion.append(letter);
1074 newVersion.append(
"~");
1076 newVersion.append(
".");
1078#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1079 fileName.replace(regex, newVersion);
1081 regex.replaceIn(fileName, newVersion);
1083 fileAlreadyExists = QFileInfo(path +
'/' + fileName).exists();
1084 if (fileAlreadyExists) {
1085 if (!letter.isNull()) {
1086 char letterCh = letter.at(0).toLatin1();
1088 letter = QString(QChar(letterCh));
1093 }
while (fileAlreadyExists && letter !=
"{");
1095 if (letter ==
"{") {
1096 QMessageBox::critical(
mainWindow(), i18nc(
"@title:window",
"Couldn't save incremental version"), i18n(
"Alternative names exhausted, try manually saving with a higher number"));
1099 QString newFilePath = path +
'/' + fileName;
1104 QUrl::fromLocalFile(
document()->path()));
1111 if (
document()->path().isEmpty()) {
1117 bool workingOnBackup;
1118 bool fileAlreadyExists;
1119 QString version =
"000";
1123 QString fileName = QFileInfo(
document()->localFilePath()).fileName();
1126 QRegExp regex(
"~\\d{1,4}[.]|~\\d{1,4}[a-z][.]");
1127 regex.indexIn(fileName);
1129 workingOnBackup = matches.at(0).isEmpty() ? false :
true;
1131 if (workingOnBackup) {
1133 version = matches.at(matches.count() - 1);
1134#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1135 if (version.contains(QRegExp(
"[a-z]"))) {
1137 if (QRegExp(
"[a-z]").containedIn(version)) {
1140 letter = version.right(1);
1145 version.remove(0, 1);
1148 int intVersion = version.toInt(0);
1150 QString baseNewVersion = QString::number(intVersion);
1152 while (baseNewVersion.length() < version.length()) {
1153 baseNewVersion.prepend(
"0");
1158 newVersion = baseNewVersion;
1159 newVersion.prepend(
"~");
1160 if (!letter.isNull()) newVersion.append(letter);
1161 newVersion.append(
".");
1162#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1163 backupFileName.replace(regex, newVersion);
1165 regex.replaceIn(backupFileName, newVersion);
1167 fileAlreadyExists = QFile(path +
'/' + backupFileName).exists();
1168 if (fileAlreadyExists) {
1169 if (!letter.isNull()) {
1170 char letterCh = letter.at(0).toLatin1();
1172 letter = QString(QChar(letterCh));
1177 }
while (fileAlreadyExists && letter !=
"{");
1179 if (letter ==
"{") {
1180 QMessageBox::critical(
mainWindow(), i18nc(
"@title:window",
"Couldn't save incremental backup"), i18n(
"Alternative names exhausted, try manually saving with a higher number"));
1183 QFile::copy(path +
'/' + fileName, path +
'/' + backupFileName);
1188 const quint8 HARDCODED_DIGIT_COUNT = 3;
1189 QString baseNewVersion =
"000";
1190 QString backupFileName = QFileInfo(
document()->localFilePath()).fileName();
1191 QRegExp regex2(
"[.][a-z]{2,4}$");
1192 regex2.indexIn(backupFileName);
1194 QString extensionPlusVersion = matches2.at(0);
1195 extensionPlusVersion.prepend(baseNewVersion);
1196 extensionPlusVersion.prepend(
"~");
1197#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1198 backupFileName.replace(regex2, extensionPlusVersion);
1200 regex2.replaceIn(backupFileName, extensionPlusVersion);
1205 newVersion = baseNewVersion;
1206 newVersion.prepend(
"~");
1207 newVersion.append(
".");
1208#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
1209 backupFileName.replace(regex, newVersion);
1211 regex.replaceIn(backupFileName, newVersion);
1213 fileAlreadyExists = QFile(path +
'/' + backupFileName).exists();
1214 if (fileAlreadyExists) {
1216 int intVersion = baseNewVersion.toInt(0);
1218 baseNewVersion = QString::number(intVersion);
1219 while (baseNewVersion.length() < HARDCODED_DIGIT_COUNT) {
1220 baseNewVersion.prepend(
"0");
1223 }
while (fileAlreadyExists);
1227 QFile::copy(path +
'/' + fileName, path +
'/' + backupFileName);
1256 if(mw && mw->statusBar()) {
1257 mw->statusBar()->setVisible(toggled);
1281 dbgUI <<
"Unable to switch to canvas-only mode, main window not found";
1295 bool wasToolBarPopupOpen =
false;
1296 for (QToolBar *toolBar : toolBars) {
1297 for (QToolButton *
button : toolBar->findChildren<QToolButton *>(QStringLiteral(
"qt_toolbar_ext_button"))) {
1298 if (
button->isChecked()) {
1299 wasToolBarPopupOpen =
true;
1305 if(wasToolBarPopupOpen) {
1328 !
main->canvasDetached();
1330 if (useCanvasOffsetCompensation) {
1363 if (toggleFullscreen) {
1365 origin =
main->geometry().topLeft() -
main->screen()->geometry().topLeft();
1375 if (
main->statusBar()) {
1377 if (
main->statusBar()->dynamicPropertyNames().contains(
"wasvisible")) {
1378 if (
main->statusBar()->property(
"wasvisible").toBool()) {
1379 main->statusBar()->setVisible(
true);
1384 main->statusBar()->setProperty(
"wasvisible",
main->statusBar()->isVisible());
1385 main->statusBar()->setVisible(
false);
1391 KisAction* action = qobject_cast<KisAction*>(
main->actionCollection()->action(
"view_toggledockers"));
1393 action->setCheckable(
true);
1395 if (action->isChecked()) {
1397 action->setChecked(
false);
1409 if (toggleFullscreen) {
1411 main->setWindowState(
main->windowState() | Qt::WindowFullScreen);
1413 main->setWindowState(
main->windowState() & ~Qt::WindowFullScreen);
1419 if (
main->menuBar()->dynamicPropertyNames().contains(
"wasvisible")) {
1420 if (
main->menuBar()->property(
"wasvisible").toBool()) {
1421 main->menuBar()->setVisible(
true);
1426 main->menuBar()->setProperty(
"wasvisible",
main->menuBar()->isVisible());
1427 main->menuBar()->setVisible(
false);
1436 Q_FOREACH (QToolBar* toolbar, toolBars) {
1438 if (toolbar->dynamicPropertyNames().contains(
"wasvisible")) {
1439 if (toolbar->property(
"wasvisible").toBool()) {
1440 toolbar->setVisible(
true);
1445 toolbar->setProperty(
"wasvisible", toolbar->isVisible());
1446 toolbar->setVisible(
false);
1467 QTimer::singleShot(0,
this, [
this] () {
1474 actionCollection()->action(
"view_show_canvas_only")->shortcut().toString(QKeySequence::NativeText)), QIcon(),
1484 if (useCanvasOffsetCompensation && toggled) {
1487 const bool allowedZoomMode =
1491 if (allowedZoomMode) {
1493 QTimer::singleShot(0,
this, [
this] () {
1509 QSignalBlocker blocker(action);
1524 QString folderInStandardAppData;
1525 QString folderInPrivateAppData;
1528 if (!folderInPrivateAppData.isEmpty()) {
1530 const auto pathToDisplay = [](
const QString &path) {
1538 return QDir::toNativeSeparators(path).replace(QChar(
'\\'), QStringLiteral(
u"\\\u200B"));
1541 QMessageBox mbox(qApp->activeWindow());
1542 mbox.setIcon(QMessageBox::Information);
1543 mbox.setWindowTitle(i18nc(
"@title:window resource folder",
"Open Resource Folder"));
1546 mbox.setText(i18nc(
"@info resource folder",
1547 "<p>You are using the Microsoft Store package version of Krita. "
1548 "Even though Krita can be configured to place resources under the "
1549 "user AppData location, Windows may actually store the files "
1550 "inside a private app location.</p>\n"
1551 "<p>You should check both locations to determine where "
1552 "the files are located.</p>\n"
1553 "<p><b>User AppData</b>:<br/>\n"
1555 "<p><b>Private app location</b>:<br/>\n"
1557 pathToDisplay(folderInStandardAppData),
1558 pathToDisplay(folderInPrivateAppData)
1560 mbox.setTextInteractionFlags(Qt::NoTextInteraction);
1562 const auto *btnOpenUserAppData = mbox.addButton(i18nc(
"@action:button resource folder",
"Open in &user AppData"), QMessageBox::AcceptRole);
1563 const auto *btnOpenPrivateAppData = mbox.addButton(i18nc(
"@action:button resource folder",
"Open in &private app location"), QMessageBox::AcceptRole);
1565 mbox.addButton(QMessageBox::Close);
1566 mbox.setDefaultButton(QMessageBox::Close);
1569 if (mbox.clickedButton() == btnOpenPrivateAppData) {
1570 resourcePath = folderInPrivateAppData;
1571 }
else if (mbox.clickedButton() == btnOpenUserAppData) {
1580 QDesktopServices::openUrl(QUrl::fromLocalFile(resourcePath));
1587 Q_FOREACH (QDockWidget* dock, dockers) {
1592 if (qobject_cast<KoToolDocker*>(dock)) {
1596 QObjectList objects;
1597 objects.append(dock);
1598 while (!objects.isEmpty()) {
1599 QObject*
object = objects.takeFirst();
1600 objects.append(object->children());
1619 d->
currentImageView->showFloatingMessage(message, icon, timeout, priority, alignment);
1638 int timeoutMsec = 500;
1641 messageToClear.clear();
1648 if (haveZoomMessage) {
1649 if (haveRotationMessage) {
1654 }
else if (haveRotationMessage) {
1665 return qobject_cast<KisMainWindow*>(
d->
mainWindow);
1683 d->
currentImageView->canvasController()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1684 d->
currentImageView->canvasController()->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
1686 d->
currentImageView->canvasController()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
1687 d->
currentImageView->canvasController()->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
1710 KConfigGroup appAuthorGroup(KSharedConfig::openConfig(),
"Author");
1711 if (profileName.isEmpty() || profileName == i18nc(
"choice for author profile",
"Anonymous")) {
1712 appAuthorGroup.writeEntry(
"active-profile",
"");
1714 appAuthorGroup.writeEntry(
"active-profile", profileName);
1716 appAuthorGroup.sync();
1729 d->
actionAuthor->addAction(i18nc(
"choice for author profile",
"Anonymous"));
1731 KConfigGroup authorGroup(KSharedConfig::openConfig(),
"Author");
1735 QDir dir(authorInfo);
1736 Q_FOREACH(QString entry, dir.entryList(filters)) {
1737 int ln = QString(
".authorinfo").size();
1739 if (!profiles.contains(entry)) {
1740 profiles.append(entry);
1743 Q_FOREACH (
const QString &profile , profiles) {
1747 KConfigGroup appAuthorGroup(KSharedConfig::openConfig(),
"Author");
1748 QString profileName = appAuthorGroup.readEntry(
"active-profile",
"");
1750 if (profileName ==
"anonymous" || profileName.isEmpty()) {
1752 }
else if (profiles.contains(profileName)) {
1772 QSet<KoShape*> dummy;
1839 if (isOpacityPresetMode) {
float value(const T *src, size_t ch)
QList< QString > QStringList
A KisActionManager class keeps track of KisActions. These actions are always associated with the GUI....
void setView(QPointer< KisView > imageView)
KisAction * createAction(const QString &name)
KisAction * actionByName(const QString &name) const
KisAction * createStandardAction(KStandardAction::StandardAction, const QObject *receiver, const char *member)
void setDefaultShortcut(const QKeySequence &shortcut)
void mirrorCanvas(bool enable)
WrapAroundAxis wrapAroundModeAxis() const
void setUsePrintResolutionMode(bool value)
bool wrapAroundMode() const
bool levelOfDetailMode() const
void resetCanvasRotation()
void sigUsePrintResolutionModeChanged(bool value)
void setup(KisActionManager *actionManager)
void setView(QPointer< KisView >imageView)
void slotOnScreenResolutionChanged()
void slotImageSizeChanged()
void setFGColor(const KoColor &c)
void setColorHistory(const QList< KoColor > &colors)
void setResourceManager(KoCanvasResourceProvider *resourceManager)
void setBGColor(const KoColor &c)
void addProxy(KoProgressProxy *proxy)
void removeProxy(KoProgressProxy *proxy)
static KisConfigNotifier * instance()
bool hideScrollbars(bool defaultValue=false) const
void setShowDockers(const bool value) const
void setShowStatusBar(const bool value) const
void writeEntry(const QString &name, const T &value)
void writeKoColors(const QString &name, const QList< KoColor > &colors) const
bool fullscreenMode(bool defaultValue=false) const
bool pixelGridEnabled(bool defaultValue=false) const
void setRulersTrackMouse(bool value) const
bool hideScrollbarsFullscreen(bool defaultValue=false) const
bool showCanvasMessages(bool defaultValue=false) const
QList< KoColor > readKoColors(const QString &name) const
OutlineStyle lastUsedOutlineStyle(bool defaultValue=false) const
KoColor readKoColor(const QString &name, const KoColor &color=KoColor()) const
OutlineStyle newOutlineStyle(bool defaultValue=false) const
void setNewOutlineStyle(OutlineStyle style)
void setShowRulers(bool rulers) const
bool showDockers(bool defaultValue=false) const
bool useOpenGL(bool defaultValue=false) const
bool rulersTrackMouse(bool defaultValue=false) const
bool showStatusBar(bool defaultValue=false) const
bool showRulers(bool defaultValue=false) const
void setLastUsedOutlineStyle(OutlineStyle style)
void writeKoColor(const QString &name, const KoColor &color) const
KisPaintopBox * paintopBox()
void setup(QWidget *parent)
void setView(QPointer< KisView > imageView)
void setup(KisActionManager *actionManager)
void setFileBatchMode(const bool batchMode)
KoDocumentInfo * documentInfo() const
QString localFilePath() const
bool saveAs(const QString &path, const QByteArray &mimeType, bool showWarnings, KisPropertiesConfigurationSP exportConfiguration=0)
KisDocument * clone(bool addStorage=false)
creates a clone of the document and returns it. Please make sure that you hold all the necessary lock...
void setup(KisKActionCollection *ac, KisActionManager *actionManager)
void setView(QPointer< KisView >imageView)
void setView(QPointer< KisView >imageView)
void setup(KisActionManager *actionManager)
void setView(QPointer< KisView > view)
void setup(KisActionManager *actionManager)
void setImage(KisImageSP image)
void setView(QPointer< KisView >imageView)
void setup(KisActionManager *actionManager)
KisUndoAdapter * undoAdapter() const
KisCompositeProgressProxy * compositeProgressProxy()
A container for a set of QAction objects.
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
QAction * action(int index) const
KisView * addViewAndNotifyLoadingCompleted(KisDocument *document, QMdiSubWindow *subWindow=0)
QList< QDockWidget * > dockWidgets() const
Return the list of dock widgets belonging to this main window.
bool saveDocument(KisDocument *document, bool saveas, bool isExporting, bool isAdvancedExporting=false)
void setView(QPointer< KisView > imageView)
void setup(KisKActionCollection *collection)
void setView(QPointer< KisView >imageView)
void setup(KisKActionCollection *collection, KisActionManager *actionManager)
KisNodeSP activeNode()
Convenience function to get the active layer or mask.
KisPaintDeviceSP activePaintDevice()
Get the paint device the user wants to paint on now.
static KisPart * instance()
void addDocument(KisDocument *document, bool notify=true)
void queueAddRecentURLToAllMainWindowsOnFileSaved(QUrl url, QUrl oldUrl=QUrl())
QString resourceLocationBase() const
resourceLocationBase is the place where all resource storages (folder, bundles etc....
static KisResourceLocator * instance()
void setup(KisActionManager *actionManager)
void setView(QPointer< KisView >imageView)
void addUniqueConnection(Sender sender, Signal signal, Receiver receiver, Method method)
void addConnection(Sender sender, Signal signal, Receiver receiver, Method method, Qt::ConnectionType type=Qt::AutoConnection)
void setView(QPointer< KisView > imageView)
void hideAllStatusBarItems()
void showAllStatusBarItems()
KoProgressUpdater * progressUpdater()
static void createTemplate(const QString &templatesResourcePath, const char *suffix, KisDocument *document, QWidget *parent=0)
The KisTextPropertyManager class.
void setCanvasResourceProvider(KisCanvasResourceProvider *provider)
setCanvasResourceProvider set the canvas resource provider.
KisAction * rulersTrackMouseAction
KisAction * zoomToFitHeight
QScopedPointer< KoProgressUpdater > persistentUnthreadedProgressUpdaterRouter
QPointer< KisFloatingMessage > savedFloatingMessage
KisAction * wrapAroundAction
KisSelectionManager selectionManager
KisAction * wrapAroundHAxisAction
QPointer< KisView > currentImageView
KSelectAction * actionAuthor
KisSignalCompressor guiUpdateCompressor
KisInputManager inputManager
QActionGroup * wrapAroundAxisActions
KisFilterManager filterManager
KisSignalAutoConnectionsStore viewConnections
KisAction * viewPrintSize
BlockingUserInputEventFilter blockingEventFilter
KisIdleTasksManager idleTasksManager
KisAction * showRulersAction
KisCanvasControlsManager canvasControlsManager
QByteArray canvasStateInCanvasOnlyMode
KisGuidesManager guidesManager
QPointer< KoUpdater > persistentUnthreadedProgressUpdater
KisAction * rotateCanvasRight
KisViewManagerPrivate(KisViewManager *_q, KisKActionCollection *_actionCollection, QWidget *_q_parent)
KisMirrorManager mirrorManager
QDeadlineTimer zoomRotationMessageTimer
KisAction * saveIncrementalBackup
QPoint canvasOnlyOffsetCompensation
QByteArray canvasStateInNormalMode
KisAction * toggleBrushOutline
KisAction * rotateCanvasLeft
KisActionManager actionManager
KisAction * levelOfDetailAction
QPointer< KoUpdater > persistentImageProgressUpdater
KisDecorationsManager paintingAssistantsManager
KisAction * showPixelGrid
KisAction * wrapAroundVAxisAction
KisImageManager imageManager
KisAction * openResourcesDirectory
KisCanvasResourceProvider canvasResourceProvider
KisAction * resetCanvasRotation
KisAction * wrapAroundHVAxisAction
KisKActionCollection * actionCollection
KisGridManager gridManager
KisAction * saveIncremental
KoCanvasResourceProvider canvasResourceManager
KisControlFrame controlFrame
KisAction * toggleZoomToFit
bool blockUntilOperationsFinishedImpl(KisImageSP image, bool force)
std::optional< CanvasOnlyOptions > canvasOnlyOptions
KisAction * createTemplate
KisAction * zoomToFitWidth
KisTextPropertiesManager textPropertyManager
KisNodeManager nodeManager
void slotUpdatePixelGridAction()
bool blockUntilOperationsFinished(KisImageSP image)
blockUntilOperationsFinished blocks the GUI of the application until execution of actions on image is...
KisMainWindow * mainWindow() const
void slotCreateTemplate()
KisDocument * document() const
static void initializeResourceManager(KoCanvasResourceProvider *resourceManager)
KisFilterManager * filterManager()
The filtermanager handles everything action-related to filters.
void slotSaveRulersTrackMouseState(bool value)
KisActionManager * actionManager() const
void floatingMessageRequested(const QString &message, const QString &iconName)
void updateIcons()
Update the style of all the icons.
KisIdleTasksManager * idleTasksManager()
KisCanvas2 * canvasBase() const
Return the canvas base class.
void switchCanvasOnly(bool toggled)
KisUndoAdapter * undoAdapter()
The undo adapter is used to add commands to the undo stack.
void showFloatingZoomMessage(const QString &message)
void slotActivateTransformTool()
void setCurrentView(KisView *view)
void slotSaveIncremental()
void brushOutlineToggled()
void openResourcesDirectory()
void setQtMainWindow(QMainWindow *newMainWindow)
KisImageManager * imageManager()
void handleFloatingZoomRotationMessage(QString &messageToClear)
KisSelectionSP selection()
void setShowFloatingMessage(bool show)
void slotUpdateAuthorProfileActions()
void enableControls()
disable and enable toolbar controls. used for disabling them during painting.
void updateCanvasOnlyActionState()
QPointer< KoUpdater > createThreadedUpdater(const QString &name)
QWidget * canvas() const
Return the actual widget that is displaying the current image.
void viewChanged()
viewChanged sent out when the view has changed.
KisLayerSP activeLayer()
Convenience method to get at the active layer.
KisPaintDeviceSP activeDevice()
Convenience method to get at the active paint device.
void slotViewAdded(KisView *view)
void blockUntilOperationsFinishedForced(KisImageSP image)
blockUntilOperationsFinished blocks the GUI of the application until execution of actions on image is...
virtual KisKActionCollection * actionCollection() const
void showHideScrollbars()
void slotSaveIncrementalBackup()
void showStatusBar(bool toggled)
KisInputManager * inputManager() const
Filters events and sends them to canvas actions.
QPointer< KoUpdater > createUnthreadedUpdater(const QString &name)
create a new progress updater
QMainWindow * qtMainWindow() const
~KisViewManager() override
KisViewManagerPrivate *const d
KisNodeManager * nodeManager() const
The node manager handles everything about nodes.
void slotSaveShowRulersState(bool value)
void slotToggleBrushOutline()
KisSelectionManager * selectionManager()
void slotViewRemoved(KisView *view)
KisGuidesManager * guidesManager() const
QWidget * mainWindowAsQWidget() const
void slotCreateOpacityResource(bool isOpacityPresetMode, KoToolBase *tool)
KisImageWSP image() const
Return the image this view is displaying.
KisViewManager(QWidget *parent, KisKActionCollection *actionCollection)
void toggleTabletLogger()
static void testingInitializeOpacityToPresetResourceConverter(KoCanvasResourceProvider *resourceManager)
void showFloatingRotationMessage(const QString &message)
KisGridManager * gridManager() const
void notifyWorkspaceLoaded()
KisZoomManager * zoomManager()
The zoommanager handles everything action-related to zooming.
KisCanvasResourceProvider * canvasResourceProvider()
KisStatusBar * statusBar() const
Return the wrapper class around the statusbar.
KisTextPropertiesManager * textPropertyManager() const
void changeAuthorProfile(const QString &profileName)
KisPaintopBox * paintOpBox() const
bool selectionEditable()
Checks if the current global or local selection is editable.
void showFloatingMessage(const QString &message, const QIcon &icon, int timeout=4500, KisFloatingMessage::Priority priority=KisFloatingMessage::Medium, int alignment=Qt::AlignCenter|Qt::TextWordWrap)
shows a floating message in the top right corner of the canvas
KisViewManager * viewManager
void effectiveZoomChanged(qreal zoom)
void addActiveCanvasResourceDependency(KoActiveCanvasResourceDependencySP dep)
void setHandleRadius(int handleSize)
void setBackgroundColor(const KoColor &color)
KoColor foregroundColor() const
KoColor backgroundColor() const
void setForegroundColor(const KoColor &color)
void addResourceUpdateMediator(KoResourceUpdateMediatorSP mediator)
void addDerivedResourceConverter(KoDerivedResourceConverterSP converter)
void setAboutInfo(const QString &info, const QString &data)
QString aboutInfo(const QString &info) const
QPointer< KoUpdater > startSubtask(int weight=1, const QString &name=QString(), bool isPersistent=false)
static void getAllUserResourceFoldersLocationsForWindowsStore(QString &standardLocation, QString &privateLocation)
getAllAppDataLocationsForWindowsStore Use this to get both private and general appdata folders which ...
static QString getAppDataLocation()
void sigUsePrintResolutionModeChanged(bool value)
void setUsePrintResolutionMode(bool value)
@ ZOOM_HEIGHT
zoom pageheight
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
QSharedPointer< T > toQShared(T *ptr)
QString button(const QWheelEvent &ev)
int main(int argc, char **argv)
QIcon loadIcon(const QString &name)
void updateIconCommon(QObject *object)
@ BackgroundColor
The active background color selected for this canvas.
@ ForegroundColor
The active foreground color selected for this canvas.
bool isEditable(bool checkVisibility=true) const
virtual KisSelectionMaskSP selectionMask() const
static KisResourceItemChooserSync * instance()
bool operator==(const CanvasOnlyOptions &rhs)
bool hideTitlebarFullscreen
bool hideStatusbarFullscreen
CanvasOnlyOptions(const KisConfig &cfg)
bool hideDockersFullscreen
bool hideToolbarFullscreen
static KoColorSpaceRegistry * instance()
const KoColorSpace * rgb8(const QString &profileName=QString())