diff options
author | Morten Sorvig <morten.sorvig@nokia.com> | 2011-11-03 12:58:53 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-08 15:52:28 +0100 |
commit | ed55c4a14c9e8b70b3947ca70ec690ac1b8d91fe (patch) | |
tree | f8313b8fc90555c00ef881d8d482de498a665fbd /src/plugins/platforms/cocoa/qcocoacursor.h | |
parent | f54411069cc2f587ea2fee9a4d9ae16a8dde648b (diff) |
Cocoa cursor support: Add QCocoaCursor.
Port the Qt 4 mac implementation.
Change-Id: I3bc6fd0b5a0398dcf43a5aaa3b498bb74b42c105
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacursor.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoacursor.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h new file mode 100644 index 0000000000..bb48da7ecb --- /dev/null +++ b/src/plugins/platforms/cocoa/qcocoacursor.h @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QWINDOWSCURSOR_H +#define QWINDOWSCURSOR_H + +#include <Cocoa/Cocoa.h> + +#include <QtCore> +#include <QtGui/QPlatformCursor> + +QT_BEGIN_NAMESPACE + +class QCocoaCursor : public QPlatformCursor +{ +public: + explicit QCocoaCursor(QPlatformScreen *); + + virtual void changeCursor(QCursor * widgetCursor, QWindow * widget); + virtual QPoint pos(); + virtual void setPos(const QPoint &position); +private: + QHash<Qt::CursorShape, NSCursor *> m_cursors; + NSCursor *createCursorData(QCursor *); + NSCursor *createCursorFromBitmap(const QBitmap *bitmap, const QBitmap *mask, const QPoint hotspot = QPoint()); + NSCursor *createCursorFromPixmap(const QPixmap pixmap, const QPoint hotspot = QPoint()); +}; + +QT_END_NAMESPACE + +#endif // QWINDOWSCURSOR_H |