krita/ui

kis_config.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 #ifndef KIS_CONFIG_H_
00019 #define KIS_CONFIG_H_
00020 
00021 #include <QString>
00022 #include <QColor>
00023 
00024 #include <ksharedconfig.h>
00025 #include <kconfiggroup.h>
00026 
00027 #include "kis_global.h"
00028 #include "krita_export.h"
00029 
00030 class KRITAUI_EXPORT KisConfig
00031 {
00032 public:
00033     KisConfig();
00034     ~KisConfig();
00035 
00036     bool useProjections() const;
00037     void setUseProjections(bool useProj);
00038 
00039     bool undoEnabled() const;
00040     void setUndoEnabled(bool undo);
00041 
00042     qint32 defImgWidth() const;
00043     void defImgWidth(qint32 width);
00044 
00045     qint32 defImgHeight() const;
00046     void defImgHeight(qint32 height);
00047 
00048     double defImgResolution() const;
00049     void defImgResolution(double res);
00050 
00051     enumCursorStyle cursorStyle() const;
00052     enumCursorStyle getDefaultCursorStyle() const;
00053     void setCursorStyle(enumCursorStyle style);
00054 
00055     QString monitorProfile() const;
00056     void setMonitorProfile(const QString & monitorProfile);
00057 
00058     QString workingColorSpace() const;
00059     void setWorkingColorSpace(const QString & workingColorSpace);
00060 
00061     QString importProfile() const;
00062     void setImportProfile(const QString & importProfile);
00063 
00064     QString printerColorSpace() const;
00065     void setPrinterColorSpace(const QString & printerColorSpace);
00066 
00067     QString printerProfile() const;
00068     void setPrinterProfile(const QString & printerProfile);
00069 
00070     bool useBlackPointCompensation() const;
00071     void setUseBlackPointCompensation(bool useBlackPointCompensation);
00072 
00073     bool showRulers() const;
00074     void setShowRulers(bool rulers);
00075 
00076     qint32 pasteBehaviour() const;
00077     void setPasteBehaviour(qint32 behaviour);
00078 
00079     qint32 renderIntent() const;
00080     void setRenderIntent(qint32 renderIntent);
00081 
00082     bool useOpenGL() const;
00083     void setUseOpenGL(bool useOpenGL);
00084 
00085     bool useOpenGLShaders() const;
00086     void setUseOpenGLShaders(bool useOpenGLShaders);
00087 
00088     qint32 maxNumberOfThreads();
00089     void setMaxNumberOfThreads(qint32 numberOfThreads);
00090 
00092     qint32 maxTilesInMem() const;
00093     void setMaxTilesInMem(qint32 tiles);
00094 
00097     qint32 swappiness() const;
00098     void setSwappiness(qint32 swappiness);
00099 
00100     quint32 getGridMainStyle();
00101     void setGridMainStyle(quint32 v);
00102     quint32 getGridSubdivisionStyle();
00103     void setGridSubdivisionStyle(quint32 v);
00104     QColor getGridMainColor();
00105     void setGridMainColor(const QColor & v);
00106     QColor getGridSubdivisionColor();
00107     void setGridSubdivisionColor(const QColor & v);
00108     quint32 getGridHSpacing();
00109     void setGridHSpacing(quint32 v);
00110     quint32 getGridVSpacing();
00111     void setGridVSpacing(quint32 v);
00112     quint32 getGridSubdivisions();
00113     void setGridSubdivisions(quint32 v);
00114     quint32 getGridOffsetX();
00115     void setGridOffsetX(quint32 v);
00116     quint32 getGridOffsetY();
00117     void setGridOffsetY(quint32 v);
00118 
00119     qint32 checkSize();
00120     void setCheckSize(qint32 checkSize);
00121 
00122     bool scrollCheckers() const;
00123     void setScrollingCheckers(bool scollCheckers);
00124 
00125     QColor checkersColor();
00126     void setCheckersColor(const QColor & v);
00127 
00128     int numProjectionThreads();
00129     void setNumProjectThreads(int num);
00130 
00131     int projectionChunkSize();
00132     void setProjectionChunkSize(int num);
00133 
00134     bool aggregateDirtyRegionsInPainter();
00135     void setAggregateDirtyRegionsInPainter(bool aggregate);
00136 
00137     bool useBoundingRectInProjection();
00138     void setUseBoundingRectInProjection(bool use);
00139 
00140     bool useRegionOfInterestInProjection();
00141     void setUseRegionOfInterestInProjection(bool use);
00142 
00143     // Use nearest-neighbour interpolation on KisImage
00144     bool useNearestNeighbour();
00145     void setUseNearestNeighbour(bool useNearestNeigbour);
00146 
00147     // Use Mipmapping (KisImagePyramid) in KisPrescaledProjection
00148     bool useMipmapping();
00149     void setUseMipmapping(bool useMipmapping);
00150 
00151     // Use Blitz sampling on a QImage
00152     bool useSampling();
00153     void setSampling(bool sampling);
00154 
00155     bool threadColorSpaceConversion();
00156     void setThreadColorSpaceConversion(bool threadColorSpaceConversion);
00157 
00158     bool cacheKisImageAsQImage();
00159     void setCacheKisImageAsQImage(bool cacheKisImageAsQImage);
00160 
00161     bool drawMaskVisualisationOnUnscaledCanvasCache();
00162     void setDrawMaskVisualisationOnUnscaledCanvasCache(bool drawMaskVisualisationOnUnscaledCanvasCache);
00163 
00164     bool fastZoom() {
00165         return false;
00166     }
00167 
00168     // If there's no XRender use QPixmaps instead of QImage for the QPainterCanvas
00169     bool noXRender();
00170     void setNoXRender(bool noXRender);
00171 
00172     bool showRootLayer();
00173     void setShowRootLayer(bool showRootLayer);
00174 
00175     // in megapixels -- above 5, we will no longer use the
00176     // memory-guzzling qimage canvas cache
00177     quint32 maxCachedImageSize();
00178     void setMaxCachedImageSize(quint32);
00179 
00180     bool showFilterGallery();
00181     void setShowFilterGallery(bool showFilterGallery);
00182 
00183 
00184 private:
00185     KisConfig(const KisConfig&);
00186     KisConfig& operator=(const KisConfig&);
00187 
00188 private:
00189     mutable KConfigGroup m_cfg;
00190 };
00191 
00192 #endif // KIS_CONFIG_H_