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 loadWithSize("cursor-cross.svg", 31, 31);
37}
38
40{
41 return loadWithSize("cursor-round.svg", 31, 31);
42}
43
45{
46 return loadWithSize("cursor-pixel-black.xpm", 31, 31);
47}
48
50{
51 return loadWithSize("cursor-pixel-white.xpm", 31, 31);
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 loadWithSize("precise-pick-layer-icon.svg", 33, 31, 7, 23);
118}
119
121{
122 return loadWithSize("zoom_smooth.svg", 33, 31);
123}
124
126{
127 return loadWithSize("zoom_discrete.svg", 33, 31);
128}
129
131{
132 return loadWithSize("rotate_smooth.svg", 33, 31);
133}
134
136{
137 return loadWithSize("rotate_discrete.svg", 33, 31);
138}
139
141{
142 return loadWithSize("color-sampler_image_foreground.svg", 33, 31, 8, 23);
143}
144
146{
147 return loadWithSize("color-sampler_image_background.svg", 33, 31, 8, 23);
148}
149
151{
152 return loadWithSize("color-sampler_layer_foreground.svg", 33, 31, 8, 23);
153}
154
156{
157 return loadWithSize("color-sampler_layer_background.svg", 33, 31, 8, 23);
158}
159
161{
162 return loadWithSize("exposure-cursor-gesture.svg", 22, 22);
163}
164
166{
167 return loadWithSize("gamma-cursor-gesture.svg", 32, 32);
168}
169
171{
172 return loadWithSize("cursor-triangle_lefthanded.svg", 31, 31);
173}
174
176{
177 return loadWithSize("cursor-triangle_righthanded.svg", 31, 31);
178}
179
181{
182 return loadWithSize("cursor-eraser.svg", 32, 32, 2, 2);
183}
184
186{
187 return loadWithSize("move-tool.svg", 24, 24);
188}
189
191{
192 return loadWithSize("move-selection.svg", 32, 32, 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 loadWithSize("rotate_cursor.svg", 22, 22);
213}
214
216{
217 return loadWithSize("mesh_cursor_free.svg", 32, 32, 5, 5);
218}
219
221{
222 return loadWithSize("mesh_cursor_locked.svg", 32, 32, 5, 5);
223}
224
225QCursor KisCursor::load(const QString &cursorName, int hotspotX, int hotspotY)
226{
227 return KisCursorCache::instance()->load(cursorName, 32, 32, hotspotX, hotspotY);
228}
229
230QCursor KisCursor::loadWithSize(const QString & cursorName, int width, int height, int hotspotX, int hotspotY)
231{
232 return KisCursorCache::instance()->load(cursorName, width, height, hotspotX, hotspotY);
233}
QCursor load(const QString &cursorName, int width, int height, int hotspotX, int hotspotY)
static KisCursorCache * instance()
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 loadWithSize(const QString &cursorName, int width, int height, int hotspotX=-1, int hotspotY=-1)
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