krita

kis_global.h

00001 /*
00002  *  Copyright (c) 2000 Matthias Elter <elter@kde.org>
00003  *  Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 #ifndef KISGLOBAL_H_
00020 #define KISGLOBAL_H_
00021 
00022 #include <config.h>
00023 #include LCMS_HEADER
00024 #include <limits.h>
00025 #include <qglobal.h>
00026 #include <kglobal.h>
00027 
00028 #define KRITA_VERSION VERSION
00029 
00030 const Q_UINT8 Q_UINT8_MAX = UCHAR_MAX;
00031 const Q_UINT16 Q_UINT16_MAX = 65535;
00032 
00033 const Q_INT32 Q_INT32_MAX = (2147483647);
00034 const Q_INT32 Q_INT32_MIN = (-2147483647-1);
00035 
00036 const Q_UINT8 OPACITY_TRANSPARENT = 0;
00037 const Q_UINT8 OPACITY_OPAQUE = UCHAR_MAX;
00038 
00039 const Q_UINT8 MAX_SELECTED = UCHAR_MAX;
00040 const Q_UINT8 MIN_SELECTED = 0;
00041 const Q_UINT8 SELECTION_THRESHOLD = 1;
00042 
00043 enum enumCursorStyle {
00044     CURSOR_STYLE_TOOLICON = 0,
00045     CURSOR_STYLE_CROSSHAIR = 1,
00046     CURSOR_STYLE_POINTER = 2,
00047     CURSOR_STYLE_OUTLINE = 3
00048 };
00049 
00050 enum enumResourceTypes {
00051     RESOURCE_PAINTOP,
00052     RESOURCE_FILTER,
00053     RESOURCE_TOOL,
00054     RESOURCE_COLORSPACE
00055 };
00056 
00057 /*
00058  * Most wacom pads have 512 levels of pressure; Qt only supports 256, and even
00059  * this is downscaled to 127 levels because the line would be too jittery, and
00060  * the amount of masks take too much memory otherwise.
00061  */
00062 const Q_INT32 PRESSURE_LEVELS= 127;
00063 const double PRESSURE_MIN = 0.0;
00064 const double PRESSURE_MAX = 1.0;
00065 const double PRESSURE_DEFAULT = (PRESSURE_MAX - PRESSURE_MIN) / 2;
00066 const double PRESSURE_THRESHOLD = 5.0 / 255.0;
00067 
00068 #define CLAMP(x,l,u) ((x)<(l)?(l):((x)>(u)?(u):(x)))
00069 
00070 
00071 namespace krita {
00072 
00073     // String constants for palettes and palette widgets
00074     const QString TOOL_OPTION_WIDGET ("tooloptions");
00075 
00076     const QString CONTROL_PALETTE ("controlpalette");
00077     const QString PAINTBOX ("paintbox");
00078     const QString COLORBOX ("colorbox");
00079     const QString LAYERBOX ("layerbox");
00080 }
00081 
00082 #endif // KISGLOBAL_H_
00083 
KDE Home | KDE Accessibility Home | Description of Access Keys