-rw-r--r-- | library/qpeapplication.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 167fe69..cff3e43 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -147,93 +147,96 @@ signals: | |||
147 | void weekChanged( bool startOnMonday ); | 147 | void weekChanged( bool startOnMonday ); |
148 | void dateFormatChanged( DateFormat ); | 148 | void dateFormatChanged( DateFormat ); |
149 | void flush(); | 149 | void flush(); |
150 | void reload(); | 150 | void reload(); |
151 | /* linkChanged signal */ | 151 | /* linkChanged signal */ |
152 | 152 | ||
153 | private slots: | 153 | private slots: |
154 | void systemMessage( const QCString &msg, const QByteArray &data ); | 154 | void systemMessage( const QCString &msg, const QByteArray &data ); |
155 | void pidMessage( const QCString &msg, const QByteArray &data ); | 155 | void pidMessage( const QCString &msg, const QByteArray &data ); |
156 | void removeSenderFromStylusDict(); | 156 | void removeSenderFromStylusDict(); |
157 | void hideOrQuit(); | 157 | void hideOrQuit(); |
158 | 158 | ||
159 | protected: | 159 | protected: |
160 | bool qwsEventFilter( QWSEvent * ); | 160 | bool qwsEventFilter( QWSEvent * ); |
161 | void internalSetStyle( const QString &style ); | 161 | void internalSetStyle( const QString &style ); |
162 | void prepareForTermination(bool willrestart); | 162 | void prepareForTermination(bool willrestart); |
163 | virtual void restart(); | 163 | virtual void restart(); |
164 | virtual void shutdown(); | 164 | virtual void shutdown(); |
165 | bool eventFilter( QObject *, QEvent * ); | 165 | bool eventFilter( QObject *, QEvent * ); |
166 | void timerEvent( QTimerEvent * ); | 166 | void timerEvent( QTimerEvent * ); |
167 | bool raiseAppropriateWindow(); | 167 | bool raiseAppropriateWindow(); |
168 | virtual void tryQuit(); | 168 | virtual void tryQuit(); |
169 | private: | 169 | private: |
170 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); | 170 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); |
171 | void processQCopFile(); | 171 | void processQCopFile(); |
172 | 172 | ||
173 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 173 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
174 | QCopChannel *sysChannel; | 174 | QCopChannel *sysChannel; |
175 | QCopChannel *pidChannel; | 175 | QCopChannel *pidChannel; |
176 | #endif | 176 | #endif |
177 | QPEApplicationData *d; | 177 | QPEApplicationData *d; |
178 | 178 | ||
179 | bool reserved_sh; | 179 | bool reserved_sh; |
180 | 180 | ||
181 | }; | 181 | }; |
182 | 182 | ||
183 | 183 | ||
184 | 184 | ||
185 | enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ | 185 | enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ |
186 | 186 | ||
187 | inline int TransToDeg ( Transformation t ) | 187 | inline int TransToDeg ( Transformation t ) |
188 | { | 188 | { |
189 | int d = static_cast<int>( t ); | 189 | int d = static_cast<int>( t ); |
190 | return d * 90; | 190 | return d * 90; |
191 | } | 191 | } |
192 | 192 | ||
193 | inline Transformation DegToTrans ( int d ) | 193 | inline Transformation DegToTrans ( int d ) |
194 | { | 194 | { |
195 | Transformation t = static_cast<Transformation>( d / 90 ); | 195 | Transformation t = static_cast<Transformation>( d / 90 ); |
196 | return t; | 196 | return t; |
197 | } | 197 | } |
198 | 198 | ||
199 | /* | 199 | /* |
200 | * Set current rotation of Opie, and rotation for newly started apps. | 200 | * Set current rotation of Opie, and rotation for newly started apps. |
201 | * Differs from setDefaultRotation in that 1) it rotates currently running apps, | 201 | * Differs from setDefaultRotation in that 1) it rotates currently running apps, |
202 | * and 2) does not set deforient or save orientation to qpe.conf. | 202 | * and 2) does not set deforient or save orientation to qpe.conf. |
203 | */ | 203 | */ |
204 | 204 | ||
205 | inline void QPEApplication::setCurrentRotation( int r ) | 205 | inline void QPEApplication::setCurrentRotation( int r ) |
206 | { | 206 | { |
207 | // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots | 207 | // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots |
208 | // for compatibility with the SharpROM use fallback to setDefaultTransformation() | 208 | // for compatibility with the SharpROM use fallback to setDefaultTransformation() |
209 | #if QT_VERSION > 233 | 209 | #if QT_VERSION > 233 |
210 | Transformation e = DegToTrans( r ); | 210 | Transformation e = DegToTrans( r ); |
211 | ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 211 | QCString old = getenv("QWS_DISPLAY") ? getenv( "QWS_DISPLAY" ) : "Transformed"; |
212 | int j = 0; | ||
213 | QString driver( old.left( ( ( j = old.find( ':' ) ) >= 0 ) ? j : old.size() ).data() ); | ||
214 | ::setenv( "QWS_DISPLAY", QString( "%1:Rot%2:0" ).arg( driver ).arg( r ).latin1(), 1 ); | ||
212 | qApp->desktop()->qwsDisplay()->setTransformation( e ); | 215 | qApp->desktop()->qwsDisplay()->setTransformation( e ); |
213 | #else | 216 | #else |
214 | setDefaultRotation( r ); | 217 | setDefaultRotation( r ); |
215 | #endif | 218 | #endif |
216 | } | 219 | } |
217 | 220 | ||
218 | /* | 221 | /* |
219 | * Qtopia 1.7 SDK compatibility macros | 222 | * Qtopia 1.7 SDK compatibility macros |
220 | * FIXME: Support Opie Quicklaunch Interface | 223 | * FIXME: Support Opie Quicklaunch Interface |
221 | */ | 224 | */ |
222 | #define QTOPIA_ADD_APPLICATION(NAME,IMPLEMENTATION) \ | 225 | #define QTOPIA_ADD_APPLICATION(NAME,IMPLEMENTATION) \ |
223 | int main( int argc, char** argv ) \ | 226 | int main( int argc, char** argv ) \ |
224 | { \ | 227 | { \ |
225 | QPEApplication app = QPEApplication( argc, argv );\ | 228 | QPEApplication app = QPEApplication( argc, argv );\ |
226 | IMPLEMENTATION* mw = new IMPLEMENTATION(); \ | 229 | IMPLEMENTATION* mw = new IMPLEMENTATION(); \ |
227 | app.showMainWidget( mw ); \ | 230 | app.showMainWidget( mw ); \ |
228 | app.exec(); \ | 231 | app.exec(); \ |
229 | } | 232 | } |
230 | #define QTOPIA_MAIN // Bee-Bop-Alula | 233 | #define QTOPIA_MAIN // Bee-Bop-Alula |
231 | 234 | ||
232 | /* | 235 | /* |
233 | * -remove me | 236 | * -remove me |
234 | */ | 237 | */ |
235 | #ifdef Q_WS_QWS | 238 | #ifdef Q_WS_QWS |
236 | extern Q_EXPORT QRect qt_maxWindowRect; | 239 | extern Q_EXPORT QRect qt_maxWindowRect; |
237 | #endif | 240 | #endif |
238 | 241 | ||
239 | #endif | 242 | #endif |