summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/helpenginewrapper.cpp2
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp17
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h6
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro4
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp58
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoswitchevent.h89
6 files changed, 173 insertions, 3 deletions
diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp
index a53a9ee..748ad2c 100644
--- a/tools/assistant/tools/assistant/helpenginewrapper.cpp
+++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp
@@ -144,7 +144,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile)
/*
* Otherwise we will waste time if several new docs are found,
- * because we will start to index them, only to be interupted
+ * because we will start to index them, only to be interrupted
* by the next request. Also, there is a nasty SQLITE bug that will
* cause the application to hang for minutes in that case.
* This call is reverted by initalDocSetupDone(), which must be
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
index d348e70..b660eb3 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
@@ -46,6 +46,7 @@
#include <private/qgraphicssystem_runtime_p.h>
#include <private/qpixmap_raster_p.h>
#include "qmeegoruntime.h"
+#include "qmeegoswitchevent.h"
QString QMeeGoGraphicsSystemHelper::runningGraphicsSystemName()
{
@@ -81,8 +82,16 @@ void QMeeGoGraphicsSystemHelper::switchToMeeGo()
if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime"))
qWarning("Can't switch to meego - switching only supported with 'runtime' graphics system.");
else {
+ QMeeGoSwitchEvent willSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::WillSwitch);
+ foreach (QWidget *widget, QApplication::topLevelWidgets())
+ QCoreApplication::sendEvent(widget, &willSwitchEvent);
+
QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
app->setGraphicsSystem(QLatin1String("meego"));
+
+ QMeeGoSwitchEvent didSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::DidSwitch);
+ foreach (QWidget *widget, QApplication::topLevelWidgets())
+ QCoreApplication::sendEvent(widget, &didSwitchEvent);
}
}
@@ -94,8 +103,16 @@ void QMeeGoGraphicsSystemHelper::switchToRaster()
if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime"))
qWarning("Can't switch to raster - switching only supported with 'runtime' graphics system.");
else {
+ QMeeGoSwitchEvent willSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::WillSwitch);
+ foreach (QWidget *widget, QApplication::topLevelWidgets())
+ QCoreApplication::sendEvent(widget, &willSwitchEvent);
+
QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
app->setGraphicsSystem(QLatin1String("raster"));
+
+ QMeeGoSwitchEvent didSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::DidSwitch);
+ foreach (QWidget *widget, QApplication::topLevelWidgets())
+ QCoreApplication::sendEvent(widget, &didSwitchEvent);
}
}
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
index 2baacbb..d47c829 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h
@@ -102,6 +102,9 @@ public:
When running with the 'runtime' graphics system, sets the currently active
system to 'meego'. The window surface and all the resources are automatically
migrated to OpenGL. Will fail if the active graphics system is not 'runtime'.
+ Calling this function will emit QMeeGoSwitchEvent to the top level widgets.
+ Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch)
+ and one after the switch (QMeeGoSwitchEvent::DidSwitch).
*/
static void switchToMeeGo();
@@ -111,6 +114,9 @@ public:
system to 'raster'. The window surface and the graphics resources (including the
EGL shared image resources) are automatically migrated back to the CPU. All OpenGL
resources (surface, context, cache, font cache) are automaticall anihilated.
+ Calling this function will emit QMeeGoSwitchEvent to the top level widgets.
+ Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch)
+ and one after the switch (QMeeGoSwitchEvent::DidSwitch).
*/
static void switchToRaster();
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro
index 161a31b..360847e 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro
@@ -6,5 +6,5 @@ include(../../src/qbase.pri)
QT += gui
INCLUDEPATH += '../../src/plugins/graphicssystems/meego'
-HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h
-SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp
+HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegoswitchevent.h
+SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp qmeegoswitchevent.cpp qmeegoswitchevent.h
diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
new file mode 100644
index 0000000..b136ce8
--- /dev/null
+++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 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$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qmeegoswitchevent.h"
+
+QMeeGoSwitchEvent::QMeeGoSwitchEvent(const QString &graphicsSystemName, QMeeGoSwitchEvent::State s) : QEvent((QEvent::Type) QMeeGoSwitchEvent::SwitchEvent)
+{
+ name = graphicsSystemName;
+ switchState = s;
+}
+
+QString QMeeGoSwitchEvent::graphicsSystemName() const
+{
+ return name;
+}
+
+QMeeGoSwitchEvent::State QMeeGoSwitchEvent::state() const
+{
+ return switchState;
+} \ No newline at end of file
diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h
new file mode 100644
index 0000000..2d8371e
--- /dev/null
+++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 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$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QEvent>
+#include <QString>
+
+//! A custom event representing a graphics system switch.
+/*!
+ This event is sent two times -- before the actual switch and after the switch.
+ The current mode of the event can be detected by looking at the State of the
+ event.
+
+ The end-user application can use the event to drop it's own allocated GL resources
+ when going to software mode.
+*/
+
+class QMeeGoSwitchEvent : public QEvent
+{
+public:
+
+ //! The state represented by this event.
+ enum State {
+ WillSwitch,
+ DidSwitch
+ };
+
+ //! The event type id to use to detect this event.
+ enum Type {
+ SwitchEvent = QEvent::User + 1024
+ };
+
+ //! Constructor for the event.
+ /*!
+ Creates a new event with the given name and the given state.
+ */
+ QMeeGoSwitchEvent(const QString &graphicsSystemName, State s);
+
+ //! Returns the name of the target graphics system.
+ /*!
+ Depending on the state, the name represents the system we're about to swtich to,
+ or the system we just switched to.
+ */
+ QString graphicsSystemName() const;
+
+ //! Returns the state represented by this event.
+ State state() const;
+
+private:
+ QString name;
+ State switchState;
+};