Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
/*
* SPDX-FileCopyrightText: 2016 Michael Abrahams <[email protected]>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KIS_CURSOR_CACHE_H
#define KIS_CURSOR_CACHE_H
#include <QString>
#include <QCursor>
#include <QObject>
#include <QPair>
#include <QPoint>
#include <QHash>
// KisCursorCache implements a global static database of cursors. This allows
// Krita to load cursor data only once.
class KisCursorCache: public QObject
{
Q_OBJECT
public:
static KisCursorCache* instance();
KisCursorCache();
QCursor load(const QString & cursorName, int width, int height, int hotspotX, int hotspotY);
private:
// Stores cursor hash
QHash<QString, QPair<QPoint, QCursor>> cursorHash;
};
#endif