summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp46
-rw-r--r--library/qpeapplication.h2
2 files changed, 48 insertions, 0 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 149e6bb..71ec5b3 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1069,2 +1069,35 @@ void QPEApplication::setDefaultRotation( int r )
+#include <qgfx_qws.h>
+#include <qwindowsystem_qws.h>
+#include <qpixmapcache.h>
+
+extern void qws_clearLoadedFonts();
+
+inline void QPEApplication::setCurrentMode( int x, int y, int depth )
+{
+ // Reset the caches
+ qws_clearLoadedFonts();
+ QPixmapCache::clear();
+
+ // Change the screen mode
+ qt_screen->setMode(x, y, depth);
+
+ if ( qApp->type() == GuiServer ) {
+ // Reconfigure the GuiServer
+ qwsServer->beginDisplayReconfigure();
+ qwsServer->endDisplayReconfigure();
+
+ // Get all the running apps to reset
+ QCopEnvelope env( "QPE/System", "reset()" );
+ }
+}
+
+inline void QPEApplication::reset() {
+ // Reconnect to the screen
+ qt_screen->disconnect();
+ qt_screen->connect( QString::null );
+
+ // Redraw everything
+ applyStyle();
+}
@@ -1182,2 +1215,15 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data
}
+ else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net>
+ if ( type() == GuiServer ) {
+ int x, y, depth;
+ stream >> x;
+ stream >> y;
+ stream >> depth;
+ setCurrentMode( x, y, depth );
+ }
+ }
+ else if ( msg == "reset()" ) {
+ if ( type() != GuiServer )
+ reset();
+ }
else if ( msg == "setCurrentRotation(int)" ) {
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 343e0b9..42810e8 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -50,2 +50,3 @@ public:
void applyStyle();
+ void reset();
static int defaultRotation();
@@ -53,2 +54,3 @@ public:
static void setCurrentRotation(int r);
+ static void setCurrentMode(int x, int y, int depth );
static void grabKeyboard();