Emit signals to notify window (de)activation
authorKevin Ottens <kevin.ottens.qnx@kdab.com>
Mon, 30 Apr 2012 15:10:06 +0000 (17:10 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 3 May 2012 09:33:05 +0000 (11:33 +0200)
The event notifier now deals also with the windowActive and
windowInactive PPS messages. The event handler simply emit the
corresponding signals.

Change-Id: I1906a47a314bf81877e4dd3dc52c6463312f3aac
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
src/plugins/platforms/qnx/qqnxbpseventfilter.cpp
src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp
src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h
src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp

index 647e1a6..089d568 100644 (file)
@@ -191,6 +191,26 @@ bool QQnxBpsEventFilter::handleNavigatorEvent(bps_event_t *event)
         m_navigatorEventHandler->handleExit();
         break;
 
+    case NAVIGATOR_WINDOW_ACTIVE: {
+        #if defined(QQNXBPSEVENTFILTER_DEBUG)
+        qDebug() << "QQNX: Navigator WINDOW ACTIVE event";
+        #endif
+
+        const QByteArray id(navigator_event_get_groupid(event));
+        m_navigatorEventHandler->handleWindowGroupActivated(id);
+        break;
+    }
+
+    case NAVIGATOR_WINDOW_INACTIVE: {
+        #if defined(QQNXBPSEVENTFILTER_DEBUG)
+        qDebug() << "QQNX: Navigator WINDOW INACTIVE event";
+        #endif
+
+        const QByteArray id(navigator_event_get_groupid(event));
+        m_navigatorEventHandler->handleWindowGroupDeactivated(id);
+        break;
+    }
+
     default:
         #if defined(QQNXBPSEVENTFILTER_DEBUG)
         qDebug() << "QQNX: Unhandled navigator event. code=" << bps_event_get_code(event);
index 72227c6..41b4a2f 100644 (file)
@@ -95,4 +95,22 @@ void QQnxNavigatorEventHandler::handleExit()
     QCoreApplication::quit();
 }
 
+void QQnxNavigatorEventHandler::handleWindowGroupActivated(const QByteArray &id)
+{
+#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG)
+    qDebug() << Q_FUNC_INFO << id;
+#endif
+
+    Q_EMIT windowGroupActivated(id);
+}
+
+void QQnxNavigatorEventHandler::handleWindowGroupDeactivated(const QByteArray &id)
+{
+#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG)
+    qDebug() << Q_FUNC_INFO << id;
+#endif
+
+    Q_EMIT windowGroupDeactivated(id);
+}
+
 QT_END_NAMESPACE
index 58a1ac8..3633741 100644 (file)
@@ -56,9 +56,13 @@ public:
     void handleOrientationChange(int angle);
     void handleSwipeDown();
     void handleExit();
+    void handleWindowGroupActivated(const QByteArray &id);
+    void handleWindowGroupDeactivated(const QByteArray &id);
 
 Q_SIGNALS:
     void rotationChanged(int angle);
+    void windowGroupActivated(const QByteArray &id);
+    void windowGroupDeactivated(const QByteArray &id);
 };
 
 QT_END_NAMESPACE
index d5220c9..23e2167 100644 (file)
@@ -197,6 +197,10 @@ void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByt
         m_eventHandler->handleSwipeDown();
     } else if (msg == "exit") {
         m_eventHandler->handleExit();
+    } else if (msg == "windowActive") {
+        m_eventHandler->handleWindowGroupActivated(dat);
+    } else if (msg == "windowInactive") {
+        m_eventHandler->handleWindowGroupDeactivated(dat);
     }
 }