2 * Copyright (C) 2015 Canonical, Ltd.
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17#ifndef CURSORIMAGEPROVIDER_H
18#define CURSORIMAGEPROVIDER_H
20#include <QQuickImageProvider>
21#include <QScopedPointer>
31 virtual ~CursorImage() {}
37class XCursorImage : public CursorImage {
39 XCursorImage(const QString &theme, const QString &file);
40 virtual ~XCursorImage();
42 XcursorImages *xcursorImages;
45class BuiltInCursorImage : public CursorImage {
50class BlankCursorImage : public CursorImage {
55class CustomCursorImage : public CursorImage {
57 CustomCursorImage(const QCursor &cursor);
60class CursorImageProvider : public QQuickImageProvider
63 CursorImageProvider();
64 virtual ~CursorImageProvider();
66 static CursorImageProvider *instance() { return m_instance; }
69 QImage requestImage(const QString &cursorName, QSize *size, const QSize &requestedSize) override;
71 QPoint hotspot(const QString &themeName, const QString &cursorName);
73 void setCustomCursor(const QCursor &customCursor);
76 CursorImage *fetchCursor(const QString &cursorThemeAndName);
77 CursorImage *fetchCursor(const QString &themeName, const QString &cursorName);
78 CursorImage *fetchCursorHelper(const QString &themeName, const QString &cursorName);
80 // themeName -> (cursorName -> cursorImage)
81 QMap<QString, QMap<QString, CursorImage*> > m_cursors;
83 QScopedPointer<CursorImage> m_builtInCursorImage;
84 BlankCursorImage m_blankCursorImage;
85 QScopedPointer<CursorImage> m_customCursorImage;
87 QMap<QString, QStringList> m_fallbackNames;
89 static CursorImageProvider *m_instance;
92#endif // CURSORIMAGEPROVIDER_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list