Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_cursor.cc
Go to the documentation of this file.
1/*
2 * kis_cursor.cc - part of KImageShop
3 *
4 * SPDX-FileCopyrightText: 1999 Matthias Elter <elter@kde.org>
5 * SPDX-FileCopyrightText: 2004 Adrian Page <adrian@pagenet.plus.com>
6 * SPDX-FileCopyrightText: 2013 David Revoy <info@davidrevoy.com>
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11#include "kis_cursor.h"
12
13
14#include <QtGlobal>
15#include <QCursor>
16
17#include "kis_cursor_cache.h"
18
20
21/*
22 * Predefined Qt cursors
23 */
25{
26 return Qt::ArrowCursor;
27}
28
30{
31 return Qt::UpArrowCursor;
32}
33
35{
36 return load("cursor-cross.xpm");
37}
38
40{
41 return load("cursor-round.xpm");
42}
43
45{
46 return load("cursor-pixel-black.xpm");
47}
48
50{
51 return load("cursor-pixel-white.xpm");
52}
53
55{
56 return Qt::WaitCursor;
57}
58
60{
61 return Qt::IBeamCursor;
62}
63
65{
66 return Qt::SizeVerCursor;
67}
68
70{
71 return Qt::SizeHorCursor;
72}
73
75{
76 return Qt::SizeBDiagCursor;
77}
78
80{
81 return Qt::SizeFDiagCursor;
82}
83
85{
86 return Qt::SizeAllCursor;
87}
88
90{
91 return Qt::BlankCursor;
92}
93
95{
96 return Qt::SplitVCursor;
97}
98
100{
101 return Qt::SplitHCursor;
102}
103
105{
106 return Qt::PointingHandCursor;
107}
108
109
114
116{
117 return load("precise-pick-layer-icon.xpm", 7, 23);
118}
119
121{
122 return load("zoom_smooth.xpm");
123}
124
126{
127 return load("zoom_discrete.xpm");
128}
129
131{
132 return load("rotate_smooth.xpm");
133}
134
136{
137 return load("rotate_discrete.xpm");
138}
139
141{
142 return load("color-sampler_image_foreground.xpm", 8, 23);
143}
144
146{
147 return load("color-sampler_image_background.xpm", 8, 23);
148}
149
151{
152 return load("color-sampler_layer_foreground.xpm", 8, 23);
153}
154
156{
157 return load("color-sampler_layer_background.xpm", 8, 23);
158}
159
161{
162 return load("exposure-cursor-gesture.xpm");
163}
164
166{
167 return load("gamma-cursor-gesture.xpm");
168}
169
171{
172 return load("cursor-triangle_lefthanded.xpm");
173}
174
176{
177 return load("cursor-triangle_righthanded.xpm");
178}
179
181{
182 return load("cursor-eraser.xpm", 2, 2);
183}
184
186{
187 return load("move-tool.xpm");
188}
189
191{
192 return load("move-selection.xpm", 11, 11);
193}
194
196{
197 return Qt::PointingHandCursor;
198}
199
201{
202 return Qt::OpenHandCursor;
203}
204
206{
207 return Qt::ClosedHandCursor;
208}
209
211{
212 return load("rotate_cursor.xpm");
213}
214
216{
217 return load("mesh_cursor_free.png", 5, 5);
218}
219
221{
222 return load("mesh_cursor_locked.png", 5, 5);
223}
224
225QCursor KisCursor::load(const QString & cursorName, int hotspotX, int hotspotY)
226{
227 return KisCursorCache::instance()->load(cursorName, hotspotX, hotspotY);
228}
static KisCursorCache * instance()
QCursor load(const QString &cursorName, int hotspotX, int hotspotY)
static QCursor sizeBDiagCursor()
Definition kis_cursor.cc:74
static QCursor samplerImageBackgroundCursor()
static QCursor rotateCanvasDiscreteCursor()
static QCursor samplerCursor()
static QCursor pixelBlackCursor()
Definition kis_cursor.cc:44
static QCursor sizeAllCursor()
Definition kis_cursor.cc:84
static QCursor changeGammaCursor()
static QCursor ibeamCursor()
Definition kis_cursor.cc:59
static QCursor splitVCursor()
Definition kis_cursor.cc:94
static QCursor sizeHorCursor()
Definition kis_cursor.cc:69
static QCursor blankCursor()
Definition kis_cursor.cc:89
static QCursor crossCursor()
Definition kis_cursor.cc:34
static QCursor triangleRightHandedCursor()
static QCursor load(const QString &cursorName, int hotspotX=-1, int hotspotY=-1)
static QCursor upArrowCursor()
Definition kis_cursor.cc:29
static QCursor openHandCursor()
static QCursor handCursor()
static QCursor moveSelectionCursor()
static QCursor samplerLayerBackgroundCursor()
static QCursor rotateCursor()
static QCursor waitCursor()
Definition kis_cursor.cc:54
static QCursor samplerLayerForegroundCursor()
static QCursor moveCursor()
static QCursor pickLayerCursor()
static QCursor sizeFDiagCursor()
Definition kis_cursor.cc:79
static QCursor closedHandCursor()
static QCursor arrowCursor()
Definition kis_cursor.cc:24
static QCursor triangleLeftHandedCursor()
static QCursor zoomSmoothCursor()
static QCursor meshCursorFree()
static QCursor rotateCanvasSmoothCursor()
static QCursor pointingHandCursor()
static QCursor zoomDiscreteCursor()
static QCursor roundCursor()
Definition kis_cursor.cc:39
static QCursor pixelWhiteCursor()
Definition kis_cursor.cc:49
static QCursor eraserCursor()
static QCursor samplerImageForegroundCursor()
static QCursor changeExposureCursor()
static QCursor meshCursorLocked()
static QCursor sizeVerCursor()
Definition kis_cursor.cc:64
static QCursor splitHCursor()
Definition kis_cursor.cc:99