summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Dominic K <mdk@codethink.co.uk>2010-11-17 09:55:09 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-11-17 10:41:54 (GMT)
commit0091dcee679c8787f80bc2ed49f263c801779987 (patch)
tree65dc3e1f762f9f01d17c0ce8465fd6a5be12365e
parentb2a89cf4049e425553bfe74bcb1a52433e6a13c7 (diff)
downloadQt-0091dcee679c8787f80bc2ed49f263c801779987.zip
Qt-0091dcee679c8787f80bc2ed49f263c801779987.tar.gz
Qt-0091dcee679c8787f80bc2ed49f263c801779987.tar.bz2
Documentation update for new switching events.
Merge-request: 926 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h6
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoswitchevent.h26
2 files changed, 31 insertions, 1 deletions
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/qmeegoswitchevent.h b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h
index a67c6c4..2d8371e 100644
--- a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h
+++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h
@@ -42,22 +42,46 @@
#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;
- State state() const;
+ //! Returns the state represented by this event.
+ State state() const;
private:
QString name;