chalk

kis_global.h
1/*
2 * Copyright (c) 2000 Matthias Elter <elter@kde.org>
3 * Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KISGLOBAL_H_
20#define KISGLOBAL_H_
21
22#include <config.h>
23#include LCMS_HEADER
24#include <limits.h>
25#include <tqglobal.h>
26#include <tdeglobal.h>
27
28#define KRITA_VERSION VERSION
29
30const TQ_UINT8 TQ_UINT8_MAX = UCHAR_MAX;
31const TQ_UINT16 TQ_UINT16_MAX = 65535;
32
33const TQ_INT32 TQ_INT32_MAX = (2147483647);
34const TQ_INT32 TQ_INT32_MIN = (-2147483647-1);
35
36const TQ_UINT8 OPACITY_TRANSPARENT = 0;
37const TQ_UINT8 OPACITY_OPAQUE = UCHAR_MAX;
38
39const TQ_UINT8 MAX_SELECTED = UCHAR_MAX;
40const TQ_UINT8 MIN_SELECTED = 0;
41const TQ_UINT8 SELECTION_THRESHOLD = 1;
42
43enum enumCursorStyle {
44 CURSOR_STYLE_TOOLICON = 0,
45 CURSOR_STYLE_CROSSHAIR = 1,
46 CURSOR_STYLE_POINTER = 2,
47 CURSOR_STYLE_OUTLINE = 3
48};
49
50enum enumResourceTypes {
51 RESOURCE_PAINTOP,
52 RESOURCE_FILTER,
53 RESOURCE_TOOL,
54 RESOURCE_COLORSPACE
55};
56
57/*
58 * Most wacom pads have 512 levels of pressure; TQt only supports 256, and even
59 * this is downscaled to 127 levels because the line would be too jittery, and
60 * the amount of masks take too much memory otherwise.
61 */
62const TQ_INT32 PRESSURE_LEVELS= 127;
63const double PRESSURE_MIN = 0.0;
64const double PRESSURE_MAX = 1.0;
65const double PRESSURE_DEFAULT = (PRESSURE_MAX - PRESSURE_MIN) / 2;
66const double PRESSURE_THRESHOLD = 5.0 / 255.0;
67
68#define CLAMP(x,l,u) ((x)<(l)?(l):((x)>(u)?(u):(x)))
69
70
71namespace chalk {
72
73 // String constants for palettes and palette widgets
74 const TQString TOOL_OPTION_WIDGET ("tooloptions");
75
76 const TQString CONTROL_PALETTE ("controlpalette");
77 const TQString PAINTBOX ("paintbox");
78 const TQString COLORBOX ("colorbox");
79 const TQString LAYERBOX ("layerbox");
80}
81
82#endif // KISGLOBAL_H_
83