summaryrefslogtreecommitdiff
authorzecke <zecke>2003-08-29 18:04:43 (UTC)
committer zecke <zecke>2003-08-29 18:04:43 (UTC)
commit18cae99f1deb15213074a8fb96f79eae4b0c5a43 (patch) (side-by-side diff)
tree1dc5c46deef1558b8cca0fd716c3a154c6eb6ac8
parent885c645ee48ae53467e244521c011c73bc106afb (diff)
downloadopie-18cae99f1deb15213074a8fb96f79eae4b0c5a43.zip
opie-18cae99f1deb15213074a8fb96f79eae4b0c5a43.tar.gz
opie-18cae99f1deb15213074a8fb96f79eae4b0c5a43.tar.bz2
Patch provided by mithro
I've included 2 patches need to make opie support on the fly screen resolution changing. This is done with the following, qcop "QPE/System" "setCurrentMode(int,int,int)" 480 640 16 This is good for running applications in compatibility mode on the C700. As you can see there isn't much to these patches.
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
@@ -1067,6 +1067,39 @@ 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();
+}
/*!
\internal
@@ -1180,6 +1213,19 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data
setDefaultRotation( r );
}
}
+ 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)" ) {
int r;
stream >> r;
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 343e0b9..42810e8 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -48,9 +48,11 @@ public:
static QString qpeDir();
static QString documentDir();
void applyStyle();
+ void reset();
static int defaultRotation();
static void setDefaultRotation(int r);
static void setCurrentRotation(int r);
+ static void setCurrentMode(int x, int y, int depth );
static void grabKeyboard();
static void ungrabKeyboard();