Drop ImageCursorSource

The ImageCursorSource used to be primarily a porting aid. That is, if we
couldn't port some code to SurfaceCursorSource or ShapeCursorSource, the
ImageCursorSource was used in interim. Now, all parts of kwin have been
ported to ShapeCursorSource and SurfaceCursorSource, so the image cursor
source can be dropped.
This commit is contained in:
Vlad Zahorodnii 2023-05-10 10:07:19 +03:00
parent 3d5b5844d0
commit 76e911d2cc
4 changed files with 0 additions and 30 deletions

View file

@ -32,19 +32,6 @@ QPointF CursorSource::hotspot() const
return m_hotspot;
}
ImageCursorSource::ImageCursorSource(QObject *parent)
: CursorSource(parent)
{
}
void ImageCursorSource::update(const QImage &image, const QPointF &hotspot)
{
m_image = image;
m_size = QSizeF(image.size()) / image.devicePixelRatio();
m_hotspot = hotspot;
Q_EMIT changed();
}
ShapeCursorSource::ShapeCursorSource(QObject *parent)
: CursorSource(parent)
{

View file

@ -45,20 +45,6 @@ protected:
QPointF m_hotspot;
};
/**
* The ImageCursorSource class represents a static raster cursor pixmap.
*/
class KWIN_EXPORT ImageCursorSource : public CursorSource
{
Q_OBJECT
public:
explicit ImageCursorSource(QObject *parent = nullptr);
public Q_SLOTS:
void update(const QImage &image, const QPointF &hotspot);
};
/**
* The ShapeCursorSource class represents the contents of a shape in the cursor theme.
*/

View file

@ -34,7 +34,6 @@ class CursorImage;
class InputDevice;
class InputRedirection;
class CursorShape;
class ImageCursorSource;
class ShapeCursorSource;
class SurfaceCursorSource;

View file

@ -31,8 +31,6 @@ void CursorItem::refresh()
const CursorSource *source = Cursors::self()->currentCursor()->source();
if (auto surfaceSource = qobject_cast<const SurfaceCursorSource *>(source)) {
setSurface(surfaceSource->surface());
} else if (auto imageSource = qobject_cast<const ImageCursorSource *>(source)) {
setImage(imageSource->image());
} else if (auto shapeSource = qobject_cast<const ShapeCursorSource *>(source)) {
setImage(shapeSource->image());
}