Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_config.cc
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2002 Patrick Julien <freak@codepimps.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#include "kis_config.h"
8
9#include <QtGlobal>
10#include <QApplication>
11#include <QScreen>
12#include <QThread>
13#include <QStringList>
14#include <QSettings>
15#include <QStandardPaths>
16#include <QDebug>
17#include <QFileInfo>
18#include <QScreen>
19
20#include <kconfig.h>
21
22#include <KisDocument.h>
23#include <KisResourceLocator.h>
24
25#include <KoColor.h>
28#include <KoColorProfile.h>
29#include <KoPointerEvent.h>
30
31#include <kis_debug.h>
32#include <kis_types.h>
33
35#include "kis_config_notifier.h"
36#include "kis_snap_config.h"
37
38#include <config-ocio.h>
39
40#include <kis_color_manager.h>
42#include <KisUsageLogger.h>
43#include <kis_image_config.h>
45#include <QSurfaceFormat>
46
47#if defined Q_OS_WIN && QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
48# include <QtGui/private/qguiapplication_p.h>
49# include <QtGui/qpa/qplatformintegration.h>
50#endif
51
53 : m_cfg( KSharedConfig::openConfig()->group(""))
54 , m_readOnly(readOnly)
55{
56 if (!readOnly) {
57 KIS_SAFE_ASSERT_RECOVER_RETURN(qApp && qApp->thread() == QThread::currentThread());
58 }
59}
60
62{
63 if (m_readOnly) return;
64
65 if (qApp && qApp->thread() != QThread::currentThread()) {
66 dbgKrita.noquote() << "WARNING: KisConfig: requested config synchronization from nonGUI thread! Called from:" << kisBacktrace();
67 return;
68 }
69
70 m_cfg.sync();
71}
72
74{
75 KisUsageLogger::writeSysInfo("Current Settings\n");
76 KisUsageLogger::writeSysInfo(QString(" Current Swap Location: %1").arg(KisImageConfig(true).swapDir()));
77 KisUsageLogger::writeSysInfo(QString(" Current Swap Location writable: %1").arg(QFileInfo(KisImageConfig(true).swapDir()).isWritable() ? "true" : "false"));
78 KisUsageLogger::writeSysInfo(QString(" Undo Enabled: %1").arg(undoEnabled()? "true" : "false"));
79 KisUsageLogger::writeSysInfo(QString(" Undo Stack Limit: %1").arg(undoStackLimit()));
80 KisUsageLogger::writeSysInfo(QString(" Use OpenGL: %1").arg(useOpenGL() ? "true" : "false"));
81 KisUsageLogger::writeSysInfo(QString(" Use OpenGL Texture Buffer: %1").arg(useOpenGLTextureBuffer() ? "true" : "false"));
82 KisUsageLogger::writeSysInfo(QString(" Disable Vector Optimizations: %1").arg(disableVectorOptimizations() ? "true" : "false"));
83 KisUsageLogger::writeSysInfo(QString(" Disable AVX Optimizations: %1").arg(disableAVXOptimizations() ? "true" : "false"));
84 KisUsageLogger::writeSysInfo(QString(" Canvas State: %1").arg(canvasState()));
85 KisUsageLogger::writeSysInfo(QString(" Autosave Interval: %1").arg(autoSaveInterval()));
86 KisUsageLogger::writeSysInfo(QString(" Use Backup Files: %1").arg(backupFile() ? "true" : "false"));
87 KisUsageLogger::writeSysInfo(QString(" Number of Backups Kept: %1").arg(m_cfg.readEntry("numberofbackupfiles", 1)));
88 KisUsageLogger::writeSysInfo(QString(" Backup File Suffix: %1").arg(m_cfg.readEntry("backupfilesuffix", "~")));
89
90 QString backupDir;
91 switch(m_cfg.readEntry("backupfilelocation", 0)) {
92 case 1:
93 backupDir = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
94 break;
95 case 2:
96 backupDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
97 break;
98 default:
99 // Do nothing: the empty string is user file location
100 backupDir = "Same Folder as the File";
101 }
102 KisUsageLogger::writeSysInfo(QString(" Backup Location: %1").arg(backupDir));
103 KisUsageLogger::writeSysInfo(QString(" Backup Location writable: %1").arg(QFileInfo(backupDir).isWritable() ? "true" : "false"));
104 KisUsageLogger::writeSysInfo(QString(" Resource Location: %1").arg(m_cfg.readEntry(KisResourceLocator::resourceLocationKey)));
105
106 KisUsageLogger::writeSysInfo(QString(" Use Win8 Pointer Input: %1").arg(useWin8PointerInput() ? "true" : "false"));
107 KisUsageLogger::writeSysInfo(QString(" Use RightMiddleTabletButton Workaround: %1").arg(useRightMiddleTabletButtonWorkaround() ? "true" : "false"));
108 KisUsageLogger::writeSysInfo(QString(" Levels of Detail Enabled: %1").arg(levelOfDetailEnabled() ? "true" : "false"));
109 KisUsageLogger::writeSysInfo(QString(" Use Zip64: %1").arg(useZip64() ? "true" : "false"));
110
112
113 // Tablet API information
114#if defined Q_OS_WIN && QT_VERSION > QT_VERSION_CHECK(6, 0, 0)
115{
116 auto tabletAPIName = [] (bool useWinTab) {
117 return useWinTab ? "WinTab" : "WinInk";
118 };
119
120 QString actualTabletProtocol = "<unknown>";
121
122 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
123 if (auto nativeWindowsApp = dynamic_cast<QWindowsApplication *>(QGuiApplicationPrivate::platformIntegration())) {
124 actualTabletProtocol = tabletAPIName(nativeWindowsApp->isWinTabEnabled());
125 } else {
126 KisUsageLogger::log("WARNING: Failed to fetch WinTab protocol status: QWindowsApplication is not available");
127 }
128
129 KisUsageLogger::writeSysInfo("Tablet API Information\n");
130 KisUsageLogger::writeSysInfo(QString(" User-selected tablet API: %1").arg(tabletAPIName(!useWin8PointerInput())));
131 KisUsageLogger::writeSysInfo(QString(" Actually used tablet API: %1").arg(actualTabletProtocol));
133}
134#endif
135
136}
137
139{
140 if (defaultValue) {
141 return TOUCH_PAINTING_AUTO;
142 } else {
143 int value = m_cfg.readEntry("touchPainting", int(TOUCH_PAINTING_AUTO));
144 return TouchPainting(value);
145 }
146}
147
149{
150 m_cfg.writeEntry("touchPainting", int(value));
152}
153
155{
156 switch (touchPainting()) {
158 return false;
160 return true;
161 default:
162 // Automatic detection: enable or disable touch input based on whether
163 // we've received a tablet input during this session and therefore know
164 // that the user has a pen available.
166 }
167}
168
169bool KisConfig::useProjections(bool defaultValue) const
170{
171 return (defaultValue ? true : m_cfg.readEntry("useProjections", true));
172}
173
174void KisConfig::setUseProjections(bool useProj) const
175{
176 m_cfg.writeEntry("useProjections", useProj);
177}
178
179bool KisConfig::undoEnabled(bool defaultValue) const
180{
181 return (defaultValue ? true : m_cfg.readEntry("undoEnabled", true));
182}
183
184void KisConfig::setUndoEnabled(bool undo) const
185{
186 m_cfg.writeEntry("undoEnabled", undo);
187}
188
189int KisConfig::undoStackLimit(bool defaultValue) const
190{
191 return (defaultValue ? 200 : m_cfg.readEntry("undoStackLimit", 200));
192}
193
194void KisConfig::setUndoStackLimit(int limit) const
195{
196 m_cfg.writeEntry("undoStackLimit", limit);
197}
198
199bool KisConfig::useCumulativeUndoRedo(bool defaultValue) const
200{
201 return (defaultValue ? false : m_cfg.readEntry("useCumulativeUndoRedo",false));
202}
203
205{
206 m_cfg.writeEntry("useCumulativeUndoRedo", value);
207}
208
210{
211 if (defaultValue) {
213 }
214
216 data.read(&m_cfg);
217 return data;
218}
219
224
225qint32 KisConfig::defImageWidth(bool defaultValue) const
226{
227 return (defaultValue ? 2480 : m_cfg.readEntry("imageWidthDef", 2480));
228}
229
230qint32 KisConfig::defImageHeight(bool defaultValue) const
231{
232 return (defaultValue ? 3508 : m_cfg.readEntry("imageHeightDef", 3508));
233}
234
235qreal KisConfig::defImageResolution(bool defaultValue) const
236{
237 return (defaultValue ? 300.0 : m_cfg.readEntry("imageResolutionDef", 300.0)) / 72.0;
238}
239
240QString KisConfig::defColorModel(bool defaultValue) const
241{
242 return (defaultValue ? KoColorSpaceRegistry::instance()->rgb8()->colorModelId().id()
243 : m_cfg.readEntry("colorModelDef", KoColorSpaceRegistry::instance()->rgb8()->colorModelId().id()));
244}
245
246void KisConfig::defColorModel(const QString & model) const
247{
248 m_cfg.writeEntry("colorModelDef", model);
249}
250
251QString KisConfig::defaultColorDepth(bool defaultValue) const
252{
253 return (defaultValue ? KoColorSpaceRegistry::instance()->rgb8()->colorDepthId().id()
254 : m_cfg.readEntry("colorDepthDef", KoColorSpaceRegistry::instance()->rgb8()->colorDepthId().id()));
255}
256
257void KisConfig::setDefaultColorDepth(const QString & depth) const
258{
259 m_cfg.writeEntry("colorDepthDef", depth);
260}
261
262QString KisConfig::defColorProfile(bool defaultValue) const
263{
264 return (defaultValue ? KoColorSpaceRegistry::instance()->rgb8()->profile()->name() :
265 m_cfg.readEntry("colorProfileDef",
266 KoColorSpaceRegistry::instance()->rgb8()->profile()->name()));
267}
268
269void KisConfig::defColorProfile(const QString & profile) const
270{
271 m_cfg.writeEntry("colorProfileDef", profile);
272}
273
274void KisConfig::defImageWidth(qint32 width) const
275{
276 m_cfg.writeEntry("imageWidthDef", width);
277}
278
279void KisConfig::defImageHeight(qint32 height) const
280{
281 m_cfg.writeEntry("imageHeightDef", height);
282}
283
284void KisConfig::defImageResolution(qreal res) const
285{
286 m_cfg.writeEntry("imageResolutionDef", res*72.0);
287}
288
290{
291 return defaultValue ? 100.0 : m_cfg.readEntry("preferredVectorImportResolution", 100.0);
292}
293
295{
296 m_cfg.writeEntry("preferredVectorImportResolution", value);
297}
298
299bool KisConfig::useDefaultColorSpace(bool defaultvalue) const
300{
301 return (defaultvalue? false: m_cfg.readEntry("useDefaultColorSpace", false));
302}
303
305{
306 m_cfg.writeEntry("useDefaultColorSpace", value);
307}
308
309// brush cursor settings
310
311void cleanOldCursorStyleKeys(KConfigGroup &cfg)
312{
313 if (cfg.hasKey("newCursorStyle") &&
314 cfg.hasKey("newOutlineStyle")) {
315
316 cfg.deleteEntry("cursorStyleDef");
317 }
318}
319
321{
322 if (defaultValue) {
324 }
325
326
327 int style = m_cfg.readEntry("newCursorStyle", int(-1));
328
329 if (style < 0) {
330 // old style format
331 style = m_cfg.readEntry("cursorStyleDef", int(OLD_CURSOR_STYLE_OUTLINE));
332
333 switch (style) {
335 style = CURSOR_STYLE_TOOLICON;
336 break;
340 break;
342 style = CURSOR_STYLE_POINTER;
343 break;
347 break;
351 break;
355 break;
359 break;
360 default:
361 style = -1;
362 }
363 }
364
366
367 // compatibility with future versions
368 if (style < 0 || style >= N_CURSOR_STYLE_SIZE) {
370 }
371
372 return (CursorStyle) style;
373}
374
376{
377 m_cfg.writeEntry("newCursorStyle", (int)style);
378}
379
380QColor KisConfig::getCursorMainColor(bool defaultValue) const
381{
382 QColor col;
383 col.setRgbF(1.0, 0.0, 1.0);
384 return (defaultValue ? col : m_cfg.readEntry("cursorMaincColor", col));
385}
386
387void KisConfig::setCursorMainColor(const QColor &v) const
388{
389 m_cfg.writeEntry("cursorMaincColor", v);
390}
391
393{
394 if (defaultValue) {
395 return OUTLINE_FULL;
396 }
397
398 int style = m_cfg.readEntry("newOutlineStyle", int(-1));
399
400 if (style < 0) {
401 // old style format
402 style = m_cfg.readEntry("cursorStyleDef", int(OLD_CURSOR_STYLE_OUTLINE));
403
404 switch (style) {
412 style = OUTLINE_NONE;
413 break;
419 style = OUTLINE_FULL;
420 break;
421 default:
422 style = -1;
423 }
424 }
425
427
428 // compatibility with future versions
429 if (style < 0 || style >= N_OUTLINE_STYLE_SIZE) {
430 style = OUTLINE_FULL;
431 }
432
433 return (OutlineStyle) style;
434}
435
437{
438 m_cfg.writeEntry("newOutlineStyle", (int)style);
439}
440
442{
443 if (defaultValue) {
444 return OUTLINE_NONE;
445 }
446
447 int style = m_cfg.readEntry("lastUsedOutlineStyle", int(-1));
448
449 return (OutlineStyle) style;
450}
451
453{
454 m_cfg.writeEntry("lastUsedOutlineStyle", (int)style);
455}
456
457// eraser cursor settings
458
459bool KisConfig::separateEraserCursor(bool defaultValue) const
460{
461 return (defaultValue ? false : m_cfg.readEntry("separateEraserCursor", false));
462}
463
465{
466 m_cfg.writeEntry("separateEraserCursor", value);
467}
468
470{
471 if (defaultValue) {
472 return CURSOR_STYLE_ERASER;
473 }
474
475 int style = m_cfg.readEntry("eraserCursorStyle", int(-1));
476
477 // compatibility with future versions
478 if (style < 0 || style >= N_CURSOR_STYLE_SIZE) {
479 style = CURSOR_STYLE_ERASER;
480 }
481
482 return (CursorStyle) style;
483}
484
486{
487 m_cfg.writeEntry("eraserCursorStyle", (int)style);
488}
489
490QColor KisConfig::getEraserCursorMainColor(bool defaultValue) const
491{
492 QColor col;
493 col.setRgbF(0.501961, 1.0, 0.501961);
494 return (defaultValue ? col : m_cfg.readEntry("eraserCursorMaincColor", col));
495}
496
497void KisConfig::setEraserCursorMainColor(const QColor &v) const
498{
499 m_cfg.writeEntry("eraserCursorMaincColor", v);
500}
501
503{
504 if (defaultValue) {
505 return OUTLINE_FULL;
506 }
507
508 int style = m_cfg.readEntry("eraserOutlineStyle", int(-1));
509
510 // compatibility with future versions
511 if (style < 0 || style >= N_OUTLINE_STYLE_SIZE) {
512 style = OUTLINE_FULL;
513 }
514
515 return (OutlineStyle) style;
516}
517
519{
520 m_cfg.writeEntry("eraserOutlineStyle", (int)style);
521}
522
524{
525 return m_cfg.readEntry("colorPreviewRect", QVariant(QRect(32, 32, 48, 48))).toRect();
526}
527
529{
530 m_cfg.writeEntry("colorPreviewRect", QVariant(rect));
531}
532
533bool KisConfig::useDirtyPresets(bool defaultValue) const
534{
535 return (defaultValue ? false : m_cfg.readEntry("useDirtyPresets", true));
536}
538{
539 m_cfg.writeEntry("useDirtyPresets",value);
541}
542
543bool KisConfig::useEraserBrushSize(bool defaultValue) const
544{
545 return (defaultValue ? false : m_cfg.readEntry("useEraserBrushSize", false));
546}
547
549{
550 m_cfg.writeEntry("useEraserBrushSize",value);
552}
553
554bool KisConfig::useEraserBrushOpacity(bool defaultValue) const
555{
556 return (defaultValue ? false : m_cfg.readEntry("useEraserBrushOpacity",false));
557}
558
560{
561 m_cfg.writeEntry("useEraserBrushOpacity",value);
563}
564
565QPoint KisConfig::getDefaultGridSpacing(bool defaultValue) const
566{
567 return (defaultValue ? QPoint(16, 16) : m_cfg.readEntry("defaultGridSpacing", QPoint(16, 16)));
568}
569
570void KisConfig::setDefaultGridSpacing(QPoint gridSpacing)
571{
572 m_cfg.writeEntry("defaultGridSpacing", gridSpacing);
573}
574
575QString KisConfig::getMDIBackgroundColor(bool defaultValue) const
576{
577 QColor col(77, 77, 77);
579 kol.fromQColor(col);
580 QString xml = kol.toXML();
581 return (defaultValue ? xml : m_cfg.readEntry("mdiBackgroundColorXML", xml));
582}
583
584void KisConfig::setMDIBackgroundColor(const QString &v) const
585{
586 m_cfg.writeEntry("mdiBackgroundColorXML", v);
587}
588
589QString KisConfig::getMDIBackgroundImage(bool defaultValue) const
590{
591 return (defaultValue ? "" : m_cfg.readEntry("mdiBackgroundImage", ""));
592}
593
594void KisConfig::setMDIBackgroundImage(const QString &filename) const
595{
596 m_cfg.writeEntry("mdiBackgroundImage", filename);
597}
598
600{
601 return (defaultValue ? true : m_cfg.readEntry("enableCanvasSurfaceColorSpaceManagement",true));
602}
603
605{
606 m_cfg.writeEntry("enableCanvasSurfaceColorSpaceManagement", value);
607}
608
610 QString modeStr = defaultValue ? "preferred" : m_cfg.readEntry("canvasSurfaceColorSpaceManagementMode", "preferred");
611
612 if (modeStr == "preferred") {
614 } else if (modeStr == "rec709g22") {
616 } else if (modeStr == "rec709g10") {
618 } else if (modeStr == "unmanaged") {
620 } else {
622 }
623}
624
626 QString modeStr;
627
628 switch (value) {
630 modeStr = "preferred";
631 break;
633 modeStr = "rec709g22";
634 break;
636 modeStr = "rec709g10";
637 break;
639 modeStr = "unmanaged";
640 break;
641 }
642
643 m_cfg.writeEntry("canvasSurfaceColorSpaceManagementMode", modeStr);
644}
645
646
648{
649 QString modeStr = defaultValue ? "auto" : settings->value("canvasSurfaceBitDepthMode", "auto").toString();
650
651 if (modeStr == "auto") {
653 } else if (modeStr == "8bit") {
655 } else if (modeStr == "10bit") {
657 }
658
660}
661
663{
664 QString modeStr;
665
666 switch (value) {
668 modeStr = "auto";
669 break;
671 modeStr = "8bit";
672 break;
674 modeStr = "10bit";
675 break;
676 }
677
678 settings->setValue("canvasSurfaceBitDepthMode", modeStr);
679}
680
682{
683 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
684 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
685 return canvasSurfaceBitDepthMode(&kritarc, defaultValue);
686}
687
689{
690 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
691 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
693}
694
696{
697 auto mode = canvasSurfaceBitDepthMode();
698
700 if (format.redBufferSize() == 10 &&
701 format.greenBufferSize() == 10 &&
702 format.blueBufferSize() == 10) {
703
705 } else {
707 }
708 }
709
710 return mode;
711}
712
713
714QString KisConfig::monitorProfile(int screen) const
715{
716 // Note: keep this in sync with the default profile for the RGB colorspaces!
717 const QString defaultProfile = "sRGB-elle-V2-srgbtrc.icc";
718
719 QString profile;
720 const QString screenIdentifier = getScreenStringIdentfier(screen);
721 const QString screenIdentifierKey = "monitorProfile" + screenIdentifier;
722
728 if (!screenIdentifier.isEmpty() && m_cfg.hasKey(screenIdentifierKey)) {
729 profile = m_cfg.readEntry(screenIdentifierKey, defaultProfile);
730 } else {
731 profile = m_cfg.readEntry("monitorProfile" + QString(screen == 0 ? "": QString("_%1").arg(screen)), defaultProfile);
732 }
733
734 //dbgKrita << "KisConfig::monitorProfile()" << profile;
735 return profile;
736}
737
738QString KisConfig::monitorForScreen(int screen, const QString &defaultMonitor, bool defaultValue) const
739{
740 return (defaultValue ? defaultMonitor
741 : m_cfg.readEntry(QString("monitor_for_screen_%1").arg(screen), defaultMonitor));
742}
743
744void KisConfig::setMonitorForScreen(int screen, const QString& monitor)
745{
746 m_cfg.writeEntry(QString("monitor_for_screen_%1").arg(screen), monitor);
747}
748
749void KisConfig::setMonitorProfile(int screen, const QString & monitorProfile, bool override) const
750{
751 m_cfg.writeEntry("monitorProfile/OverrideX11", override);
752 m_cfg.writeEntry("monitorProfile" + QString(screen == 0 ? "": QString("_%1").arg(screen)), monitorProfile);
753 if (!getScreenStringIdentfier(screen).isEmpty()) {
754 m_cfg.writeEntry("monitorProfile" + getScreenStringIdentfier(screen), monitorProfile);
755 }
756}
757
758// TODO: rename into getSystemScreenProfile
760{
761 if (screen < 0) return 0;
762
763 KisConfig cfg(true);
764 QString monitorId;
765 if (KisColorManager::instance()->devices().size() > screen) {
766 monitorId = cfg.monitorForScreen(screen, KisColorManager::instance()->devices()[screen]);
767 }
768 //dbgKrita << "getScreenProfile(). Screen" << screen << "monitor id" << monitorId;
769
770 if (monitorId.isEmpty()) {
771 return 0;
772 }
773
774 QByteArray bytes = KisColorManager::instance()->displayProfile(monitorId);
775
776 //dbgKrita << "\tgetScreenProfile()" << bytes.size();
777 const KoColorProfile * profile = 0;
778 if (bytes.length() > 0) {
780 //dbgKrita << "\tKisConfig::getScreenProfile for screen" << screen << profile->name();
781 }
782 return profile;
783}
784
786{
787 if (screen < 0) return 0;
788
789 // if the user plays with the settings, they can override the display profile, in which case
790 // we don't want the system setting.
791 bool override = useSystemMonitorProfile();
792 //dbgKrita << "KisConfig::displayProfile(). Override X11:" << override;
793 const KoColorProfile *profile = 0;
794 if (override) {
795 //dbgKrita << "\tGoing to get the screen profile";
796 profile = KisConfig::getScreenProfile(screen);
797 }
798
799 // if it fails. check the configuration
800 if (!profile || !profile->isSuitableForDisplay()) {
801 //dbgKrita << "\tGoing to get the monitor profile";
802 QString monitorProfileName = monitorProfile(screen);
803 //dbgKrita << "\t\tmonitorProfileName:" << monitorProfileName;
804 if (!monitorProfileName.isEmpty()) {
805 profile = KoColorSpaceRegistry::instance()->profileByName(monitorProfileName);
806 }
807 if (profile) {
808 //dbgKrita << "\t\tsuitable for display" << profile->isSuitableForDisplay();
809 }
810 else {
811 //dbgKrita << "\t\tstill no profile";
812 }
813 }
814 // if we still don't have a profile, or the profile isn't suitable for display,
815 // we need to get a last-resort profile. the built-in sRGB is a good choice then.
816 if (!profile || !profile->isSuitableForDisplay()) {
817 //dbgKrita << "\tnothing worked, going to get sRGB built-in";
818 profile = KoColorSpaceRegistry::instance()->profileByName("sRGB Built-in");
819 }
820
821 if (profile) {
822 //dbgKrita << "\tKisConfig::displayProfile for screen" << screen << "is" << profile->name();
823 }
824 else {
825 //dbgKrita << "\tCouldn't get a display profile at all";
826 }
827
828 return profile;
829}
830
831const QString KisConfig::getScreenStringIdentfier(int screenNo) const {
832 if (screenNo < 0 || screenNo >= QGuiApplication::screens().length()) {
833 return QString();
834 }
835 QScreen* screen = QGuiApplication::screens()[screenNo];
836
837 QString manufacturer = screen->manufacturer();
838 QString model = screen->model();
839 QString serialNumber = screen->serialNumber();
840
841 if (manufacturer == "" && model == "" && serialNumber == "") {
842 return QString(); // it would be scary to base the profile just on resolution
843 }
844
845 QString identifier = QStringList({manufacturer, model, serialNumber}).join("_");
846 return identifier;
847}
848
849QString KisConfig::workingColorSpace(bool defaultValue) const
850{
851 return (defaultValue ? "RGBA" : m_cfg.readEntry("workingColorSpace", "RGBA"));
852}
853
854void KisConfig::setWorkingColorSpace(const QString & workingColorSpace) const
855{
856 m_cfg.writeEntry("workingColorSpace", workingColorSpace);
857}
858
859QString KisConfig::printerColorSpace(bool /*defaultValue*/) const
860{
861 //TODO currently only rgb8 is supported
862 //return (defaultValue ? "RGBA" : m_cfg.readEntry("printerColorSpace", "RGBA"));
863 return QString("RGBA");
864}
865
866void KisConfig::setPrinterColorSpace(const QString & printerColorSpace) const
867{
868 m_cfg.writeEntry("printerColorSpace", printerColorSpace);
869}
870
871
872QString KisConfig::printerProfile(bool defaultValue) const
873{
874 return (defaultValue ? "" : m_cfg.readEntry("printerProfile", ""));
875}
876
877void KisConfig::setPrinterProfile(const QString & printerProfile) const
878{
879 m_cfg.writeEntry("printerProfile", printerProfile);
880}
881
882
883bool KisConfig::useBlackPointCompensation(bool defaultValue) const
884{
885 return (defaultValue ? true : m_cfg.readEntry("useBlackPointCompensation", true));
886}
887
888void KisConfig::setUseBlackPointCompensation(bool useBlackPointCompensation) const
889{
890 m_cfg.writeEntry("useBlackPointCompensation", useBlackPointCompensation);
891}
892
893bool KisConfig::allowLCMSOptimization(bool defaultValue) const
894{
895 return (defaultValue ? true : m_cfg.readEntry("allowLCMSOptimization", true));
896}
897
898void KisConfig::setAllowLCMSOptimization(bool allowLCMSOptimization)
899{
900 m_cfg.writeEntry("allowLCMSOptimization", allowLCMSOptimization);
901}
902
903bool KisConfig::forcePaletteColors(bool defaultValue) const
904{
905 return (defaultValue ? false : m_cfg.readEntry("colorsettings/forcepalettecolors", false));
906}
907
908void KisConfig::setForcePaletteColors(bool forcePaletteColors)
909{
910 m_cfg.writeEntry("colorsettings/forcepalettecolors", forcePaletteColors);
911}
912
913bool KisConfig::colorHistoryPerDocument(bool defaultValue) const
914{
915 KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
916 return (defaultValue ? false : cfg.readEntry("lastUsedColorsPerDocument", false));
917}
918
919bool KisConfig::showRulers(bool defaultValue) const
920{
921 return (defaultValue ? false : m_cfg.readEntry("showrulers", false));
922}
923
924void KisConfig::setShowRulers(bool rulers) const
925{
926 m_cfg.writeEntry("showrulers", rulers);
927}
928
929bool KisConfig::forceShowSaveMessages(bool defaultValue) const
930{
931 return (defaultValue ? false : m_cfg.readEntry("forceShowSaveMessages", false));
932}
933
935{
936 m_cfg.writeEntry("forceShowSaveMessages", value);
937}
938
939bool KisConfig::forceShowAutosaveMessages(bool defaultValue) const
940{
941 return (defaultValue ? false : m_cfg.readEntry("forceShowAutosaveMessages", false));
942}
943
945{
946 m_cfg.writeEntry("forceShowAutosaveMessages", value);
947}
948
949bool KisConfig::rulersTrackMouse(bool defaultValue) const
950{
951 return (defaultValue ? true : m_cfg.readEntry("rulersTrackMouse", true));
952}
953
955{
956 m_cfg.writeEntry("rulersTrackMouse", value);
957}
958
959qint32 KisConfig::pasteBehaviour(bool defaultValue) const
960{
961 return (defaultValue ? 2 : m_cfg.readEntry("pasteBehaviour", 2));
962}
963
964void KisConfig::setPasteBehaviour(qint32 renderIntent) const
965{
966 m_cfg.writeEntry("pasteBehaviour", renderIntent);
967}
968
969qint32 KisConfig::pasteFormat(bool defaultValue) const
970{
971 return defaultValue ? 0 : m_cfg.readEntry("pasteFormat", 0);
972}
973
974void KisConfig::setPasteFormat(qint32 format)
975{
976 m_cfg.writeEntry("pasteFormat", format);
977}
978
979qint32 KisConfig::monitorRenderIntent(bool defaultValue) const
980{
981 qint32 intent = m_cfg.readEntry("renderIntent", INTENT_PERCEPTUAL);
982 if (intent > 3) intent = 3;
983 if (intent < 0) intent = 0;
984 return (defaultValue ? INTENT_PERCEPTUAL : intent);
985}
986
987void KisConfig::setRenderIntent(qint32 renderIntent) const
988{
989 if (renderIntent > 3) renderIntent = 3;
990 if (renderIntent < 0) renderIntent = 0;
991 m_cfg.writeEntry("renderIntent", renderIntent);
992}
993
994bool KisConfig::useOpenGL(bool defaultValue) const
995{
996 if (defaultValue) {
997 return true;
998 }
999
1000 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
1001 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
1002
1003 return kritarc.value("OpenGLRenderer", "auto").toString() != "none";
1004}
1005
1007{
1008 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
1009 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
1010
1011 kritarc.setValue("OpenGLRenderer", "none");
1012}
1013
1014int KisConfig::openGLFilteringMode(bool defaultValue) const
1015{
1016 return (defaultValue ? 3 : m_cfg.readEntry("OpenGLFilterMode", 3));
1017}
1018
1020{
1021 m_cfg.writeEntry("OpenGLFilterMode", filteringMode);
1022}
1023
1025{
1026 m_cfg.writeEntry("widgetStyle", name);
1027}
1028
1029QString KisConfig::widgetStyle(bool defaultValue)
1030{
1031 return (defaultValue ? "" : m_cfg.readEntry("widgetStyle", ""));
1032}
1033
1034bool KisConfig::useOpenGLTextureBuffer(bool defaultValue) const
1035{
1036 return (defaultValue ? true : m_cfg.readEntry("useOpenGLTextureBuffer", true));
1037}
1038
1040{
1041 m_cfg.writeEntry("useOpenGLTextureBuffer", useBuffer);
1042}
1043
1044int KisConfig::openGLTextureSize(bool defaultValue) const
1045{
1046 return (defaultValue ? 256 : m_cfg.readEntry("textureSize", 256));
1047}
1048
1049bool KisConfig::forceOpenGLFenceWorkaround(bool defaultValue) const
1050{
1051 return (defaultValue ? false : m_cfg.readEntry("forceOpenGLFenceWorkaround", false));
1052}
1053
1054int KisConfig::numMipmapLevels(bool defaultValue) const
1055{
1056 return (defaultValue ? 4 : m_cfg.readEntry("numMipmapLevels", 4));
1057}
1058
1060{
1061 return 1 << qMax(0, numMipmapLevels());
1062}
1063
1064quint32 KisConfig::getGridMainStyle(bool defaultValue) const
1065{
1066 int v = m_cfg.readEntry("gridmainstyle", 0);
1067 v = qBound(0, v, 2);
1068 return (defaultValue ? 0 : v);
1069}
1070
1072{
1073 m_cfg.writeEntry("gridmainstyle", v);
1074}
1075
1076quint32 KisConfig::getGridSubdivisionStyle(bool defaultValue) const
1077{
1078 quint32 v = m_cfg.readEntry("gridsubdivisionstyle", 1);
1079 if (v > 2) v = 2;
1080 return (defaultValue ? 1 : v);
1081}
1082
1084{
1085 m_cfg.writeEntry("gridsubdivisionstyle", v);
1086}
1087
1088quint32 KisConfig::getGridIsoVerticalStyle(bool defaultValue) const
1089{
1090 int v = m_cfg.readEntry("gridisoverticalstyle", 0);
1091 v = qBound(0, v, 3);
1092 return (defaultValue ? 0 : v);
1093}
1094
1096{
1097 m_cfg.writeEntry("gridisoverticalstyle", v);
1098}
1099
1100QColor KisConfig::getGridMainColor(bool defaultValue) const
1101{
1102 QColor col(99, 99, 99);
1103 return (defaultValue ? col : m_cfg.readEntry("gridmaincolor", col));
1104}
1105
1106void KisConfig::setGridMainColor(const QColor & v) const
1107{
1108 m_cfg.writeEntry("gridmaincolor", v);
1109}
1110
1111QColor KisConfig::getGridSubdivisionColor(bool defaultValue) const
1112{
1113 QColor col(150, 150, 150);
1114 return (defaultValue ? col : m_cfg.readEntry("gridsubdivisioncolor", col));
1115}
1116
1117void KisConfig::setGridSubdivisionColor(const QColor & v) const
1118{
1119 m_cfg.writeEntry("gridsubdivisioncolor", v);
1120}
1121
1122QColor KisConfig::getGridIsoVerticalColor(bool defaultValue) const
1123{
1124 QColor col(150, 150, 150);
1125 return (defaultValue ? col : m_cfg.readEntry("gridisoverticalcolor", col));
1126}
1127
1128void KisConfig::setGridIsoVerticalColor(const QColor & v) const
1129{
1130 m_cfg.writeEntry("gridisoverticalcolor", v);
1131}
1132
1133QColor KisConfig::getPixelGridColor(bool defaultValue) const
1134{
1135 QColor col(255, 255, 255);
1136 return (defaultValue ? col : m_cfg.readEntry("pixelGridColor", col));
1137}
1138
1139void KisConfig::setPixelGridColor(const QColor & v) const
1140{
1141 m_cfg.writeEntry("pixelGridColor", v);
1142}
1143
1144qreal KisConfig::getPixelGridDrawingThreshold(bool defaultValue) const
1145{
1146 qreal border = 24.0f;
1147 return (defaultValue ? border : m_cfg.readEntry("pixelGridDrawingThreshold", border));
1148}
1149
1151{
1152 m_cfg.writeEntry("pixelGridDrawingThreshold", v);
1153}
1154
1155bool KisConfig::pixelGridEnabled(bool defaultValue) const
1156{
1157 bool enabled = true;
1158 return (defaultValue ? enabled : m_cfg.readEntry("pixelGridEnabled", enabled));
1159}
1160
1162{
1163 m_cfg.writeEntry("pixelGridEnabled", v);
1164}
1165
1166quint32 KisConfig::guidesLineStyle(bool defaultValue) const
1167{
1168 int v = m_cfg.readEntry("guidesLineStyle", 0);
1169 v = qBound(0, v, 2);
1170 return (defaultValue ? 0 : v);
1171}
1172
1174{
1175 m_cfg.writeEntry("guidesLineStyle", v);
1176}
1177
1178QColor KisConfig::guidesColor(bool defaultValue) const
1179{
1180 QColor col(99, 99, 99);
1181 return (defaultValue ? col : m_cfg.readEntry("guidesColor", col));
1182}
1183
1184void KisConfig::setGuidesColor(const QColor & v) const
1185{
1186 m_cfg.writeEntry("guidesColor", v);
1187}
1188
1189void KisConfig::loadSnapConfig(KisSnapConfig *config, bool defaultValue) const
1190{
1191 KisSnapConfig defaultConfig(false);
1192
1193 if (defaultValue) {
1194 *config = defaultConfig;
1195 return;
1196 }
1197
1198 config->setOrthogonal(m_cfg.readEntry("globalSnapOrthogonal", defaultConfig.orthogonal()));
1199 config->setNode(m_cfg.readEntry("globalSnapNode", defaultConfig.node()));
1200 config->setExtension(m_cfg.readEntry("globalSnapExtension", defaultConfig.extension()));
1201 config->setIntersection(m_cfg.readEntry("globalSnapIntersection", defaultConfig.intersection()));
1202 config->setBoundingBox(m_cfg.readEntry("globalSnapBoundingBox", defaultConfig.boundingBox()));
1203 config->setImageBounds(m_cfg.readEntry("globalSnapImageBounds", defaultConfig.imageBounds()));
1204 config->setImageCenter(m_cfg.readEntry("globalSnapImageCenter", defaultConfig.imageCenter()));
1205 config->setToPixel(m_cfg.readEntry("globalSnapToPixel", defaultConfig.toPixel()));
1206}
1207
1209{
1210 m_cfg.writeEntry("globalSnapOrthogonal", config.orthogonal());
1211 m_cfg.writeEntry("globalSnapNode", config.node());
1212 m_cfg.writeEntry("globalSnapExtension", config.extension());
1213 m_cfg.writeEntry("globalSnapIntersection", config.intersection());
1214 m_cfg.writeEntry("globalSnapBoundingBox", config.boundingBox());
1215 m_cfg.writeEntry("globalSnapImageBounds", config.imageBounds());
1216 m_cfg.writeEntry("globalSnapImageCenter", config.imageCenter());
1217 m_cfg.writeEntry("globalSnapToPixel", config.toPixel());
1218}
1219
1220qint32 KisConfig::checkSize(bool defaultValue) const
1221{
1222 qint32 size = (defaultValue ? 32 : m_cfg.readEntry("checksize", 32));
1223 if (size == 0) size = 32;
1224 return size;
1225}
1226
1227void KisConfig::setCheckSize(qint32 checksize) const
1228{
1229 if (checksize == 0) {
1230 checksize = 32;
1231 }
1232 m_cfg.writeEntry("checksize", checksize);
1233}
1234
1235bool KisConfig::scrollCheckers(bool defaultValue) const
1236{
1237 return (defaultValue ? false : m_cfg.readEntry("scrollingcheckers", false));
1238}
1239
1241{
1242 m_cfg.writeEntry("scrollingcheckers", sc);
1243}
1244
1245QColor KisConfig::canvasBorderColor(bool defaultValue) const
1246{
1247 QColor color(QColor(128,128,128));
1248 return (defaultValue ? color : m_cfg.readEntry("canvasBorderColor", color));
1249}
1250
1251void KisConfig::setCanvasBorderColor(const QColor& color) const
1252{
1253 m_cfg.writeEntry("canvasBorderColor", color);
1254}
1255
1256bool KisConfig::hideScrollbars(bool defaultValue) const
1257{
1258 return (defaultValue ? false : m_cfg.readEntry("hideScrollbars", false));
1259}
1260
1262{
1263 m_cfg.writeEntry("hideScrollbars", value);
1264}
1265
1266bool KisConfig::scrollbarZoomEnabled(bool defaultValue) const
1267{
1268 return (defaultValue ? true : m_cfg.readEntry("scrollbarZoomEnabled", true));
1269}
1270
1272{
1273 m_cfg.writeEntry("scrollbarZoomEnabled", enabled);
1274}
1275
1276QColor KisConfig::checkersColor1(bool defaultValue) const
1277{
1278 QColor col(220, 220, 220);
1279 return (defaultValue ? col : m_cfg.readEntry("checkerscolor", col));
1280}
1281
1282void KisConfig::setCheckersColor1(const QColor & v) const
1283{
1284 m_cfg.writeEntry("checkerscolor", v);
1285}
1286
1287QColor KisConfig::checkersColor2(bool defaultValue) const
1288{
1289 return (defaultValue ? QColor(Qt::white) : m_cfg.readEntry("checkerscolor2", QColor(Qt::white)));
1290}
1291
1292void KisConfig::setCheckersColor2(const QColor & v) const
1293{
1294 m_cfg.writeEntry("checkerscolor2", v);
1295}
1296
1297bool KisConfig::antialiasCurves(bool defaultValue) const
1298{
1299 return (defaultValue ? true : m_cfg.readEntry("antialiascurves", true));
1300}
1301
1303{
1304 m_cfg.writeEntry("antialiascurves", v);
1305}
1306
1307bool KisConfig::antialiasSelectionOutline(bool defaultValue) const
1308{
1309 return (defaultValue ? false : m_cfg.readEntry("AntialiasSelectionOutline", false));
1310}
1311
1313{
1314 m_cfg.writeEntry("AntialiasSelectionOutline", v);
1315}
1316
1317bool KisConfig::showRootLayer(bool defaultValue) const
1318{
1319 return (defaultValue ? false : m_cfg.readEntry("ShowRootLayer", false));
1320}
1321
1322void KisConfig::setShowRootLayer(bool showRootLayer) const
1323{
1324 m_cfg.writeEntry("ShowRootLayer", showRootLayer);
1325}
1326
1327bool KisConfig::showGlobalSelection(bool defaultValue) const
1328{
1329 return (defaultValue ? false : m_cfg.readEntry("ShowGlobalSelection", false));
1330}
1331
1332void KisConfig::setShowGlobalSelection(bool showGlobalSelection) const
1333{
1334 m_cfg.writeEntry("ShowGlobalSelection", showGlobalSelection);
1335}
1336
1337// brush outline settings
1338
1339bool KisConfig::showOutlineWhilePainting(bool defaultValue) const
1340{
1341 return (defaultValue ? true : m_cfg.readEntry("ShowOutlineWhilePainting", true));
1342}
1343
1344void KisConfig::setShowOutlineWhilePainting(bool showOutlineWhilePainting) const
1345{
1346 m_cfg.writeEntry("ShowOutlineWhilePainting", showOutlineWhilePainting);
1347}
1348
1349bool KisConfig::forceAlwaysFullSizedOutline(bool defaultValue) const
1350{
1351 return (defaultValue ? false : m_cfg.readEntry("forceAlwaysFullSizedOutline", false));
1352}
1353
1355{
1356 m_cfg.writeEntry("forceAlwaysFullSizedOutline", value);
1357}
1358
1359// eraser outline settings
1360
1362{
1363 return (defaultValue ? true : m_cfg.readEntry("ShowEraserOutlineWhilePainting", true));
1364}
1365
1366void KisConfig::setShowEraserOutlineWhilePainting(bool showEraserOutlineWhilePainting) const
1367{
1368 m_cfg.writeEntry("ShowEraserOutlineWhilePainting", showEraserOutlineWhilePainting);
1369}
1370
1372{
1373 return (defaultValue ? false : m_cfg.readEntry("forceAlwaysFullSizedEraserOutline", false));
1374}
1375
1377{
1378 m_cfg.writeEntry("forceAlwaysFullSizedEraserOutline", value);
1379}
1380
1382{
1383 int value = defaultValue ? SOS_BlankSession : m_cfg.readEntry("sessionOnStartup", (int)SOS_BlankSession);
1385}
1387{
1388 m_cfg.writeEntry("sessionOnStartup", (int)value);
1389}
1390
1391bool KisConfig::saveSessionOnQuit(bool defaultValue) const
1392{
1393 return defaultValue ? false : m_cfg.readEntry("saveSessionOnQuit", false);
1394}
1396{
1397 m_cfg.writeEntry("saveSessionOnQuit", value);
1398}
1399
1400bool KisConfig::hideDevFundBanner(bool defaultValue) const
1401{
1402 return defaultValue ? false : m_cfg.readEntry("hideDevFundBanner", false);
1403}
1404
1406{
1407 m_cfg.writeEntry("hideDevFundBanner", value);
1408}
1409
1410qreal KisConfig::outlineSizeMinimum(bool defaultValue) const
1411{
1412 return (defaultValue ? 1.0 : m_cfg.readEntry("OutlineSizeMinimum", 1.0));
1413}
1414
1415void KisConfig::setOutlineSizeMinimum(qreal outlineSizeMinimum) const
1416{
1417 m_cfg.writeEntry("OutlineSizeMinimum", outlineSizeMinimum);
1418}
1419
1420qreal KisConfig::selectionViewSizeMinimum(bool defaultValue) const
1421{
1422 return (defaultValue ? 5.0 : m_cfg.readEntry("SelectionViewSizeMinimum", 5.0));
1423}
1424
1425void KisConfig::setSelectionViewSizeMinimum(qreal outlineSizeMinimum) const
1426{
1427 m_cfg.writeEntry("SelectionViewSizeMinimum", outlineSizeMinimum);
1428}
1429
1430int KisConfig::autoSaveInterval(bool defaultValue) const
1431{
1432 int def = 7 * 60;
1433 return (defaultValue ? def : m_cfg.readEntry("AutoSaveInterval", def));
1434}
1435
1436void KisConfig::setAutoSaveInterval(int seconds) const
1437{
1438 return m_cfg.writeEntry("AutoSaveInterval", seconds);
1439}
1440
1441bool KisConfig::backupFile(bool defaultValue) const
1442{
1443 return (defaultValue ? true : m_cfg.readEntry("CreateBackupFile", true));
1444}
1445
1446void KisConfig::setBackupFile(bool backupFile) const
1447{
1448 m_cfg.writeEntry("CreateBackupFile", backupFile);
1449}
1450
1451bool KisConfig::showFilterGallery(bool defaultValue) const
1452{
1453 return (defaultValue ? false : m_cfg.readEntry("showFilterGallery", false));
1454}
1455
1456void KisConfig::setShowFilterGallery(bool showFilterGallery) const
1457{
1458 m_cfg.writeEntry("showFilterGallery", showFilterGallery);
1459}
1460
1462{
1463 return (defaultValue ? true : m_cfg.readEntry("showFilterGalleryLayerMaskDialog", true));
1464}
1465
1466void KisConfig::setShowFilterGalleryLayerMaskDialog(bool showFilterGallery) const
1467{
1468 m_cfg.writeEntry("setShowFilterGalleryLayerMaskDialog", showFilterGallery);
1469}
1470
1471QString KisConfig::canvasState(bool defaultValue) const
1472{
1473 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
1474 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
1475 return (defaultValue ? "OPENGL_NOT_TRIED" : kritarc.value("canvasState", "OPENGL_NOT_TRIED").toString());
1476}
1477
1478void KisConfig::setCanvasState(const QString& state) const
1479{
1480 static QStringList acceptableStates;
1481 if (acceptableStates.isEmpty()) {
1482 acceptableStates << "OPENGL_SUCCESS" << "TRY_OPENGL" << "OPENGL_NOT_TRIED" << "OPENGL_FAILED";
1483 }
1484 if (acceptableStates.contains(state)) {
1485 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
1486 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
1487 kritarc.setValue("canvasState", state);
1488 }
1489}
1490
1491bool KisConfig::toolOptionsPopupDetached(bool defaultValue) const
1492{
1493 return (defaultValue ? false : m_cfg.readEntry("ToolOptionsPopupDetached", false));
1494}
1495
1497{
1498 m_cfg.writeEntry("ToolOptionsPopupDetached", detached);
1499}
1500
1501
1502bool KisConfig::paintopPopupDetached(bool defaultValue) const
1503{
1504 return (defaultValue ? true : m_cfg.readEntry("PaintopPopupDetached", true));
1505}
1506
1507void KisConfig::setPaintopPopupDetached(bool detached) const
1508{
1509 m_cfg.writeEntry("PaintopPopupDetached", detached);
1510}
1511
1512QString KisConfig::pressureTabletCurve(bool defaultValue) const
1513{
1514 return (defaultValue ? "0,0;1,1" : m_cfg.readEntry("tabletPressureCurve","0,0;1,1;"));
1515}
1516
1517void KisConfig::setPressureTabletCurve(const QString& curveString) const
1518{
1519 m_cfg.writeEntry("tabletPressureCurve", curveString);
1520}
1521
1522bool KisConfig::useWin8PointerInput(bool defaultValue) const
1523{
1524#ifdef Q_OS_WIN
1525 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
1526 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
1527
1528 return useWin8PointerInputNoApp(&kritarc, defaultValue);
1529#else
1530 Q_UNUSED(defaultValue);
1531 return false;
1532#endif
1533}
1534
1536{
1537#ifdef Q_OS_WIN
1538
1539 // Special handling: Only set value if changed
1540 // I don't want it to be set if the user hasn't touched it
1541 if (useWin8PointerInput() != value) {
1542 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
1543 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
1545 }
1546
1547#else
1548 Q_UNUSED(value);
1549#endif
1550}
1551
1552bool KisConfig::useWin8PointerInputNoApp(QSettings *settings, bool defaultValue)
1553{
1554 return defaultValue ? false : settings->value("useWin8PointerInput", false).toBool();
1555}
1556
1557void KisConfig::setUseWin8PointerInputNoApp(QSettings *settings, bool value)
1558{
1559 settings->setValue("useWin8PointerInput", value);
1560}
1561
1563{
1564 return (defaultValue ? false : m_cfg.readEntry("useRightMiddleTabletButtonWorkaround", false));
1565}
1566
1568{
1569 m_cfg.writeEntry("useRightMiddleTabletButtonWorkaround", value);
1570}
1571
1572qreal KisConfig::vastScrolling(bool defaultValue) const
1573{
1574 return (defaultValue ? 0.9 : m_cfg.readEntry("vastScrolling", 0.9));
1575}
1576
1577void KisConfig::setVastScrolling(const qreal factor) const
1578{
1579 m_cfg.writeEntry("vastScrolling", factor);
1580}
1581
1582int KisConfig::presetChooserViewMode(bool defaultValue) const
1583{
1584 return (defaultValue ? 0 : m_cfg.readEntry("presetChooserViewMode", 0));
1585}
1586
1587void KisConfig::setPresetChooserViewMode(const int mode) const
1588{
1589 m_cfg.writeEntry("presetChooserViewMode", mode);
1590}
1591
1592int KisConfig::presetIconSize(bool defaultValue) const
1593{
1594 return (defaultValue ? 60 : m_cfg.readEntry("presetIconSize", 60));
1595}
1596
1598{
1599 m_cfg.writeEntry("presetIconSize", value);
1600}
1601
1602bool KisConfig::firstRun(bool defaultValue) const
1603{
1604 return (defaultValue ? true : m_cfg.readEntry("firstRun", true));
1605}
1606
1607void KisConfig::setFirstRun(const bool first) const
1608{
1609 m_cfg.writeEntry("firstRun", first);
1610}
1611
1612int KisConfig::horizontalSplitLines(bool defaultValue) const
1613{
1614 return (defaultValue ? 1 : m_cfg.readEntry("horizontalSplitLines", 1));
1615}
1616void KisConfig::setHorizontalSplitLines(const int numberLines) const
1617{
1618 m_cfg.writeEntry("horizontalSplitLines", numberLines);
1619}
1620
1621int KisConfig::verticalSplitLines(bool defaultValue) const
1622{
1623 return (defaultValue ? 1 : m_cfg.readEntry("verticalSplitLines", 1));
1624}
1625
1626void KisConfig::setVerticalSplitLines(const int numberLines) const
1627{
1628 m_cfg.writeEntry("verticalSplitLines", numberLines);
1629}
1630
1631bool KisConfig::clicklessSpacePan(bool defaultValue) const
1632{
1633 return (defaultValue ? true : m_cfg.readEntry("clicklessSpacePan", true));
1634}
1635
1636void KisConfig::setClicklessSpacePan(const bool toggle) const
1637{
1638 m_cfg.writeEntry("clicklessSpacePan", toggle);
1639}
1640
1641
1642bool KisConfig::hideDockersFullscreen(bool defaultValue) const
1643{
1644 return (defaultValue ? true : m_cfg.readEntry("hideDockersFullScreen", true));
1645}
1646
1648{
1649 m_cfg.writeEntry("hideDockersFullScreen", value);
1650}
1651
1652bool KisConfig::showDockerTitleBars(bool defaultValue) const
1653{
1654 return (defaultValue ? true : m_cfg.readEntry("showDockerTitleBars", true));
1655}
1656
1658{
1659 m_cfg.writeEntry("showDockerTitleBars", value);
1660}
1661
1662bool KisConfig::showDockers(bool defaultValue) const
1663{
1664 return (defaultValue ? true : m_cfg.readEntry("showDockers", true));
1665}
1666
1667void KisConfig::setShowDockers(const bool value) const
1668{
1669 m_cfg.writeEntry("showDockers", value);
1670}
1671
1672bool KisConfig::showStatusBar(bool defaultValue) const
1673{
1674 return (defaultValue ? true : m_cfg.readEntry("showStatusBar", true));
1675}
1676
1678{
1679 m_cfg.writeEntry("showStatusBar", value);
1680}
1681
1682bool KisConfig::hideMenuFullscreen(bool defaultValue) const
1683{
1684 return (defaultValue ? true: m_cfg.readEntry("hideMenuFullScreen", true));
1685}
1686
1688{
1689 m_cfg.writeEntry("hideMenuFullScreen", value);
1690}
1691
1692bool KisConfig::hideScrollbarsFullscreen(bool defaultValue) const
1693{
1694 return (defaultValue ? true : m_cfg.readEntry("hideScrollbarsFullScreen", true));
1695}
1696
1698{
1699 m_cfg.writeEntry("hideScrollbarsFullScreen", value);
1700}
1701
1702bool KisConfig::hideStatusbarFullscreen(bool defaultValue) const
1703{
1704 return (defaultValue ? true: m_cfg.readEntry("hideStatusbarFullScreen", true));
1705}
1706
1708{
1709 m_cfg.writeEntry("hideStatusbarFullScreen", value);
1710}
1711
1712bool KisConfig::hideTitlebarFullscreen(bool defaultValue) const
1713{
1714 return (defaultValue ? true : m_cfg.readEntry("hideTitleBarFullscreen", true));
1715}
1716
1718{
1719 m_cfg.writeEntry("hideTitleBarFullscreen", value);
1720}
1721
1722bool KisConfig::hideToolbarFullscreen(bool defaultValue) const
1723{
1724 return (defaultValue ? true : m_cfg.readEntry("hideToolbarFullscreen", true));
1725}
1726
1728{
1729 m_cfg.writeEntry("hideToolbarFullscreen", value);
1730}
1731
1732bool KisConfig::fullscreenMode(bool defaultValue) const
1733{
1734 return (defaultValue ? true : m_cfg.readEntry("fullscreenMode", false));
1735}
1736
1738{
1739 m_cfg.writeEntry("fullscreenMode", value);
1740}
1741
1743{
1744 return (defaultValue ? QStringList() :
1745 m_cfg.readEntry("favoriteCompositeOps",
1746 QString("normal,erase,multiply,burn,darken,add,dodge,screen,overlay,soft_light_svg,luminize,lighten,saturation,color,divide").split(',')));
1747}
1748
1750{
1751 m_cfg.writeEntry("favoriteCompositeOps", compositeOps);
1752}
1753
1754QString KisConfig::exportConfigurationXML(const QString &filterId, bool defaultValue) const
1755{
1756 return (defaultValue ? QString() : m_cfg.readEntry("ExportConfiguration-" + filterId, QString()));
1757}
1758
1759KisPropertiesConfigurationSP KisConfig::exportConfiguration(const QString &filterId, bool defaultValue) const
1760{
1762 const QString xmlData = exportConfigurationXML(filterId, defaultValue);
1763 cfg->fromXML(xmlData);
1764 return cfg;
1765}
1766
1767void KisConfig::setExportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const
1768{
1769 QString exportConfig = properties->toXML();
1770 m_cfg.writeEntry("ExportConfiguration-" + filterId, exportConfig);
1771}
1772
1773QString KisConfig::importConfiguration(const QString &filterId, bool defaultValue) const
1774{
1775 return (defaultValue ? QString() : m_cfg.readEntry("ImportConfiguration-" + filterId, QString()));
1776}
1777
1778void KisConfig::setImportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const
1779{
1780 QString importConfig = properties->toXML();
1781 m_cfg.writeEntry("ImportConfiguration-" + filterId, importConfig);
1782}
1783
1784bool KisConfig::useOcio(bool defaultValue) const
1785{
1786#ifdef HAVE_OCIO
1787 return (defaultValue ? false : m_cfg.readEntry("Krita/Ocio/UseOcio", false));
1788#else
1789 Q_UNUSED(defaultValue);
1790 return false;
1791#endif
1792}
1793
1794void KisConfig::setUseOcio(bool useOCIO) const
1795{
1796 m_cfg.writeEntry("Krita/Ocio/UseOcio", useOCIO);
1797}
1798
1799int KisConfig::favoritePresets(bool defaultValue) const
1800{
1801 return (defaultValue ? 10: m_cfg.readEntry("numFavoritePresets", 10));
1802}
1803
1805{
1806 m_cfg.writeEntry("numFavoritePresets", value);
1807}
1808
1809bool KisConfig::levelOfDetailEnabled(bool defaultValue) const
1810{
1811 return (defaultValue ? false : m_cfg.readEntry("levelOfDetailEnabled", false));
1812}
1813
1815{
1816 m_cfg.writeEntry("levelOfDetailEnabled", value);
1817}
1818
1820{
1822
1823 if (!defaultValue) {
1824 cfg.mode = (KisOcioConfiguration::Mode)m_cfg.readEntry("Krita/Ocio/OcioColorManagementMode", 0);
1825 cfg.configurationPath = m_cfg.readEntry("Krita/Ocio/OcioConfigPath", QString());
1826 cfg.lutPath = m_cfg.readEntry("Krita/Ocio/OcioLutPath", QString());
1827 cfg.inputColorSpace = m_cfg.readEntry("Krita/Ocio/InputColorSpace", QString());
1828 cfg.displayDevice = m_cfg.readEntry("Krita/Ocio/DisplayDevice", QString());
1829 cfg.displayView = m_cfg.readEntry("Krita/Ocio/DisplayView", QString());
1830 cfg.look = m_cfg.readEntry("Krita/Ocio/DisplayLook", QString());
1831 }
1832
1833 return cfg;
1834}
1835
1837{
1838 m_cfg.writeEntry("Krita/Ocio/OcioColorManagementMode", (int) cfg.mode);
1839 m_cfg.writeEntry("Krita/Ocio/OcioConfigPath", cfg.configurationPath);
1840 m_cfg.writeEntry("Krita/Ocio/OcioLutPath", cfg.lutPath);
1841 m_cfg.writeEntry("Krita/Ocio/InputColorSpace", cfg.inputColorSpace);
1842 m_cfg.writeEntry("Krita/Ocio/DisplayDevice", cfg.displayDevice);
1843 m_cfg.writeEntry("Krita/Ocio/DisplayView", cfg.displayView);
1844 m_cfg.writeEntry("Krita/Ocio/DisplayLook", cfg.look);
1845}
1846
1849{
1850 // FIXME: this option duplicates ocioConfiguration(), please deprecate it
1851 return (OcioColorManagementMode)(defaultValue ? INTERNAL
1852 : m_cfg.readEntry("Krita/Ocio/OcioColorManagementMode", (int) INTERNAL));
1853}
1854
1856{
1857 // FIXME: this option duplicates ocioConfiguration(), please deprecate it
1858 m_cfg.writeEntry("Krita/Ocio/OcioColorManagementMode", (int) mode);
1859}
1860
1861int KisConfig::ocioLutEdgeSize(bool defaultValue) const
1862{
1863 return (defaultValue ? 64 : m_cfg.readEntry("Krita/Ocio/LutEdgeSize", 64));
1864}
1865
1867{
1868 m_cfg.writeEntry("Krita/Ocio/LutEdgeSize", value);
1869}
1870
1872{
1873 return (defaultValue ? false : m_cfg.readEntry("Krita/Ocio/OcioLockColorVisualRepresentation", false));
1874}
1875
1877{
1878 m_cfg.writeEntry("Krita/Ocio/OcioLockColorVisualRepresentation", value);
1879}
1880
1881QString KisConfig::defaultPalette(bool defaultValue) const
1882{
1883 return (defaultValue ? QString() : m_cfg.readEntry("defaultPalette", "Default"));
1884}
1885
1886void KisConfig::setDefaultPalette(const QString& name) const
1887{
1888 m_cfg.writeEntry("defaultPalette", name);
1889}
1890
1891QString KisConfig::toolbarSlider(int sliderNumber, bool defaultValue) const
1892{
1893 QString def = "flow";
1894 if (sliderNumber == 1) {
1895 def = "opacity";
1896 }
1897 if (sliderNumber == 2) {
1898 def = "size";
1899 }
1900 return (defaultValue ? def : m_cfg.readEntry(QString("toolbarslider_%1").arg(sliderNumber), def));
1901}
1902
1903void KisConfig::setToolbarSlider(int sliderNumber, const QString &slider)
1904{
1905 m_cfg.writeEntry(QString("toolbarslider_%1").arg(sliderNumber), slider);
1906}
1907
1908int KisConfig::layerThumbnailSize(bool defaultValue) const
1909{
1910 return (defaultValue ? 20 : m_cfg.readEntry("layerThumbnailSize", 20));
1911}
1912
1914{
1915 m_cfg.writeEntry("layerThumbnailSize", size);
1916}
1917
1918int KisConfig::layerTreeIndentation(bool defaultValue) const
1919{
1920 return (defaultValue ? 50 : m_cfg.readEntry("layerTreeIndentation", 50));
1921}
1922
1924{
1925 m_cfg.writeEntry("layerTreeIndentation", percentage);
1926}
1927
1928bool KisConfig::sliderLabels(bool defaultValue) const
1929{
1930 return (defaultValue ? true : m_cfg.readEntry("sliderLabels", true));
1931}
1932
1934{
1935 m_cfg.writeEntry("sliderLabels", enabled);
1936}
1937
1938QString KisConfig::currentInputProfile(bool defaultValue) const
1939{
1940 return (defaultValue ? QString() : m_cfg.readEntry("currentInputProfile", QString()));
1941}
1942
1943void KisConfig::setCurrentInputProfile(const QString& name)
1944{
1945 m_cfg.writeEntry("currentInputProfile", name);
1946}
1947
1948bool KisConfig::useSystemMonitorProfile(bool defaultValue) const
1949{
1950 return (defaultValue ? false : m_cfg.readEntry("ColorManagement/UseSystemMonitorProfile", false));
1951}
1952
1953void KisConfig::setUseSystemMonitorProfile(bool _useSystemMonitorProfile) const
1954{
1955 m_cfg.writeEntry("ColorManagement/UseSystemMonitorProfile", _useSystemMonitorProfile);
1956}
1957
1958bool KisConfig::presetStripVisible(bool defaultValue) const
1959{
1960 return (defaultValue ? true : m_cfg.readEntry("presetStripVisible", true));
1961}
1962
1964{
1965 m_cfg.writeEntry("presetStripVisible", visible);
1966}
1967
1968bool KisConfig::scratchpadVisible(bool defaultValue) const
1969{
1970 return (defaultValue ? true : m_cfg.readEntry("scratchpadVisible", true));
1971}
1972
1974{
1975 m_cfg.writeEntry("scratchpadVisible", visible);
1976}
1977
1978bool KisConfig::showSingleChannelAsColor(bool defaultValue) const
1979{
1980 return (defaultValue ? false : m_cfg.readEntry("showSingleChannelAsColor", false));
1981}
1982
1984{
1985 m_cfg.writeEntry("showSingleChannelAsColor", asColor);
1986}
1987
1988bool KisConfig::hidePopups(bool defaultValue) const
1989{
1990 return (defaultValue ? false : m_cfg.readEntry("hidePopups", false));
1991}
1992
1993void KisConfig::setHidePopups(bool hidePopups)
1994{
1995 m_cfg.writeEntry("hidePopups", hidePopups);
1996}
1997
1998int KisConfig::numDefaultLayers(bool defaultValue) const
1999{
2000 return (defaultValue ? 2 : m_cfg.readEntry("NumberOfLayersForNewImage", 2));
2001}
2002
2004{
2005 m_cfg.writeEntry("NumberOfLayersForNewImage", num);
2006}
2007
2008quint8 KisConfig::defaultBackgroundOpacity(bool defaultValue) const
2009{
2010 return (defaultValue ? (int)OPACITY_OPAQUE_U8 : m_cfg.readEntry("BackgroundOpacityForNewImage", (int)OPACITY_OPAQUE_U8));
2011}
2012
2014{
2015 m_cfg.writeEntry("BackgroundOpacityForNewImage", (int)value);
2016}
2017
2018QColor KisConfig::defaultBackgroundColor(bool defaultValue) const
2019{
2020 return (defaultValue ? QColor(Qt::white) : m_cfg.readEntry("BackgroundColorForNewImage", QColor(Qt::white)));
2021}
2022
2024{
2025 m_cfg.writeEntry("BackgroundColorForNewImage", value);
2026}
2027
2029{
2030 return (KisConfig::BackgroundStyle)(defaultValue ? RASTER_LAYER : m_cfg.readEntry("BackgroundStyleForNewImage", (int)RASTER_LAYER));
2031}
2032
2034{
2035 m_cfg.writeEntry("BackgroundStyleForNewImage", (int)value);
2036}
2037
2038int KisConfig::lineSmoothingType(bool defaultValue) const
2039{
2040 return (defaultValue ? 1 : m_cfg.readEntry("LineSmoothingType", 1));
2041}
2042
2044{
2045 m_cfg.writeEntry("LineSmoothingType", value);
2046}
2047
2048qreal KisConfig::lineSmoothingDistanceMin(bool defaultValue) const
2049{
2050 return (defaultValue ? 50.0 : m_cfg.readEntry("LineSmoothingDistanceMin", 50.0));
2051}
2052
2054{
2055 m_cfg.writeEntry("LineSmoothingDistanceMin", value);
2056}
2057
2058qreal KisConfig::lineSmoothingDistanceMax(bool defaultValue) const
2059{
2060 return (defaultValue ? 50.0 : m_cfg.readEntry("LineSmoothingDistanceMax", 50.0));
2061}
2062
2064{
2065 m_cfg.writeEntry("LineSmoothingDistanceMax", value);
2066}
2067
2069{
2070 return (defaultValue ? true : m_cfg.readEntry("LineSmoothingDistanceKeepAspectRatio", true));
2071}
2072
2074{
2075 m_cfg.writeEntry("LineSmoothingDistanceKeepAspectRatio", value);
2076}
2077
2079{
2080 return (defaultValue ? 0.15 : m_cfg.readEntry("LineSmoothingTailAggressiveness", 0.15));
2081}
2082
2084{
2085 m_cfg.writeEntry("LineSmoothingTailAggressiveness", value);
2086}
2087
2088bool KisConfig::lineSmoothingSmoothPressure(bool defaultValue) const
2089{
2090 return (defaultValue ? false : m_cfg.readEntry("LineSmoothingSmoothPressure", false));
2091}
2092
2094{
2095 m_cfg.writeEntry("LineSmoothingSmoothPressure", value);
2096}
2097
2098bool KisConfig::lineSmoothingScalableDistance(bool defaultValue) const
2099{
2100 return (defaultValue ? true : m_cfg.readEntry("LineSmoothingScalableDistance", true));
2101}
2102
2104{
2105 m_cfg.writeEntry("LineSmoothingScalableDistance", value);
2106}
2107
2108qreal KisConfig::lineSmoothingDelayDistance(bool defaultValue) const
2109{
2110 return (defaultValue ? 50.0 : m_cfg.readEntry("LineSmoothingDelayDistance", 50.0));
2111}
2112
2114{
2115 m_cfg.writeEntry("LineSmoothingDelayDistance", value);
2116}
2117
2118bool KisConfig::lineSmoothingUseDelayDistance(bool defaultValue) const
2119{
2120 return (defaultValue ? true : m_cfg.readEntry("LineSmoothingUseDelayDistance", true));
2121}
2122
2124{
2125 m_cfg.writeEntry("LineSmoothingUseDelayDistance", value);
2126}
2127
2129{
2130 return (defaultValue ? true : m_cfg.readEntry("LineSmoothingFinishStabilizedCurve", true));
2131}
2132
2134{
2135 m_cfg.writeEntry("LineSmoothingFinishStabilizedCurve", value);
2136}
2137
2138bool KisConfig::lineSmoothingStabilizeSensors(bool defaultValue) const
2139{
2140 return (defaultValue ? true : m_cfg.readEntry("LineSmoothingStabilizeSensors", true));
2141}
2142
2144{
2145 m_cfg.writeEntry("LineSmoothingStabilizeSensors", value);
2146}
2147
2148int KisConfig::tabletEventsDelay(bool defaultValue) const
2149{
2150 return (defaultValue ? 10 : m_cfg.readEntry("tabletEventsDelay", 10));
2151}
2152
2154{
2155 m_cfg.writeEntry("tabletEventsDelay", value);
2156}
2157
2158bool KisConfig::trackTabletEventLatency(bool defaultValue) const
2159{
2160 return (defaultValue ? false : m_cfg.readEntry("trackTabletEventLatency", false));
2161}
2162
2164{
2165 m_cfg.writeEntry("trackTabletEventLatency", value);
2166}
2167
2168bool KisConfig::ignoreHighFunctionKeys(bool defaultValue) const
2169{
2170 return (defaultValue ? true : m_cfg.readEntry("ignoreHighFunctionKeys", true));
2171}
2172
2174{
2175 m_cfg.writeEntry("ignoreHighFunctionKeys", value);
2176}
2177
2179{
2180 return (defaultValue ? false : m_cfg.readEntry("testingAcceptCompressedTabletEvents", false));
2181}
2182
2184{
2185 m_cfg.writeEntry("testingAcceptCompressedTabletEvents", value);
2186}
2187
2188bool KisConfig::shouldEatDriverShortcuts(bool defaultValue) const
2189{
2190 return (defaultValue ? false : m_cfg.readEntry("shouldEatDriverShortcuts", false));
2191}
2192
2193bool KisConfig::testingCompressBrushEvents(bool defaultValue) const
2194{
2195 return (defaultValue ? false : m_cfg.readEntry("testingCompressBrushEvents", false));
2196}
2197
2199{
2200 m_cfg.writeEntry("testingCompressBrushEvents", value);
2201}
2202
2204{
2205 return (defaultValue ? 0 : m_cfg.readEntry("workaroundX11SmoothPressureSteps", 0));
2206}
2207
2208bool KisConfig::showCanvasMessages(bool defaultValue) const
2209{
2210 return (defaultValue ? true : m_cfg.readEntry("showOnCanvasMessages", true));
2211}
2212
2214{
2215 m_cfg.writeEntry("showOnCanvasMessages", show);
2216}
2217
2218bool KisConfig::compressKra(bool defaultValue) const
2219{
2220 return (defaultValue ? false : m_cfg.readEntry("compressLayersInKra", false));
2221}
2222
2223void KisConfig::setCompressKra(bool compress)
2224{
2225 m_cfg.writeEntry("compressLayersInKra", compress);
2226}
2227
2228bool KisConfig::trimKra(bool defaultValue) const
2229{
2230 return (defaultValue ? false : m_cfg.readEntry("TrimKra", false));
2231}
2232
2234{
2235 m_cfg.writeEntry("TrimKra", trim);
2236}
2237
2238bool KisConfig::trimFramesImport(bool defaultValue) const
2239{
2240 return (defaultValue ? false : m_cfg.readEntry("TrimFramesImport", false));
2241}
2243{
2244 m_cfg.writeEntry("TrimFramesImport", trim);
2245}
2246
2247QString KisConfig::exportMimeType(bool defaultValue) const
2248{
2249 return (defaultValue ? 0 : m_cfg.readEntry("defaultExportMimeType", QString()));
2250}
2251
2252void KisConfig::setExportMimeType(const QString &defaultExportMimeType)
2253{
2254 m_cfg.writeEntry("defaultExportMimeType", defaultExportMimeType);
2255}
2256
2257bool KisConfig::toolOptionsInDocker(bool defaultValue) const
2258{
2259 return (defaultValue ? true : m_cfg.readEntry("ToolOptionsInDocker", true));
2260}
2261
2263{
2264 m_cfg.writeEntry("ToolOptionsInDocker", inDocker);
2265}
2266
2267bool KisConfig::kineticScrollingEnabled(bool defaultValue) const
2268{
2269 return (defaultValue ? true : m_cfg.readEntry("KineticScrollingEnabled", true));
2270}
2271
2273{
2274 m_cfg.writeEntry("KineticScrollingEnabled", value);
2275}
2276
2277int KisConfig::kineticScrollingGesture(bool defaultValue) const
2278{
2279#ifdef Q_OS_ANDROID
2280 int defaultGesture = 1; // LeftMouseButtonGesture
2281#else
2282 int defaultGesture = 2; // MiddleMouseButtonGesture
2283#endif
2284
2285 return (defaultValue ? defaultGesture : m_cfg.readEntry("KineticScrollingGesture", defaultGesture));
2286}
2287
2289{
2290 m_cfg.writeEntry("KineticScrollingGesture", gesture);
2291}
2292
2293int KisConfig::kineticScrollingSensitivity(bool defaultValue) const
2294{
2295 return (defaultValue ? 75 : m_cfg.readEntry("KineticScrollingSensitivity", 75));
2296}
2297
2299{
2300 m_cfg.writeEntry("KineticScrollingSensitivity", sensitivity);
2301}
2302
2304{
2305 return (defaultValue ? false : m_cfg.readEntry("KineticScrollingHideScrollbar", false));
2306}
2307
2309{
2310 m_cfg.writeEntry("KineticScrollingHideScrollbar", scrollbar);
2311}
2312
2313int KisConfig::zoomSteps(bool defaultValue) const
2314{
2315 return (defaultValue ? 2 : m_cfg.readEntry("zoomSteps", 2));
2316}
2317
2319{
2320 m_cfg.writeEntry("zoomSteps", steps);
2321}
2322
2323int KisConfig::zoomMarginSize(bool defaultValue) const
2324{
2325 return (defaultValue ? 0 : m_cfg.readEntry("zoomMarginSize", 0));
2326}
2327
2328void KisConfig::setZoomMarginSize(int zoomMarginSize)
2329{
2330 m_cfg.writeEntry("zoomMarginSize", zoomMarginSize);
2331}
2332
2334{
2335 const KoColorSpace *cs = 0;
2336
2337 KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
2338 if (defaultValue || cfg.readEntry("useCustomColorSpace", true)) {
2340 QString modelID = cfg.readEntry("customColorSpaceModel", "RGBA");
2341 QString depthID = cfg.readEntry("customColorSpaceDepthID", "U8");
2342 QString profile = cfg.readEntry("customColorSpaceProfile", "sRGB built-in - (lcms internal)");
2343 if (profile == "default") {
2344 // qDebug() << "Falling back to default color profile.";
2345 profile = "sRGB built-in - (lcms internal)";
2346 }
2347 cs = csr->colorSpace(modelID, depthID, profile);
2348 }
2349
2350 return cs;
2351}
2352
2354{
2355 KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
2356 cfg.writeEntry("useCustomColorSpace", bool(cs));
2357 if(cs) {
2358 cfg.writeEntry("customColorSpaceModel", cs->colorModelId().id());
2359 cfg.writeEntry("customColorSpaceDepthID", cs->colorDepthId().id());
2360 cfg.writeEntry("customColorSpaceProfile", cs->profile()->name());
2361 }
2362}
2363
2364bool KisConfig::enableOpenGLFramerateLogging(bool defaultValue) const
2365{
2366 return (defaultValue ? false : m_cfg.readEntry("enableOpenGLFramerateLogging", false));
2367}
2368
2370{
2371 m_cfg.writeEntry("enableOpenGLFramerateLogging", value);
2372}
2373
2374bool KisConfig::enableBrushSpeedLogging(bool defaultValue) const
2375{
2376 return (defaultValue ? false : m_cfg.readEntry("enableBrushSpeedLogging", false));
2377}
2378
2380{
2381 m_cfg.writeEntry("enableBrushSpeedLogging", value);
2382}
2383
2385{
2386 // use the old key name for compatibility
2387 m_cfg.writeEntry("amdDisableVectorWorkaround", value);
2388}
2389
2390bool KisConfig::disableVectorOptimizations(bool defaultValue) const
2391{
2392 // use the old key name for compatibility
2393 return (defaultValue ? false : m_cfg.readEntry("amdDisableVectorWorkaround", false));
2394}
2395
2397{
2398 m_cfg.writeEntry("disableAVXOptimizations", value);
2399}
2400
2401bool KisConfig::disableAVXOptimizations(bool defaultValue) const
2402{
2403 return (defaultValue ? false : m_cfg.readEntry("disableAVXOptimizations", false));
2404}
2405
2407{
2408 m_cfg.writeEntry("animationPlaybackBackend", value);
2409}
2410
2411int KisConfig::animationPlaybackBackend(bool defaultValue) const
2412{
2413 return (defaultValue ? 1 : m_cfg.readEntry("animationPlaybackBackend", 1));
2414}
2415
2417{
2418 bool oldValue = animationDropFrames();
2419
2420 if (value == oldValue) return;
2421
2422 m_cfg.writeEntry("animationDropFrames", value);
2424}
2425
2426bool KisConfig::autoPinLayersToTimeline(bool defaultValue) const
2427{
2428 return (defaultValue ? true : m_cfg.readEntry("autoPinLayers", true));
2429}
2430
2432{
2433 m_cfg.writeEntry("autoPinLayers", value);
2434}
2435
2436bool KisConfig::adaptivePlaybackRange(bool defaultValue) const
2437{
2438 return (defaultValue ? true : m_cfg.readEntry("adaptivePlaybackRange", true));
2439}
2440
2442{
2443 m_cfg.writeEntry("adaptivePlaybackRange", value);
2444}
2445
2447{
2448 return (defaultValue ? true : m_cfg.readEntry("autoZoomTimelineToPlaybackRange", true));
2449}
2450
2452{
2453 m_cfg.writeEntry("autoZoomTimelineToPlaybackRange", value);
2454}
2455
2456QString KisConfig::ffmpegLocation(bool defaultValue) const {
2457 return (defaultValue ? "" : m_cfg.readEntry("ffmpegLocation", ""));
2458}
2459
2461 m_cfg.writeEntry("ffmpegLocation", value);
2462}
2463
2464qreal KisConfig::timelineZoom(bool defaultValue) const
2465{
2466 return (defaultValue ? 1.0f : m_cfg.readEntry("timelineZoom", 1.0f));
2467}
2468
2470{
2471 m_cfg.writeEntry("timelineZoom", value);
2472}
2473
2474bool KisConfig::animationDropFrames(bool defaultValue) const
2475{
2476 return (defaultValue ? true : m_cfg.readEntry("animationDropFrames", true));
2477}
2478
2479int KisConfig::scrubbingUpdatesDelay(bool defaultValue) const
2480{
2481 return (defaultValue ? 30 : m_cfg.readEntry("scrubbingUpdatesDelay", 30));
2482}
2483
2485{
2486 m_cfg.writeEntry("scrubbingUpdatesDelay", value);
2487}
2488
2489int KisConfig::scrubbingAudioUpdatesDelay(bool defaultValue) const
2490{
2491 return (defaultValue ? -1 : m_cfg.readEntry("scrubbingAudioUpdatesDelay", -1));
2492}
2493
2495{
2496 m_cfg.writeEntry("scrubbingAudioUpdatesDelay", value);
2497}
2498
2499int KisConfig::audioOffsetTolerance(bool defaultValue) const
2500{
2501 return (defaultValue ? -1 : m_cfg.readEntry("audioOffsetTolerance", -1));
2502}
2503
2505{
2506 m_cfg.writeEntry("audioOffsetTolerance", value);
2507}
2508
2509bool KisConfig::switchSelectionCtrlAlt(bool defaultValue) const
2510{
2511 return defaultValue ? false : m_cfg.readEntry("switchSelectionCtrlAlt", false);
2512}
2513
2515{
2516 m_cfg.writeEntry("switchSelectionCtrlAlt", value);
2517}
2518
2520{
2521 return defaultValue ? false : m_cfg.readEntry("ConvertToImageColorSpaceOnImport", false);
2522}
2523
2525{
2526 m_cfg.writeEntry("ConvertToImageColorSpaceOnImport", value);
2527}
2528
2529int KisConfig::stabilizerSampleSize(bool defaultValue) const
2530{
2531#ifdef Q_OS_WIN
2532 const int defaultSampleSize = 50;
2533#else
2534 const int defaultSampleSize = 15;
2535#endif
2536
2537 return defaultValue ?
2538 defaultSampleSize : m_cfg.readEntry("stabilizerSampleSize", defaultSampleSize);
2539}
2540
2542{
2543 m_cfg.writeEntry("stabilizerSampleSize", value);
2544}
2545
2546bool KisConfig::stabilizerDelayedPaint(bool defaultValue) const
2547{
2548 const bool defaultEnabled = true;
2549
2550 return defaultValue ?
2551 defaultEnabled : m_cfg.readEntry("stabilizerDelayedPaint", defaultEnabled);
2552}
2553
2555{
2556 m_cfg.writeEntry("stabilizerDelayedPaint", value);
2557}
2558
2559bool KisConfig::showBrushHud(bool defaultValue) const
2560{
2561 return defaultValue ? false : m_cfg.readEntry("showBrushHud", false);
2562}
2563
2565{
2566 m_cfg.writeEntry("showBrushHud", value);
2567}
2568
2569bool KisConfig::showPaletteBottomBar(bool defaultValue) const
2570{
2571 return defaultValue ? true : m_cfg.readEntry("showPaletteBottomBar", true);
2572}
2573
2575{
2576 m_cfg.writeEntry("showPaletteBottomBar", value);
2577}
2578
2579QString KisConfig::brushHudSetting(bool defaultValue) const
2580{
2581 QString defaultDoc = "<!DOCTYPE hud_properties>\n<hud_properties>\n <version value=\"1\" type=\"value\"/>\n <paintbrush>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"angle\" type=\"value\"/>\n </properties_list>\n </paintbrush>\n <colorsmudge>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"smudge_mode\" type=\"value\"/>\n <item_3 value=\"smudge_length\" type=\"value\"/>\n <item_4 value=\"smudge_color_rate\" type=\"value\"/>\n </properties_list>\n </colorsmudge>\n <sketchbrush>\n <properties_list type=\"array\">\n <item_0 value=\"opacity\" type=\"value\"/>\n <item_1 value=\"size\" type=\"value\"/>\n </properties_list>\n </sketchbrush>\n <hairybrush>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n </properties_list>\n </hairybrush>\n <experimentbrush>\n <properties_list type=\"array\">\n <item_0 value=\"opacity\" type=\"value\"/>\n <item_1 value=\"shape_windingfill\" type=\"value\"/>\n </properties_list>\n </experimentbrush>\n <spraybrush>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"spray_particlecount\" type=\"value\"/>\n <item_3 value=\"spray_density\" type=\"value\"/>\n </properties_list>\n </spraybrush>\n <hatchingbrush>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"hatching_angle\" type=\"value\"/>\n <item_3 value=\"hatching_thickness\" type=\"value\"/>\n <item_4 value=\"hatching_separation\" type=\"value\"/>\n </properties_list>\n </hatchingbrush>\n <gridbrush>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"grid_divisionlevel\" type=\"value\"/>\n </properties_list>\n </gridbrush>\n <curvebrush>\n <properties_list type=\"array\">\n <item_0 value=\"opacity\" type=\"value\"/>\n <item_1 value=\"curve_historysize\" type=\"value\"/>\n <item_2 value=\"curve_linewidth\" type=\"value\"/>\n <item_3 value=\"curve_lineopacity\" type=\"value\"/>\n <item_4 value=\"curve_connectionline\" type=\"value\"/>\n </properties_list>\n </curvebrush>\n <dynabrush>\n <properties_list type=\"array\">\n <item_0 value=\"dyna_diameter\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"dyna_mass\" type=\"value\"/>\n <item_3 value=\"dyna_drag\" type=\"value\"/>\n </properties_list>\n </dynabrush>\n <particlebrush>\n <properties_list type=\"array\">\n <item_0 value=\"opacity\" type=\"value\"/>\n <item_1 value=\"particle_particles\" type=\"value\"/>\n <item_2 value=\"particle_opecityweight\" type=\"value\"/>\n <item_3 value=\"particle_iterations\" type=\"value\"/>\n </properties_list>\n </particlebrush>\n <duplicate>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"clone_healing\" type=\"value\"/>\n <item_3 value=\"clone_movesource\" type=\"value\"/>\n </properties_list>\n </duplicate>\n <deformbrush>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n <item_2 value=\"deform_amount\" type=\"value\"/>\n <item_3 value=\"deform_mode\" type=\"value\"/>\n </properties_list>\n </deformbrush>\n <tangentnormal>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n </properties_list>\n </tangentnormal>\n <filter>\n <properties_list type=\"array\">\n <item_0 value=\"size\" type=\"value\"/>\n <item_1 value=\"opacity\" type=\"value\"/>\n </properties_list>\n </filter>\n <roundmarker>\n <properties_list type=\"array\">\n <item_0 value=\"opacity\" type=\"value\"/>\n <item_1 value=\"size\" type=\"value\"/>\n </properties_list>\n </roundmarker>\n</hud_properties>\n";
2582 return defaultValue ? defaultDoc : m_cfg.readEntry("brushHudSettings", defaultDoc);
2583}
2584
2585void KisConfig::setBrushHudSetting(const QString &value) const
2586{
2587 m_cfg.writeEntry("brushHudSettings", value);
2588}
2589
2591{
2592 return defaultValue ? true : m_cfg.readEntry("calculateAnimationCacheInBackground", true);
2593}
2594
2596{
2597 m_cfg.writeEntry("calculateAnimationCacheInBackground", value);
2598}
2599
2600QColor KisConfig::defaultAssistantsColor(bool defaultValue) const
2601{
2602 static const QColor defaultColor = QColor(176, 176, 176, 255);
2603 return defaultValue ? defaultColor : m_cfg.readEntry("defaultAssistantsColor", defaultColor);
2604}
2605
2606void KisConfig::setDefaultAssistantsColor(const QColor &color) const
2607{
2608 m_cfg.writeEntry("defaultAssistantsColor", color);
2609}
2610
2611bool KisConfig::autoSmoothBezierCurves(bool defaultValue) const
2612{
2613 return defaultValue ? false : m_cfg.readEntry("autoSmoothBezierCurves", false);
2614}
2615
2617{
2618 m_cfg.writeEntry("autoSmoothBezierCurves", value);
2619}
2620
2622{
2623 return defaultValue ? false : m_cfg.readEntry("activateTransformToolAfterPaste", false);
2624}
2625
2627{
2628 m_cfg.writeEntry("activateTransformToolAfterPaste", value);
2629}
2630
2631bool KisConfig::zoomHorizontal(bool defaultValue) const
2632{
2633 return defaultValue ? false : m_cfg.readEntry("zoomHorizontal", false);
2634}
2635
2637{
2638 m_cfg.writeEntry("zoomHorizontal", value);
2639}
2640
2641bool KisConfig::selectionActionBar(bool defaultValue) const
2642{
2643 return defaultValue ? true : m_cfg.readEntry("selectionActionBar", true);
2644}
2645
2647{
2648 m_cfg.writeEntry("selectionActionBar", value);
2649}
2650
2652{
2653 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
2654 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
2655
2656 return rootSurfaceFormat(&kritarc, defaultValue);
2657}
2658
2660{
2661 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
2662 QSettings kritarc(configPath + QStringLiteral("/kritadisplayrc"), QSettings::IniFormat);
2663
2664 setRootSurfaceFormat(&kritarc, value);
2665}
2666
2667KisConfig::RootSurfaceFormat KisConfig::rootSurfaceFormat(QSettings *displayrc, bool defaultValue)
2668{
2669 QString textValue = "bt709-g22";
2670
2671 if (!defaultValue) {
2672 textValue = displayrc->value("rootSurfaceFormat", textValue).toString();
2673 }
2674
2675 return textValue == "bt709-g10" ? BT709_G10 :
2676 textValue == "bt2020-pq" ? BT2020_PQ :
2677 BT709_G22;
2678}
2679
2681{
2682 const QString textValue =
2683 value == BT709_G10 ? "bt709-g10" :
2684 value == BT2020_PQ ? "bt2020-pq" :
2685 "bt709-g22";
2686
2687 displayrc->setValue("rootSurfaceFormat", textValue);
2688}
2689
2690bool KisConfig::useZip64(bool defaultValue) const
2691{
2692 return defaultValue ? false : m_cfg.readEntry("UseZip64", false);
2693}
2694
2696{
2697 m_cfg.writeEntry("UseZip64", value);
2698}
2699
2701{
2702 return defaultValue ? true : m_cfg.readEntry("convertLayerColorSpaceInProperties", true);
2703}
2704
2706{
2707 m_cfg.writeEntry("convertLayerColorSpaceInProperties", value);
2708}
2709
2710bool KisConfig::renamePastedLayers(bool defaultValue) const
2711{
2712 return defaultValue ? true : m_cfg.readEntry("renamePastedLayers", true);
2713}
2714
2716{
2717 m_cfg.writeEntry("renamePastedLayers", value);
2718}
2719
2721{
2722 return (KisConfig::LayerInfoTextStyle)(defaultValue ? INFOTEXT_NONE : m_cfg.readEntry("layerInfoTextStyle", (int)INFOTEXT_NONE));
2723}
2724
2726{
2727 m_cfg.writeEntry("layerInfoTextStyle", (int)value);
2728}
2729
2730int KisConfig::layerInfoTextOpacity(bool defaultValue) const
2731{
2732 return defaultValue ? 55 : m_cfg.readEntry("layerInfoTextOpacity", 55);
2733}
2734
2736{
2737 m_cfg.writeEntry("layerInfoTextOpacity", value);
2738}
2739
2740bool KisConfig::useInlineLayerInfoText(bool defaultValue) const
2741{
2742 return defaultValue ? false : m_cfg.readEntry("useInlineLayerInfoText", false);
2743}
2744
2746{
2747 m_cfg.writeEntry("useInlineLayerInfoText", value);
2748}
2749
2750bool KisConfig::useLayerSelectionCheckbox(bool defaultValue) const
2751{
2752 return defaultValue ? false : m_cfg.readEntry("useLayerSelectionCheckbox", true);
2753}
2754
2756{
2757 m_cfg.writeEntry("useLayerSelectionCheckbox", value);
2758}
2759
2761{
2762 if (defaultValue) {
2764 }
2765
2766 return static_cast<AssistantsDrawMode>(
2767 m_cfg.readEntry("assistantsDrawMode", static_cast<int>(ASSISTANTS_DRAW_MODE_DIRECT)));
2768}
2769
2771{
2772 m_cfg.writeEntry("assistantsDrawMode", static_cast<int>(value));
2773}
2774
2775bool KisConfig::longPressEnabled(bool defaultValue) const
2776{
2777#ifdef Q_OS_ANDROID
2778 bool defaultEnabled = true;
2779#else
2780 bool defaultEnabled = false;
2781#endif
2782 if (defaultValue) {
2783 return defaultEnabled;
2784 } else {
2785 return m_cfg.readEntry("longPressEnabled", defaultEnabled);
2786 }
2787}
2788
2790{
2791 m_cfg.writeEntry("longPressEnabled", value);
2793}
2794
2795#include <QDomDocument>
2796#include <QDomElement>
2797
2798void KisConfig::writeKoColor(const QString& name, const KoColor& color) const
2799{
2800 QDomDocument doc = QDomDocument(name);
2801 QDomElement el = doc.createElement(name);
2802 doc.appendChild(el);
2803 color.toXML(doc, el);
2804 m_cfg.writeEntry(name, doc.toString());
2805}
2806
2807//ported from kispropertiesconfig.
2808KoColor KisConfig::readKoColor(const QString& name, const KoColor& _color) const
2809{
2810 QDomDocument doc;
2811
2812 KoColor color = _color;
2813
2814 if (!m_cfg.readEntry(name).isNull()) {
2815 doc.setContent(m_cfg.readEntry(name));
2816 QDomElement e = doc.documentElement().firstChild().toElement();
2818 }
2819 else {
2820 QString blackColor = "<!DOCTYPE Color>\n<Color>\n <RGB r=\"0\" space=\"sRGB-elle-V2-srgbtrc.icc\" b=\"0\" g=\"0\"/>\n</Color>\n";
2821 doc.setContent(blackColor);
2822 QDomElement e = doc.documentElement().firstChild().toElement();
2824 }
2825 return color;
2826}
2827
2828void KisConfig::writeKoColors(const QString& name, const QList<KoColor>& colors) const
2829{
2830 QDomDocument doc = QDomDocument(name);
2831 QDomElement colorsElement = doc.createElement("colors");
2832 doc.appendChild(colorsElement);
2833
2834 // Writes like <colors><RGB ../><RGB .. /> ... </colors>
2835 Q_FOREACH(const KoColor & color, colors) {
2836 color.toXML(doc, colorsElement);
2837 }
2838 m_cfg.writeEntry(name, doc.toString());
2839}
2840
2841QList<KoColor> KisConfig::readKoColors(const QString& name) const
2842{
2843 QList<KoColor> colors;
2844 QString colorListXML = m_cfg.readEntry(name);
2845
2846 if (!colorListXML.isNull()) {
2847 QDomDocument doc;
2848 doc.setContent(colorListXML);
2849 QDomElement colorsElement = doc.firstChildElement();
2850 if (!colorsElement.isNull()) {
2851 QDomNodeList colorNodes = colorsElement.childNodes();
2852 colors.reserve(colorNodes.size());
2853
2854 for (int k = 0; k < colorNodes.size(); k++) {
2855 QDomElement colorElement = colorNodes.at(k).toElement();
2856 KoColor color = KoColor::fromXML(colorElement, Integer16BitsColorDepthID.id());
2857 colors.push_back(color);
2858 }
2859 }
2860 }
2861
2862 return colors;
2863}
2864
2865QDebug operator<<(QDebug debug, const KisConfig::CanvasSurfaceMode &mode)
2866{
2867 QDebugStateSaver saver(debug);
2868 debug.nospace() << "CanvasSurfaceMode(";
2869
2870 switch (mode) {
2872 debug.nospace() << "Preferred";
2873 break;
2875 debug.nospace() << "Rec709g22";
2876 break;
2878 debug.nospace() << "Rec709g10";
2879 break;
2881 debug.nospace() << "Unmanaged";
2882 break;
2883 default:
2884 debug.nospace() << "unknown(" << static_cast<int>(mode) << ")";
2885 break;
2886 }
2887
2888 debug.nospace() << ")";
2889
2890 return debug.space();
2891}
2892
2893QDebug operator<<(QDebug debug, const KisConfig::CanvasSurfaceBitDepthMode &mode)
2894{
2895
2896 QDebugStateSaver saver(debug);
2897 debug.nospace() << "CanvasSurfaceBitDepthMode(";
2898
2899 switch (mode) {
2901 debug.nospace() << "DepthAuto";
2902 break;
2904 debug.nospace() << "Depth8Bit";
2905 break;
2907 debug.nospace() << "Depth10Bit";
2908 break;
2909 default:
2910 debug.nospace() << "unknown(" << static_cast<int>(mode) << ")";
2911 break;
2912 }
2913
2914 debug.nospace() << ")";
2915
2916 return debug.space();
2917}
2918
qreal length(const QPointF &vec)
Definition Ellipse.cc:82
float value(const T *src, size_t ch)
qreal v
QList< QString > QStringList
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
const quint8 OPACITY_OPAQUE_U8
QByteArray displayProfile(const QString &device, int profile=0) const
Return the icc profile for the given device and index (if a device has more than one profile)
static KisColorManager * instance()
void notifyLongPressChanged(bool enabled)
static KisConfigNotifier * instance()
QString widgetStyle(bool defaultValue=false)
void setCumulativeUndoData(KisCumulativeUndoData value)
qreal lineSmoothingDistanceMin(bool defaultValue=false) const
bool testingAcceptCompressedTabletEvents(bool defaultValue=false) const
void setForceShowSaveMessages(bool value) const
QString importConfiguration(const QString &filterId, bool defaultValue=false) const
void setPreferredVectorImportResolutionPPI(int value) const
bool backupFile(bool defaultValue=false) const
void setAntialiasCurves(bool v) const
bool useOcio(bool defaultValue=false) const
void setSwitchSelectionCtrlAlt(bool value)
qint32 defImageHeight(bool defaultValue=false) const
bool antialiasSelectionOutline(bool defaultValue=false) const
void setZoomSteps(int steps)
@ ASSISTANTS_DRAW_MODE_DIRECT
Definition kis_config.h:768
int zoomSteps(bool defaultValue=false) const
qreal lineSmoothingTailAggressiveness(bool defaultValue=false) const
OcioColorManagementMode ocioColorManagementMode(bool defaultValue=false) const
void setHideDockersFullscreen(const bool value) const
void setUseEraserBrushOpacity(bool value)
LayerInfoTextStyle layerInfoTextStyle(bool defaultValue=false) const
static CanvasSurfaceBitDepthMode canvasSurfaceBitDepthMode(QSettings *settings, bool defaultValue=false)
void setCurrentInputProfile(const QString &name)
int preferredVectorImportResolutionPPI(bool defaultValue=false) const
void setAdaptivePlaybackRange(bool value)
void setEnableCanvasSurfaceColorSpaceManagement(bool value)
void setLineSmoothingTailAggressiveness(qreal value)
void loadSnapConfig(KisSnapConfig *config, bool defaultValue=false) const
void setPasteFormat(qint32 format)
KConfigGroup m_cfg
Definition kis_config.h:807
QColor checkersColor2(bool defaultValue=false) const
void setGridSubdivisionColor(const QColor &v) const
void setUseRightMiddleTabletButtonWorkaround(bool value)
int lineSmoothingType(bool defaultValue=false) const
void setCheckersColor1(const QColor &v) const
QString toolbarSlider(int sliderNumber, bool defaultValue=false) const
int stabilizerSampleSize(bool defaultValue=false) const
quint32 guidesLineStyle(bool defaultValue=false) const
void setHidePopups(bool hidePopups)
void setFullscreenMode(const bool value) const
void setLineSmoothingUseDelayDistance(bool value)
void setMDIBackgroundColor(const QString &v) const
QString pressureTabletCurve(bool defaultValue=false) const
void setUndoStackLimit(int limit) const
qint32 defImageWidth(bool defaultValue=false) const
bool showGlobalSelection(bool defaultValue=false) const
bool hideScrollbars(bool defaultValue=false) const
int verticalSplitLines(bool defaultValue=false) const
int openGLFilteringMode(bool defaultValue=false) const
void setUseZip64(bool value)
bool showSingleChannelAsColor(bool defaultValue=false) const
void setWidgetStyle(QString name)
void setHideToolbarFullscreen(const bool value) const
void setCanvasState(const QString &state) const
void setLineSmoothingDistanceKeepAspectRatio(bool value)
int kineticScrollingSensitivity(bool defaultValue=false) const
bool convertToImageColorspaceOnImport(bool defaultValue=false) const
QString exportConfigurationXML(const QString &filterId, bool defaultValue=false) const
int zoomMarginSize(bool defaultValue=false) const
void setFFMpegLocation(const QString &value)
void setAutoZoomTimelineToPlaybackRange(bool value)
bool showRootLayer(bool defaultValue=false) const
void setTestingAcceptCompressedTabletEvents(bool value)
qint32 pasteFormat(bool defaultValue) const
void setEnableBrushSpeedLogging(bool value) const
void setShowDockers(const bool value) const
void setExportMimeType(const QString &defaultExportMimeType)
bool forceShowSaveMessages(bool defaultValue=true) const
bool useInlineLayerInfoText(bool defaultValue=false) const
void setUseWin8PointerInput(bool value)
QPoint getDefaultGridSpacing(bool defaultValue=false) const
void setShowBrushHud(bool value)
void enablePixelGrid(bool v) const
void setShowStatusBar(const bool value) const
bool useDirtyPresets(bool defaultValue=false) const
void setOcioLutEdgeSize(int value)
void setDefaultPalette(const QString &name) const
qreal getPixelGridDrawingThreshold(bool defaultValue=false) const
bool switchSelectionCtrlAlt(bool defaultValue=false) const
void setRenamePastedLayers(bool value)
bool shouldEatDriverShortcuts(bool defaultValue=false) const
BackgroundStyle defaultBackgroundStyle(bool defaultValue=false) const
QColor checkersColor1(bool defaultValue=false) const
void setHideScrollbars(bool value) const
void writeKoColors(const QString &name, const QList< KoColor > &colors) const
bool allowLCMSOptimization(bool defaultValue=false) const
KisConfig(bool readOnly)
KisConfig create a kisconfig object.
Definition kis_config.cc:52
int animationPlaybackBackend(bool defaultValue=false) const
void setShowPaletteBottomBar(bool value)
CanvasSurfaceBitDepthMode effectiveCanvasSurfaceBitDepthMode(const QSurfaceFormat &format) const
static void setCanvasSurfaceBitDepthMode(QSettings *settings, CanvasSurfaceBitDepthMode value)
int numMipmapLevels(bool defaultValue=false) const
void setIgnoreHighFunctionKeys(bool value)
const KoColorSpace * customColorSelectorColorSpace(bool defaultValue=false) const
bool showFilterGalleryLayerMaskDialog(bool defaultValue=false) const
bool activateTransformToolAfterPaste(bool defaultValue=false) const
void setNewCursorStyle(CursorStyle style)
bool hideDockersFullscreen(bool defaultValue=false) const
static void setUseWin8PointerInputNoApp(QSettings *settings, bool value)
QRect colorPreviewRect() const
void setUseInlineLayerInfoText(bool value)
void disableOpenGL() const
void setGridSubdivisionStyle(quint32 v) const
void setEraserCursorStyle(CursorStyle style)
bool compressKra(bool defaultValue=false) const
void setTrackTabletEventLatency(bool value)
int textureOverlapBorder() const
bool disableVectorOptimizations(bool defaultValue=false) const
void setCursorMainColor(const QColor &v) const
void setCanvasSurfaceColorSpaceManagementMode(CanvasSurfaceMode value)
void setUndoEnabled(bool undo) const
bool levelOfDetailEnabled(bool defaultValue=false) const
void setCumulativeUndoRedo(bool value)
void setConvertToImageColorspaceOnImport(bool value)
void setPixelGridColor(const QColor &v) const
void setToolOptionsInDocker(bool inDocker)
void setForceAlwaysFullSizedOutline(bool value) const
void setLongPressEnabled(bool value)
SessionOnStartup sessionOnStartup(bool defaultValue=false) const
bool lineSmoothingScalableDistance(bool defaultValue=false) const
bool forceOpenGLFenceWorkaround(bool defaultValue=false) const
void setForcePaletteColors(bool forcePaletteColors)
void setHideTitlebarFullscreen(const bool value) const
void setScrubbingAudioUpdatesDelay(int value)
int layerThumbnailSize(bool defaultValue=false) const
bool enableOpenGLFramerateLogging(bool defaultValue=false) const
QColor getPixelGridColor(bool defaultValue=false) const
void setGridIsoVerticalStyle(quint32 v) const
qreal vastScrolling(bool defaultValue=false) const
void setSelectionViewSizeMinimum(qreal outlineSizeMinimum) const
bool fullscreenMode(bool defaultValue=false) const
bool useDefaultColorSpace(bool defaultvalue=false) const
bool toolOptionsPopupDetached(bool defaultValue=false) const
bool autoSmoothBezierCurves(bool defaultValue=false) const
bool pixelGridEnabled(bool defaultValue=false) const
void setRulersTrackMouse(bool value) const
QColor defaultAssistantsColor(bool defaultValue=false) const
bool hideMenuFullscreen(bool defaultValue=false) const
QString getMDIBackgroundColor(bool defaultValue=false) const
void setMonitorProfile(int screen, const QString &monitorProfile, bool override) const
bool showPaletteBottomBar(bool defaultValue=false) const
bool lineSmoothingFinishStabilizedCurve(bool defaultValue=false) const
void setLineSmoothingFinishStabilizedCurve(bool value)
void setUseDefaultColorSpace(bool value) const
void setDefaultColorDepth(const QString &depth) const
bool hideScrollbarsFullscreen(bool defaultValue=false) const
QString printerProfile(bool defaultValue=false) const
void setStabilizerDelayedPaint(bool value)
TouchPainting touchPainting(bool defaultValue=false) const
void setSeparateEraserCursor(bool value) const
qint32 monitorRenderIntent(bool defaultValue=false) const
bool showFilterGallery(bool defaultValue=false) const
void setActivateTransformToolAfterPaste(bool value)
void setShowFilterGallery(bool showFilterGallery) const
bool m_readOnly
Definition kis_config.h:808
int kineticScrollingGesture(bool defaultValue=false) const
bool useZip64(bool defaultValue=false) const
bool calculateAnimationCacheInBackground(bool defaultValue=false) const
void setLineSmoothingDistanceMin(qreal value)
int favoritePresets(bool defaultValue=false) const
bool zoomHorizontal(bool defaultValue=false) const
QString getMDIBackgroundImage(bool defaultValue=false) const
KisPropertiesConfigurationSP exportConfiguration(const QString &filterId, bool defaultValue=false) const
void setAssistantsDrawMode(AssistantsDrawMode value)
void setShowGlobalSelection(bool showGlobalSelection) const
quint32 getGridMainStyle(bool defaultValue=false) const
void setScrubbingUpdatesDelay(int value)
CanvasSurfaceMode canvasSurfaceColorSpaceManagementMode(bool defaultValue=false) const
bool hideToolbarFullscreen(bool defaultValue=false) const
void setScratchpadVisible(bool visible)
qreal outlineSizeMinimum(bool defaultValue=false) const
bool showCanvasMessages(bool defaultValue=false) const
void setNumDefaultLayers(int num)
QList< KoColor > readKoColors(const QString &name) const
QColor getGridMainColor(bool defaultValue=false) const
void setUseSystemMonitorProfile(bool _useSystemMonitorProfile) const
bool hideDevFundBanner(bool defaultValue=false) const
void setAnimationDropFrames(bool value)
int openGLTextureSize(bool defaultValue=false) const
qreal timelineZoom(bool defaultValue=false) const
void setDefaultGridSpacing(QPoint gridSpacing)
bool useWin8PointerInput(bool defaultValue=false) const
void setPrinterColorSpace(const QString &printerColorSpace) const
bool useOpenGLTextureBuffer(bool defaultValue=false) const
void setToolOptionsPopupDetached(bool detached) const
void setLineSmoothingDelayDistance(qreal value)
OutlineStyle lastUsedOutlineStyle(bool defaultValue=false) const
void setCalculateAnimationCacheInBackground(bool value)
void setGridMainStyle(quint32 v) const
void setAutoSaveInterval(int seconds) const
void setShowSingleChannelAsColor(bool asColor)
void setTrimFramesImport(bool trim)
bool forcePaletteColors(bool defaultValue=false) const
void setClicklessSpacePan(const bool toggle) const
bool convertLayerColorSpaceInProperties(bool defaultValue=false) const
bool showDockerTitleBars(bool defaultValue=false) const
qreal defImageResolution(bool defaultValue=false) const
void setTimelineZoom(qreal value)
void setAllowLCMSOptimization(bool allowLCMSOptimization)
void setPrinterProfile(const QString &printerProfile) const
void setUseLayerSelectionCheckbox(bool value)
void setVerticalSplitLines(const int numberLines) const
KisOcioConfiguration ocioConfiguration(bool defaultValue=false) const
void setSliderLabels(bool enabled)
void setRenderIntent(qint32 monitorRenderIntent) const
void setBrushHudSetting(const QString &value) const
void setFavoritePresets(const int value)
void setEraserOutlineStyle(OutlineStyle style)
void setShowOutlineWhilePainting(bool showOutlineWhilePainting) const
bool lineSmoothingDistanceKeepAspectRatio(bool defaultValue=false) const
RootSurfaceFormat rootSurfaceFormat(bool defaultValue=false) const
QColor canvasBorderColor(bool defaultValue=false) const
void setPresetStripVisible(bool visible)
int tabletEventsDelay(bool defaultValue=false) const
QString exportMimeType(bool defaultValue) const
void setScrollingCheckers(bool scrollCheckers) const
const QString getScreenStringIdentfier(int screenNo) const
bool firstRun(bool defaultValue=false) const
void setBackupFile(bool backupFile) const
void setTabletEventsDelay(int value)
KoColor readKoColor(const QString &name, const KoColor &color=KoColor()) const
void logImportantSettings() const
Log the most interesting settings to the usage log.
Definition kis_config.cc:73
QString ffmpegLocation(bool defaultValue=false) const
void setImportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const
bool useLayerSelectionCheckbox(bool defaultValue=false) const
QColor guidesColor(bool defaultValue=false) const
CursorStyle newCursorStyle(bool defaultValue=false) const
bool useCumulativeUndoRedo(bool defaultValue=false) const
void setCheckSize(qint32 checkSize) const
void setLevelOfDetailEnabled(bool value)
bool paintopPopupDetached(bool defaultValue=false) const
void setToolbarSlider(int sliderNumber, const QString &slider)
CursorStyle eraserCursorStyle(bool defaultValue=false) const
void setKineticScrollingGesture(int kineticScroll)
QString defColorProfile(bool defaultValue=false) const
void setLineSmoothingSmoothPressure(bool value)
void setPixelGridDrawingThreshold(qreal v) const
void setStabilizerSampleSize(int value)
void setMonitorForScreen(int screen, const QString &monitor)
QString currentInputProfile(bool defaultValue=false) const
void setCanvasBorderColor(const QColor &color) const
QString monitorProfile(int screen) const
get the profile the user has selected for the given screen
void setDefaultBackgroundOpacity(quint8 value)
void setGridIsoVerticalColor(const QColor &v) const
void setVastScrolling(const qreal factor) const
@ TOUCH_PAINTING_DISABLED
Definition kis_config.h:50
@ TOUCH_PAINTING_ENABLED
Definition kis_config.h:49
@ TOUCH_PAINTING_AUTO
Definition kis_config.h:48
void setShowCanvasMessages(bool show)
void setDefaultAssistantsColor(const QColor &color) const
qint32 checkSize(bool defaultValue=false) const
void setConvertLayerColorSpaceInProperties(bool value)
void setWorkingColorSpace(const QString &workingColorSpace) const
KisCumulativeUndoData cumulativeUndoData(bool defaultValue=false) const
bool scratchpadVisible(bool defaultValue=false) const
OutlineStyle newOutlineStyle(bool defaultValue=false) const
bool forceAlwaysFullSizedOutline(bool defaultValue=false) const
void setCustomColorSelectorColorSpace(const KoColorSpace *cs)
void setLineSmoothingType(int value)
void setPressureTabletCurve(const QString &curveString) const
bool clicklessSpacePan(bool defaultValue=false) const
QString workingColorSpace(bool defaultValue=false) const
void setEnableOpenGLFramerateLogging(bool value) const
bool trackTabletEventLatency(bool defaultValue=false) const
bool renamePastedLayers(bool defaultValue=false) const
int horizontalSplitLines(bool defaultValue=false) const
void setShowDockerTitleBars(const bool value) const
void setFirstRun(const bool firstRun) const
void setNewOutlineStyle(OutlineStyle style)
void setCheckersColor2(const QColor &v) const
void setShowRootLayer(bool showRootLayer) const
void setAutoSmoothBezierCurves(bool value)
OutlineStyle eraserOutlineStyle(bool defaultValue=false) const
void saveSnapConfig(const KisSnapConfig &config)
void setScrollbarZoomEnabled(bool enabled) const
int presetChooserViewMode(bool defaultValue=false) const
void setUseBlackPointCompensation(bool useBlackPointCompensation) const
bool kineticScrollingEnabled(bool defaultValue=false) const
bool animationDropFrames(bool defaultValue=false) const
void setLineSmoothingStabilizeSensors(bool value)
QColor defaultBackgroundColor(bool defaultValue=false) const
bool disableTouchOnCanvas() const
int ocioLutEdgeSize(bool defaultValue=false) const
void setAudioOffsetTolerance(int value)
void setUseOpenGLTextureBuffer(bool useBuffer)
void setTrimKra(bool trim)
void setOcioConfiguration(const KisOcioConfiguration &cfg)
void setPresetIconSize(const int value) const
OcioColorManagementMode
Definition kis_config.h:471
bool hideTitlebarFullscreen(bool defaultValue=false) const
QString defaultPalette(bool defaultValue=false) const
bool useRightMiddleTabletButtonWorkaround(bool defaultValue=false) const
void setDefaultBackgroundStyle(BackgroundStyle value)
bool longPressEnabled(bool defaultValue=false) const
QStringList favoriteCompositeOps(bool defaultValue=false) const
bool useEraserBrushOpacity(bool defaultValue=false) const
bool sliderLabels(bool defaultValue=false) const
bool hidePopups(bool defaultValue=false) const
void setColorPreviewRect(const QRect &rect)
bool enableCanvasSurfaceColorSpaceManagement(bool defaultValue=false) const
void setGuidesLineStyle(quint32 v) const
QString printerColorSpace(bool defaultValue=false) const
bool showBrushHud(bool defaultValue=false) const
void setRootSurfaceFormat(RootSurfaceFormat value)
bool autoPinLayersToTimeline(bool defaultValue=false) const
bool scrollbarZoomEnabled(bool defaultValue=false) const
bool toolOptionsInDocker(bool defaultValue=false) const
void setPresetChooserViewMode(const int mode) const
void setOpenGLFilteringMode(int filteringMode)
void setKineticScrollingHideScrollbars(bool scrollbar)
void setAntialiasSelectionOutline(bool v) const
bool trimKra(bool defaultValue=false) const
static bool useWin8PointerInputNoApp(QSettings *settings, bool defaultValue=false)
bool forceShowAutosaveMessages(bool defaultValue=true) const
int layerTreeIndentation(bool defaultValue=false) const
void setFavoriteCompositeOps(const QStringList &compositeOps) const
void setOcioColorManagementMode(OcioColorManagementMode mode) const
bool enableBrushSpeedLogging(bool defaultValue=false) const
bool forceAlwaysFullSizedEraserOutline(bool defaultValue=false) const
int autoSaveInterval(bool defaultValue=false) const
int workaroundX11SmoothPressureSteps(bool defaultValue=false) const
QString defColorModel(bool defaultValue=false) const
void setPaintopPopupDetached(bool detached) const
void setDisableVectorOptimizations(bool value)
void setHideStatusbarFullscreen(const bool value) const
void setCompressKra(bool compress)
void setTouchPainting(TouchPainting value) const
int audioOffsetTolerance(bool defaultValue=false) const
bool showOutlineWhilePainting(bool defaultValue=false) const
qreal lineSmoothingDelayDistance(bool defaultValue=false) const
void setUseEraserBrushSize(bool value)
quint32 getGridIsoVerticalStyle(bool defaultValue=false) const
void setShowEraserOutlineWhilePainting(bool showEraserOutlineWhilePainting) const
bool lineSmoothingSmoothPressure(bool defaultValue=false) const
QString canvasState(bool defaultValue=false) const
void setHideMenuFullscreen(const bool value) const
int scrubbingUpdatesDelay(bool defaultValue=false) const
bool useSystemMonitorProfile(bool defaultValue=false) const
bool autoZoomTimelineToPlaybackRange(bool defaultValue=false) const
bool scrollCheckers(bool defaultValue=false) const
void setForceShowAutosaveMessages(bool ShowAutosaveMessages) const
QColor getGridIsoVerticalColor(bool defaultValue=false) const
bool colorHistoryPerDocument(bool defaultValue=false) const
bool stabilizerDelayedPaint(bool defaultValue=false) const
void setOutlineSizeMinimum(qreal outlineSizeMinimum) const
CanvasSurfaceBitDepthMode
Definition kis_config.h:167
bool useEraserBrushSize(bool defaultValue=false) const
void setLayerThumbnailSize(int size)
void setZoomMarginSize(int zoomMarginSize)
@ SOS_BlankSession
Definition kis_config.h:344
void setShowRulers(bool rulers) const
void setLayerInfoTextOpacity(int value)
bool hideStatusbarFullscreen(bool defaultValue=false) const
void setGridMainColor(const QColor &v) const
qreal lineSmoothingDistanceMax(bool defaultValue=false) const
static const KoColorProfile * getScreenProfile(int screen)
get the profile the color management system has stored for the given screen
bool presetStripVisible(bool defaultValue=false) const
bool lineSmoothingUseDelayDistance(bool defaultValue=false) const
void setZoomHorizontal(bool value)
void setLineSmoothingScalableDistance(bool value)
void setHideDevFundBanner(bool value=true)
bool kineticScrollingHiddenScrollbars(bool defaultValue=false) const
bool showDockers(bool defaultValue=false) const
void setExportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const
const KoColorProfile * displayProfile(int screen) const
void setLineSmoothingDistanceMax(qreal value)
bool useOpenGL(bool defaultValue=false) const
void setTestingCompressBrushEvents(bool value)
bool trimFramesImport(bool defaultValue=false) const
int presetIconSize(bool defaultValue=false) const
bool testingCompressBrushEvents(bool defaultValue=false) const
void setForceAlwaysFullSizedEraserOutline(bool value) const
bool selectionActionBar(bool defaultValue=false) const
QString defaultColorDepth(bool defaultValue=false) const
void setDefaultBackgroundColor(const QColor &value)
int undoStackLimit(bool defaultValue=false) const
bool useBlackPointCompensation(bool defaultValue=false) const
bool saveSessionOnQuit(bool defaultValue) const
void setMDIBackgroundImage(const QString &fileName) const
QColor getCursorMainColor(bool defaultValue=false) const
void setUseProjections(bool useProj) const
void setSelectionActionBar(bool value)
qint32 pasteBehaviour(bool defaultValue=false) const
AssistantsDrawMode assistantsDrawMode(bool defaultValue=false) const
bool rulersTrackMouse(bool defaultValue=false) const
void setUseDirtyPresets(bool value)
quint32 getGridSubdivisionStyle(bool defaultValue=false) const
bool separateEraserCursor(bool defaultValue=false) const
int numDefaultLayers(bool defaultValue=false) const
void setGuidesColor(const QColor &v) const
void setEraserCursorMainColor(const QColor &v) const
void setSaveSessionOnQuit(bool value)
bool disableAVXOptimizations(bool defaultValue=false) const
bool showEraserOutlineWhilePainting(bool defaultValue=false) const
bool showStatusBar(bool defaultValue=false) const
bool showRulers(bool defaultValue=false) const
void setPasteBehaviour(qint32 behaviour) const
void setLayerInfoTextStyle(LayerInfoTextStyle value)
quint8 defaultBackgroundOpacity(bool defaultValue=false) const
void setSessionOnStartup(SessionOnStartup value)
void setLayerTreeIndentation(int percentage)
int scrubbingAudioUpdatesDelay(bool defaultValue=false) const
void setHideScrollbarsFullscreen(const bool value) const
int layerInfoTextOpacity(bool defaultValue=false) const
QString monitorForScreen(int screen, const QString &defaultMonitor, bool defaultValue=true) const
QColor getGridSubdivisionColor(bool defaultValue=false) const
void setAnimationPlaybackBackend(int value)
void setAutoPinLayersToTimeline(bool value)
QColor getEraserCursorMainColor(bool defaultValue=false) const
void setUseOcio(bool useOCIO) const
void setLastUsedOutlineStyle(OutlineStyle style)
bool lineSmoothingStabilizeSensors(bool defaultValue=false) const
bool antialiasCurves(bool defaultValue=false) const
void setKineticScrollingSensitivity(int sensitivity)
QString brushHudSetting(bool defaultValue=false) const
bool ignoreHighFunctionKeys(bool defaultValue=false) const
bool useProjections(bool defaultValue=false) const
void setDisableAVXOptimizations(bool value)
qreal selectionViewSizeMinimum(bool defaultValue=false) const
bool adaptivePlaybackRange(bool defaultValue=false) const
void writeKoColor(const QString &name, const KoColor &color) const
void setOcioLockColorVisualRepresentation(bool value)
void setShowFilterGalleryLayerMaskDialog(bool showFilterGallery) const
void setHorizontalSplitLines(const int numberLines) const
bool undoEnabled(bool defaultValue=false) const
void setKineticScrollingEnabled(bool enabled)
bool ocioLockColorVisualRepresentation(bool defaultValue=false) const
static const QString resourceLocationKey
bool orthogonal() const
void setImageCenter(bool value)
void setIntersection(bool value)
bool node() const
bool toPixel() const
bool imageBounds() const
void setOrthogonal(bool value)
bool boundingBox() const
void setExtension(bool value)
void setToPixel(bool value)
void setBoundingBox(bool value)
bool intersection() const
bool extension() const
void setImageBounds(bool value)
bool imageCenter() const
void setNode(bool value)
static void log(const QString &message)
Logs with date/time.
static void writeSysInfo(const QString &message)
Writes to the system information file and Krita log.
virtual KoID colorModelId() const =0
virtual KoID colorDepthId() const =0
virtual const KoColorProfile * profile() const =0
static KoColor fromXML(const QDomElement &elt, const QString &channelDepthId)
Definition KoColor.cpp:350
void toXML(QDomDocument &doc, QDomElement &colorElt) const
Definition KoColor.cpp:304
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
Definition KoColor.cpp:213
QString id() const
Definition KoID.cpp:63
static bool tabletInputReceived()
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
void cleanOldCursorStyleKeys(KConfigGroup &cfg)
QDebug operator<<(QDebug debug, const KisConfig::CanvasSurfaceMode &mode)
QString kisBacktrace()
Definition kis_debug.cpp:51
#define dbgKrita
Definition kis_debug.h:45
@ OLD_CURSOR_STYLE_OUTLINE_TRIANGLE_RIGHTHANDED
Definition kis_global.h:93
@ OLD_CURSOR_STYLE_OUTLINE
Definition kis_global.h:82
@ OLD_CURSOR_STYLE_OUTLINE_CENTER_CROSS
Definition kis_global.h:88
@ OLD_CURSOR_STYLE_CROSSHAIR
Definition kis_global.h:79
@ OLD_CURSOR_STYLE_NO_CURSOR
Definition kis_global.h:84
@ OLD_CURSOR_STYLE_TOOLICON
Definition kis_global.h:78
@ OLD_CURSOR_STYLE_TRIANGLE_LEFTHANDED
Definition kis_global.h:91
@ OLD_CURSOR_STYLE_POINTER
Definition kis_global.h:80
@ OLD_CURSOR_STYLE_OUTLINE_CENTER_DOT
Definition kis_global.h:87
@ OLD_CURSOR_STYLE_OUTLINE_TRIANGLE_LEFTHANDED
Definition kis_global.h:94
@ OLD_CURSOR_STYLE_TRIANGLE_RIGHTHANDED
Definition kis_global.h:90
@ OLD_CURSOR_STYLE_SMALL_ROUND
Definition kis_global.h:85
OutlineStyle
Definition kis_global.h:53
@ N_OUTLINE_STYLE_SIZE
Definition kis_global.h:59
@ OUTLINE_FULL
Definition kis_global.h:56
@ OUTLINE_NONE
Definition kis_global.h:54
#define INTENT_PERCEPTUAL
Definition kis_global.h:103
CursorStyle
Definition kis_global.h:62
@ CURSOR_STYLE_POINTER
Definition kis_global.h:65
@ CURSOR_STYLE_SMALL_ROUND
Definition kis_global.h:66
@ CURSOR_STYLE_CROSSHAIR
Definition kis_global.h:67
@ CURSOR_STYLE_TOOLICON
Definition kis_global.h:64
@ CURSOR_STYLE_TRIANGLE_RIGHTHANDED
Definition kis_global.h:68
@ N_CURSOR_STYLE_SIZE
Definition kis_global.h:74
@ CURSOR_STYLE_TRIANGLE_LEFTHANDED
Definition kis_global.h:69
@ CURSOR_STYLE_NO_CURSOR
Definition kis_global.h:63
@ CURSOR_STYLE_ERASER
Definition kis_global.h:72
static const KisCumulativeUndoData defaultValue
bool read(const KConfigGroup *config)
void write(KConfigGroup *config) const
virtual bool isSuitableForDisplay() const =0
const KoColorProfile * profileByName(const QString &name) const
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()
const KoColorProfile * createColorProfile(const QString &colorModelId, const QString &colorDepthId, const QByteArray &rawData)