-rw-r--r-- | library/qpeapplication.cpp | 46 |
1 files changed, 46 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 | |||
@@ -1066,8 +1066,41 @@ void QPEApplication::setDefaultRotation( int r ) | |||
1066 | 1066 | ||
1067 | } | 1067 | } |
1068 | } | 1068 | } |
1069 | 1069 | ||
1070 | #include <qgfx_qws.h> | ||
1071 | #include <qwindowsystem_qws.h> | ||
1072 | #include <qpixmapcache.h> | ||
1073 | |||
1074 | extern void qws_clearLoadedFonts(); | ||
1075 | |||
1076 | inline void QPEApplication::setCurrentMode( int x, int y, int depth ) | ||
1077 | { | ||
1078 | // Reset the caches | ||
1079 | qws_clearLoadedFonts(); | ||
1080 | QPixmapCache::clear(); | ||
1081 | |||
1082 | // Change the screen mode | ||
1083 | qt_screen->setMode(x, y, depth); | ||
1084 | |||
1085 | if ( qApp->type() == GuiServer ) { | ||
1086 | // Reconfigure the GuiServer | ||
1087 | qwsServer->beginDisplayReconfigure(); | ||
1088 | qwsServer->endDisplayReconfigure(); | ||
1089 | |||
1090 | // Get all the running apps to reset | ||
1091 | QCopEnvelope env( "QPE/System", "reset()" ); | ||
1092 | } | ||
1093 | } | ||
1094 | |||
1095 | inline void QPEApplication::reset() { | ||
1096 | // Reconnect to the screen | ||
1097 | qt_screen->disconnect(); | ||
1098 | qt_screen->connect( QString::null ); | ||
1099 | |||
1100 | // Redraw everything | ||
1101 | applyStyle(); | ||
1102 | } | ||
1070 | 1103 | ||
1071 | /*! | 1104 | /*! |
1072 | \internal | 1105 | \internal |
1073 | */ | 1106 | */ |
@@ -1179,8 +1212,21 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data | |||
1179 | stream >> r; | 1212 | stream >> r; |
1180 | setDefaultRotation( r ); | 1213 | setDefaultRotation( r ); |
1181 | } | 1214 | } |
1182 | } | 1215 | } |
1216 | else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net> | ||
1217 | if ( type() == GuiServer ) { | ||
1218 | int x, y, depth; | ||
1219 | stream >> x; | ||
1220 | stream >> y; | ||
1221 | stream >> depth; | ||
1222 | setCurrentMode( x, y, depth ); | ||
1223 | } | ||
1224 | } | ||
1225 | else if ( msg == "reset()" ) { | ||
1226 | if ( type() != GuiServer ) | ||
1227 | reset(); | ||
1228 | } | ||
1183 | else if ( msg == "setCurrentRotation(int)" ) { | 1229 | else if ( msg == "setCurrentRotation(int)" ) { |
1184 | int r; | 1230 | int r; |
1185 | stream >> r; | 1231 | stream >> r; |
1186 | setCurrentRotation( r ); | 1232 | setCurrentRotation( r ); |