Qt 4.8
qplatformcursor_qpa.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtOpenVG module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 #ifndef QGRAPHICSSYSTEMCURSOR_H
42 #define QGRAPHICSSYSTEMCURSOR_H
43 
44 #include <QtCore/QList>
45 #include <QtGui/QImage>
46 #include <QtGui/QMouseEvent>
47 #include <QtCore/QWeakPointer>
48 #include <QtCore/QObject>
49 #include <QtGui/QPlatformScreen>
50 #include <QtGui/QCursor>
51 
53 
55 
56 QT_MODULE(Gui)
57 
58 // Cursor graphics management
60 public:
61  QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
62  { set(data, mask, width, height, hotX, hotY); }
63  QImage * image() { return &cursorImage; }
64  QPoint hotspot() { return hot; }
65  void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY);
66  void set(const QImage &image, int hx, int hy);
67  void set(Qt::CursorShape);
68 private:
69  static void createSystemCursor(int id);
72 };
73 
74 class QPlatformCursor;
75 
77 public:
80 };
81 
83 public:
85 
86  // input methods
87  virtual void pointerEvent(const QMouseEvent & event) { Q_UNUSED(event); }
88  virtual void changeCursor(QCursor * widgetCursor, QWidget * widget) = 0;
89  virtual QPoint pos() const;
90  virtual void setPos(const QPoint &pos);
91 
92 protected:
93  QPlatformScreen* screen; // Where to request an update
94 
95 private:
97  friend void qt_qpa_set_cursor(QWidget * w, bool force);
98  friend class QApplicationPrivate;
99 };
100 
102 
104 
105 #endif // QGRAPHICSSYSTEMCURSOR_H
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
EventRef event
QPointer< QWidget > widget
#define QT_MODULE(x)
Definition: qglobal.h:2783
The QPlatformScreen class provides an abstraction for visual displays.
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
The QPlatformCursor class provides information about pointer device events (movement, buttons), and requests to change the currently displayed cursor.
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
unsigned char uchar
Definition: qglobal.h:994
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
void qt_qpa_set_cursor(QWidget *w, bool force)
static QList< QWeakPointer< QPlatformCursor > > instances
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static const char * data(const QByteArray &arr)
QImage * image()
Return the cursor graphic as a pointer to a QImage.
The QMouseEvent class contains parameters that describe a mouse event.
Definition: qevent.h:85
QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
Sets the cursor image to the graphic represented by the combination of data and mask, with dimensions given by width and height and a hotspot at the point specified by (hotX, hotY).
QPoint hotspot()
Return the cursor&#39;s hotspot.
The QPlatformCursorImage class provides a set of graphics intended to be used as cursors.
CursorShape
Definition: qnamespace.h:1262
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QPlatformScreen * screen
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
#define class
#define QT_END_HEADER
Definition: qglobal.h:137
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
static QList< QWeakPointer< QPlatformCursor > > getInstances()
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
virtual void pointerEvent(const QMouseEvent &event)
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input...