-rw-r--r-- | library/qpeapplication.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index df313ce..3efba20 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -59,64 +59,65 @@ | |||
59 | #define QTOPIA_INTERNAL_INITAPP | 59 | #define QTOPIA_INTERNAL_INITAPP |
60 | #include "qpeapplication.h" | 60 | #include "qpeapplication.h" |
61 | #include "qpestyle.h" | 61 | #include "qpestyle.h" |
62 | #include "styleinterface.h" | 62 | #include "styleinterface.h" |
63 | #if QT_VERSION >= 300 | 63 | #if QT_VERSION >= 300 |
64 | #include <qstylefactory.h> | 64 | #include <qstylefactory.h> |
65 | #else | 65 | #else |
66 | #include <qplatinumstyle.h> | 66 | #include <qplatinumstyle.h> |
67 | #include <qwindowsstyle.h> | 67 | #include <qwindowsstyle.h> |
68 | #include <qmotifstyle.h> | 68 | #include <qmotifstyle.h> |
69 | #include <qmotifplusstyle.h> | 69 | #include <qmotifplusstyle.h> |
70 | #include "lightstyle.h" | 70 | #include "lightstyle.h" |
71 | 71 | ||
72 | #include <qpe/qlibrary.h> | 72 | #include <qpe/qlibrary.h> |
73 | #endif | 73 | #endif |
74 | #include "global.h" | 74 | #include "global.h" |
75 | #include "resource.h" | 75 | #include "resource.h" |
76 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 76 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
77 | #include "qutfcodec.h" | 77 | #include "qutfcodec.h" |
78 | #endif | 78 | #endif |
79 | #include "config.h" | 79 | #include "config.h" |
80 | #include "network.h" | 80 | #include "network.h" |
81 | #ifdef QWS | 81 | #ifdef QWS |
82 | #include "fontmanager.h" | 82 | #include "fontmanager.h" |
83 | #include "fontdatabase.h" | 83 | #include "fontdatabase.h" |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #include "alarmserver.h" | 86 | #include "alarmserver.h" |
87 | #include "applnk.h" | 87 | #include "applnk.h" |
88 | #include "qpemenubar.h" | 88 | #include "qpemenubar.h" |
89 | #include "textcodecinterface.h" | 89 | #include "textcodecinterface.h" |
90 | #include "imagecodecinterface.h" | 90 | #include "imagecodecinterface.h" |
91 | #include <qtopia/qpeglobal.h> | ||
91 | 92 | ||
92 | #include <unistd.h> | 93 | #include <unistd.h> |
93 | #include <sys/file.h> | 94 | #include <sys/file.h> |
94 | #include <sys/ioctl.h> | 95 | #include <sys/ioctl.h> |
95 | #ifndef QT_NO_SOUND | 96 | #ifndef QT_NO_SOUND |
96 | #include <sys/soundcard.h> | 97 | #include <sys/soundcard.h> |
97 | #endif | 98 | #endif |
98 | #include "qt_override_p.h" | 99 | #include "qt_override_p.h" |
99 | 100 | ||
100 | #include <backend/rohfeedback.h> | 101 | #include <backend/rohfeedback.h> |
101 | 102 | ||
102 | 103 | ||
103 | static bool useBigPixmaps = 0; | 104 | static bool useBigPixmaps = 0; |
104 | 105 | ||
105 | class HackWidget : public QWidget | 106 | class HackWidget : public QWidget |
106 | { | 107 | { |
107 | public: | 108 | public: |
108 | bool needsOk() | 109 | bool needsOk() |
109 | { return (getWState() & WState_Reserved1 ); } | 110 | { return (getWState() & WState_Reserved1 ); } |
110 | 111 | ||
111 | QRect normalGeometry() | 112 | QRect normalGeometry() |
112 | { return topData()->normalGeometry; }; | 113 | { return topData()->normalGeometry; }; |
113 | }; | 114 | }; |
114 | 115 | ||
115 | class QPEApplicationData | 116 | class QPEApplicationData |
116 | { | 117 | { |
117 | public: | 118 | public: |
118 | QPEApplicationData ( ) : | 119 | QPEApplicationData ( ) : |
119 | presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), | 120 | presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), |
120 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), | 121 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), |
121 | keep_running( true ), qcopQok( false ), | 122 | keep_running( true ), qcopQok( false ), |
122 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), | 123 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), |
@@ -1265,70 +1266,65 @@ void QPEApplication::setCurrentMode( int x, int y, int depth ) | |||
1265 | // Reset the caches | 1266 | // Reset the caches |
1266 | #if QT_VERSION > 236 | 1267 | #if QT_VERSION > 236 |
1267 | qws_clearLoadedFonts(); | 1268 | qws_clearLoadedFonts(); |
1268 | #endif | 1269 | #endif |
1269 | QPixmapCache::clear(); | 1270 | QPixmapCache::clear(); |
1270 | 1271 | ||
1271 | // Change the screen mode | 1272 | // Change the screen mode |
1272 | qt_screen->setMode(x, y, depth); | 1273 | qt_screen->setMode(x, y, depth); |
1273 | 1274 | ||
1274 | if ( qApp->type() == GuiServer ) { | 1275 | if ( qApp->type() == GuiServer ) { |
1275 | #if QT_VERSION > 236 | 1276 | #if QT_VERSION > 236 |
1276 | // Reconfigure the GuiServer | 1277 | // Reconfigure the GuiServer |
1277 | qwsServer->beginDisplayReconfigure(); | 1278 | qwsServer->beginDisplayReconfigure(); |
1278 | qwsServer->endDisplayReconfigure(); | 1279 | qwsServer->endDisplayReconfigure(); |
1279 | #endif | 1280 | #endif |
1280 | // Get all the running apps to reset | 1281 | // Get all the running apps to reset |
1281 | QCopEnvelope env( "QPE/System", "reset()" ); | 1282 | QCopEnvelope env( "QPE/System", "reset()" ); |
1282 | } | 1283 | } |
1283 | } | 1284 | } |
1284 | 1285 | ||
1285 | void QPEApplication::reset() { | 1286 | void QPEApplication::reset() { |
1286 | // Reconnect to the screen | 1287 | // Reconnect to the screen |
1287 | qt_screen->disconnect(); | 1288 | qt_screen->disconnect(); |
1288 | qt_screen->connect( QString::null ); | 1289 | qt_screen->connect( QString::null ); |
1289 | 1290 | ||
1290 | // Redraw everything | 1291 | // Redraw everything |
1291 | applyStyle(); | 1292 | applyStyle(); |
1292 | } | 1293 | } |
1293 | 1294 | ||
1294 | #if (QT_VERSION < 238) && defined Q_OS_MACX | 1295 | #if (QT_VERSION < 238) && defined Q_OS_MACX |
1295 | bool qt_left_hand_scrollbars = false; | 1296 | bool qt_left_hand_scrollbars = false; |
1296 | #else | 1297 | #else |
1297 | #ifdef Q_OS_MACX | 1298 | extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL; |
1298 | #define WEAK_SYMBOL __attribute__((weak_import)) | ||
1299 | #else | ||
1300 | #define WEAK_SYMBOL __attribute__((weak)) | ||
1301 | #endif | ||
1302 | extern bool qt_left_hand_scrollbars WEAK_SYMBOL; | ||
1303 | #endif | 1299 | #endif |
1304 | 1300 | ||
1305 | /*! | 1301 | /*! |
1306 | \internal | 1302 | \internal |
1307 | */ | 1303 | */ |
1308 | void QPEApplication::applyStyle() | 1304 | void QPEApplication::applyStyle() |
1309 | { | 1305 | { |
1310 | Config config( "qpe" ); | 1306 | Config config( "qpe" ); |
1311 | config.setGroup( "Appearance" ); | 1307 | config.setGroup( "Appearance" ); |
1312 | 1308 | ||
1313 | #if QT_VERSION > 233 | 1309 | #if QT_VERSION > 233 |
1314 | #if !defined(OPIE_NO_OVERRIDE_QT) | 1310 | #if !defined(OPIE_NO_OVERRIDE_QT) |
1315 | // don't block ourselves ... | 1311 | // don't block ourselves ... |
1316 | Opie::force_appearance = 0; | 1312 | Opie::force_appearance = 0; |
1317 | 1313 | ||
1318 | static QString appname = Opie::binaryName ( ); | 1314 | static QString appname = Opie::binaryName ( ); |
1319 | 1315 | ||
1320 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | 1316 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); |
1321 | int nostyle = 0; | 1317 | int nostyle = 0; |
1322 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | 1318 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { |
1323 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | 1319 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { |
1324 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 1320 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
1325 | break; | 1321 | break; |
1326 | } | 1322 | } |
1327 | } | 1323 | } |
1328 | #else | 1324 | #else |
1329 | int nostyle = 0; | 1325 | int nostyle = 0; |
1330 | #endif | 1326 | #endif |
1331 | 1327 | ||
1332 | // Widget style | 1328 | // Widget style |
1333 | QString style = config.readEntry( "Style", "FlatStyle" ); | 1329 | QString style = config.readEntry( "Style", "FlatStyle" ); |
1334 | 1330 | ||