summaryrefslogtreecommitdiff
path: root/library/qpeapplication.h
Unidiff
Diffstat (limited to 'library/qpeapplication.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.h58
1 files changed, 12 insertions, 46 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 579fc44..00d3d31 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -31,6 +31,7 @@
31#endif 31#endif
32#include "qpedecoration_qws.h" 32#include "qpedecoration_qws.h"
33#include "timestring.h" 33#include "timestring.h"
34#include "qpeglobal.h"
34 35
35class QCopChannel; 36class QCopChannel;
36class QPEApplicationData; 37class QPEApplicationData;
@@ -120,9 +121,10 @@ public:
120 121
121 void showMainWidget( QWidget*, bool nomax=FALSE ); 122 void showMainWidget( QWidget*, bool nomax=FALSE );
122 void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); 123 void showMainDocumentWidget( QWidget*, bool nomax=FALSE );
123 static void showDialog( QDialog*, bool nomax=FALSE ); 124
124 static int execDialog( QDialog*, bool nomax=FALSE ); 125 static void showDialog( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
125 static void showWidget( QWidget*, bool nomax=FALSE ); 126 static int execDialog ( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
127 static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
126 /* Merge setTempScreenSaverMode */ 128 /* Merge setTempScreenSaverMode */
127#ifdef QTOPIA_INTERNAL_INITAPP 129#ifdef QTOPIA_INTERNAL_INITAPP
128 void initApp( int argv, char **argv ); 130 void initApp( int argv, char **argv );
@@ -183,50 +185,7 @@ private:
183 185
184}; 186};
185 187
186inline void QPEApplication::showDialog( QDialog* d, bool nomax )
187{
188 showWidget( d, nomax );
189}
190 188
191inline int QPEApplication::execDialog( QDialog* d, bool nomax )
192{
193 showDialog( d, nomax );
194 return d->exec();
195}
196
197#ifdef Q_WS_QWS
198extern Q_EXPORT QRect qt_maxWindowRect;
199#endif
200
201inline void QPEApplication::showWidget( QWidget* wg, bool nomax )
202{
203 if ( wg->isVisible() )
204 wg->show();
205 else
206 {
207 if ( !nomax
208 && ( qApp->desktop()->width() <= 320 ) )
209 {
210 wg->showMaximized();
211 } else {
212 #ifdef Q_WS_QWS
213 QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() );
214 #else
215 QSize desk = QSize( qt_maxWindowRect.width(), qt_maxWindowRect.height() );
216 #endif
217
218 QSize sh = wg->sizeHint();
219 int w = QMAX( sh.width(), wg->width() );
220 int h = QMAX( sh.height(), wg->height() );
221 // desktop widget-frame taskbar
222 w = QMIN( w, ( desk.width() - ( wg->frameGeometry().width() - wg->geometry().width() ) - 25 ) );
223 h = QMIN( h, ( desk.height() - ( wg->frameGeometry().height() - wg->geometry().height() ) - 25 ) );
224
225 wg->resize( w, h );
226 wg->show();
227 }
228 }
229}
230 189
231enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ 190enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */
232 191
@@ -262,4 +221,11 @@ inline void QPEApplication::setCurrentRotation( int r )
262} 221}
263 222
264 223
224/*
225 * -remove me
226 */
227#ifdef Q_WS_QWS
228extern Q_EXPORT QRect qt_maxWindowRect;
229#endif
230
265#endif 231#endif