Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kcontrol / input / xcursor / xcursortheme.h
blobb474086c565fdea61a6e56e0c75cba0ddfecfe44
1 /*
2 * Copyright © 2006-2007 Fredrik Höglund <fredrik@kde.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License version 2 or at your option version 3 as published by
7 * the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef XCURSORTHEME_H
21 #define XCURSORTHEME_H
23 #include <QHash>
25 #include "legacytheme.h"
27 class QDir;
29 struct _XcursorImage;
30 struct _XcursorImages;
32 typedef _XcursorImage XcursorImage;
33 typedef _XcursorImages XcursorImages;
35 /**
36 * The XCursorTheme class is a CursorTheme implementation for Xcursor themes.
38 class XCursorTheme : public LegacyTheme
40 public:
41 /**
42 * Initializes itself from the @p dir information, and parses the
43 * index.theme file if the dir has one.
45 XCursorTheme(const QDir &dir);
46 virtual ~XCursorTheme() {}
48 const QStringList inherits() const { return m_inherits; }
49 QImage loadImage(const QString &name, int size = -1) const;
50 QCursor loadCursor(const QString &name, int size = -1) const;
52 protected:
53 XCursorTheme(const QString &title, const QString &desc)
54 : LegacyTheme(title, desc) {}
55 void setInherits(const QStringList &val) { m_inherits = val; }
57 private:
58 XcursorImage *xcLoadImage(const QString &name, int size) const;
59 XcursorImages *xcLoadImages(const QString &name, int size) const;
60 void parseIndexFile();
61 QString findAlternative(const QString &name) const;
63 QStringList m_inherits;
64 static QHash<QString, QString> alternatives;
67 #endif // XCURSORTHEME_H