eglfs: move m_pos into Cursor
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Wed, 20 Jun 2012 00:09:06 +0000 (17:09 -0700)
committerQt by Nokia <qt-info@nokia.com>
Fri, 22 Jun 2012 13:42:44 +0000 (15:42 +0200)
Change-Id: I51e92d265e7ea6372ae58b357f75362e2d9a2df9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp
src/plugins/platforms/eglfs/qeglfscursor.cpp
src/plugins/platforms/eglfs/qeglfscursor.h

index 158e694..8b6349c 100644 (file)
@@ -206,14 +206,14 @@ public:
     }
 
     void setPos(const QPoint &pos) Q_DECL_OVERRIDE {
-        m_pos = pos;
+        m_cursor.pos = pos;
         moveDispmanxLayer(m_window, cursorRect().topLeft());
     }
 
     void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE {
         if (event.type() != QEvent::MouseMove)
             return;
-        m_pos = event.pos();
+        m_cursor.pos = event.pos();
         moveDispmanxLayer(m_window, cursorRect().topLeft());
     }
 
index 8627cfb..a0bfa80 100644 (file)
@@ -50,7 +50,7 @@
 QT_BEGIN_NAMESPACE
 
 QEglFSCursor::QEglFSCursor(QEglFSScreen *screen)
-    : m_screen(screen), m_pos(0, 0), m_program(0), m_vertexCoordEntry(0), m_textureCoordEntry(0), m_textureEntry(0)
+    : m_screen(screen), m_program(0), m_vertexCoordEntry(0), m_textureCoordEntry(0), m_textureEntry(0)
 {
     initCursorAtlas();
 
@@ -224,23 +224,23 @@ bool QEglFSCursor::setCurrentCursor(QCursor *cursor)
 
 void QEglFSCursor::update(const QRegion &rgn)
 {
-    QWindowSystemInterface::handleSynchronousExposeEvent(m_screen->topLevelAt(m_pos), rgn);
+    QWindowSystemInterface::handleSynchronousExposeEvent(m_screen->topLevelAt(m_cursor.pos), rgn);
 }
 
 QRect QEglFSCursor::cursorRect() const
 {
-    return QRect(m_pos - m_cursor.hotSpot, m_cursor.size);
+    return QRect(m_cursor.pos - m_cursor.hotSpot, m_cursor.size);
 }
 
 QPoint QEglFSCursor::pos() const
 {
-    return m_pos;
+    return m_cursor.pos;
 }
 
 void QEglFSCursor::setPos(const QPoint &pos)
 {
     const QRect oldCursorRect = cursorRect();
-    m_pos = pos;
+    m_cursor.pos = pos;
     update(oldCursorRect | cursorRect());
 }
 
@@ -249,7 +249,7 @@ void QEglFSCursor::pointerEvent(const QMouseEvent &event)
     if (event.type() != QEvent::MouseMove)
         return;
     const QRect oldCursorRect = cursorRect();
-    m_pos = event.pos();
+    m_cursor.pos = event.pos();
     update(oldCursorRect | cursorRect());
 }
 
index 4a3ba89..c626caf 100644 (file)
@@ -83,11 +83,10 @@ protected:
         QSize size; // size of the cursor
         QPoint hotSpot;
         QImage customCursorImage;
+        QPoint pos; // current cursor position
         uint customCursorTexture;
     } m_cursor;
 
-    QPoint m_pos; // current cursor position
-
 private:
     void createShaderPrograms();
     static void createCursorTexture(uint *texture, const QImage &image);