From 0091dcee679c8787f80bc2ed49f263c801779987 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Wed, 17 Nov 2010 10:55:09 +0100 Subject: Documentation update for new switching events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 926 Reviewed-by: Samuel Rødal --- .../qmeegographicssystemhelper.h | 6 +++++ .../qmeegographicssystemhelper/qmeegoswitchevent.h | 26 +++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) 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 #include +//! 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; -- cgit v0.12